Integrate txtai with Postgres

Integrate txtai with Postgres

txtai is an all-in-one embeddings database for semantic search, LLM orchestration and language model workflows.

The default persistence methods for txtai are local and file-based. SQLite for content, Faiss for vectors and NetworkX for graph data. The main value add of txtai is getting up and running quickly with a minimal amount of external dependencies.

Another key feature of txtai is being able to quickly move from prototyping to production. This article will demonstrate how txtai can integrate with Postgres, a powerful, production-ready and open source object-relational database system. After txtai persists content to Postgres, we’ll show it can be directly queried with SQL from any Postgres client

Install dependencies

Install txtai and all dependencies.

# Install txtai
pip install txtai[ann,database,graph]

Install Postgres

Next, we’ll install Postgres and start a Postgres instance. This will also install the pgvector extension to enable vector search and storage.

Note: With local environments, consider running Postgres as a Docker container.

# Install Postgres and pgvector
!apt-get update && apt install postgresql postgresql-server-dev-14
!git clone –branch v0.6.2 https://github.com/pgvector/pgvector.git
!cd pgvector && make && make install

# Start database
!service postgresql start
!sudo -u postgres psql -U postgres -c “ALTER USER postgres PASSWORD ‘pass’;”

Build an Embeddings database

First, we’ll load the 100K most popular articles from Wikipedia. This example will store vectors and content in Postgres.

from txtai import Embeddings

# URL set in code for demo purposes. Use environment variables in production.
url = postgresql+psycopg2://postgres:pass@localhost/postgres

# Create embeddings
embeddings = Embeddings(
content=url,
backend=pgvector,
pgvector={
url: url
}
)

# Load dataset
wikipedia = Embeddings()
wikipedia.load(provider=huggingface-hub, container=neuml/txtai-wikipedia)

query = “””
SELECT id, text FROM txtai
order by percentile desc
LIMIT 100000
“””

# Index dataset
embeddings.index(wikipedia.search(query))

embeddings.search(Tell me about a mythical horse, 1)
[{‘id’: ‘Unicorn’,
‘text’: ‘The unicorn is a legendary creature that has been described since antiquity as a beast with a single large, pointed, spiraling horn projecting from its forehead.’,
‘score’: 0.6493861675262451}]
embeddings.search(What is the main ingredient in Ketchup?, 1)
[{‘id’: ‘Ketchup’,
‘text’: ‘Ketchup or catsup is a table condiment with a sweet and sour flavor. The unmodified term (“ketchup”) now typically refers to tomato ketchup, although early recipes for various different varieties of ketchup contained mushrooms, oysters, mussels, egg whites, grapes or walnuts, among other ingredients. ‘,
‘score’: 0.6998806595802307}]

Now, let’s explore how the data is stored in further detail. We’ll save the database and take a look.

%env TOKENIZERS_PARALLELISM=false

# Commit results to the database
embeddings.save(“test”)
embeddings.close()

!ls test
!cat test/config.json

config.json
{
“content”: “postgresql+psycopg2://postgres:pass@localhost/postgres”,
“backend”: “pgvector”,
“pgvector”: {
“url”: “postgresql+psycopg2://postgres:pass@localhost/postgres”
},
“path”: “sentence-transformers/all-MiniLM-L6-v2”,
“dimensions”: 384,
“offset”: 100000
}

Note how there is only a configuration file with the database details. Let’s explore the Postgres database.

!PGPASSWORD=pass psql -h localhost -U postgres -c “SELECT * from sections order by indexid LIMIT 1”
!PGPASSWORD=pass psql -h localhost -U postgres -c “SELECT * from vectors order by indexid LIMIT 1”
indexid | id | text | tags | entry
———+———–+———————————————+——+—————————-
0 | Main Page | Welcome to Wikipedia, +| | 2024-04-24 17:02:55.335643
| | the free encyclopedia that anyone can edit.+| |
| | articles in English | |
(1 row)

indexid | embedding
———+———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
0 | [0.006224656,0.010993197,-0.020153109,0.046154346,-0.0067520724,0.011807963,-0.014358369,0.028947443,-0.01586261,0.09301224,0.055368096,0.040113293,0.01760968,0.013503182,-0.016870098,-0.012503422,-0.008597899,0.026588641,-0.08471918,-0.04503593,0.060253955,-0.0031328013,0.11977076,0.024629632,-0.022491025,-0.03793595,0.0061959964,0.0072981887,0.00796152,-0.027184578,-0.10998758,0.07487334,0.08721705,-0.003783297,2.4116285e-05,0.01077903,0.009361188,0.020106519,0.025032397,0.026869925,-0.0111307595,-0.09997612,0.019141614,0.015201731,-0.000267303,0.12866877,-0.04923438,-0.059046485,0.013421367,0.04622524,-0.024259627,-0.01578652,-0.057170264,-0.058802612,0.055165343,-0.016757669,-0.11283095,-0.010731938,-0.03237114,-0.09259695,0.026988069,0.044143338,-0.062587716,0.12294508,0.017795669,-0.0022635453,-0.000859233,0.083078146,0.009367941,-0.08944039,0.020436421,0.03098923,0.08612748,0.06908283,-0.011492079,-0.057584476,0.007815615,0.07544962,-0.07507969,-0.031771705,0.06140103,0.045389958,0.0010914068,-0.014727611,-0.0048347805,-0.008656534,-0.011555558,-0.027875263,0.044627354,-0.041978024,0.0023647482,-0.068146914,0.10593634,0.00459672,-0.0043201237,-0.003424118,0.03128756,-0.031586997,0.006560516,0.047244154,0.06694147,-0.0024762554,-0.034794953,0.0685723,-0.115641095,-0.07013151,-0.029626537,0.05652201,-0.0047345776,-0.08600411,-0.02712477,0.06307427,-0.020134196,-0.05487676,-0.010889723,-0.012801617,0.0070655714,0.01565348,0.06468041,-0.0027397969,-0.052258722,0.025590474,0.0004874447,0.0567211,-0.01091167,-0.016167942,-0.056139555,-3.360483e-33,0.06776523,0.07398922,0.021548307,0.0522404,-0.063432045,0.009229409,-0.09691417,-0.05641955,-0.055137824,-0.04107145,0.055179913,0.06995813,-0.043880165,-0.060650233,0.0026008217,0.026983975,-0.03595947,0.11371047,0.018100752,0.027147746,0.034160867,0.050208986,-0.03631904,-0.0035121094,-0.06707664,0.0063270847,0.008653185,-0.11846966,0.0075610424,0.0021807787,0.015405556,-0.017979044,-0.04683855,-0.015657036,-0.04022284,-0.017653259,0.036167417,-0.042651214,0.005417714,-0.09401236,-0.032427326,-0.017289782,-0.04060469,0.015479944,-0.011029847,0.0719449,0.0051068533,-0.06828172,0.08947456,-0.04907346,0.016336497,0.032021444,-0.04396127,-0.0036975099,0.05712386,0.089574024,0.070081435,0.06301272,0.0010954054,0.01729774,0.047785297,0.09727387,-0.0016659853,0.01636651,-0.011960934,0.08042555,-0.044158004,0.015542993,0.039673716,-0.023705207,-0.0705359,-0.0060911574,0.00903571,0.056801423,-0.04288321,0.075399615,-0.060097944,-0.070493154,-0.039201744,0.02091038,0.021842068,-0.05289644,0.032512337,-0.04969522,0.014612853,0.03174613,0.019972498,-0.018262003,0.10062693,0.03011935,0.058835424,0.008656911,-0.0693178,-0.0003107625,-0.035816267,8.551262e-34,-0.08153472,-0.109941624,0.0010887359,0.058030974,-0.05916192,-0.017850945,-0.11167397,0.107069634,0.041289993,-0.019890498,-0.0026840265,-0.098246865,-0.052144755,0.06551777,-0.04089334,-0.028716525,0.03241684,-0.06699939,-0.09264921,0.124276765,-0.07738617,-0.008159692,-0.04621176,-0.003925314,-0.028218271,0.004362621,0.0662335,0.05448178,-0.049431797,0.001068466,-0.06137263,-0.07963246,-0.056226213,-0.050934546,-0.08301799,-0.03711833,0.001591565,-0.042424005,-0.020324506,-0.05731789,0.043870095,0.040546007,0.008878352,-0.06366917,-0.030763976,-0.028072147,-0.101492785,0.0049343915,0.008031439,-0.029323548,0.052847456,-0.015137294,0.02956745,-0.10447449,0.035620738,0.0025644598,-0.032033995,-0.075608805,0.060582157,-0.03741465,-0.05037591,0.024472151,-0.19789998,0.14253329,0.027650978,0.025539117,-0.09750419,0.07298771,0.017285004,-0.05192262,0.022350593,-0.033429917,0.034556758,-0.06539779,0.03567383,-0.023474114,0.04871094,0.0045313137,0.024971936,-0.09835969,-0.0012533984,-0.0019569201,0.015049834,0.009462184,0.026953677,0.045278806,0.024228122,0.0009281798,-0.023020085,-0.024668744,0.012790688,-0.021721361,-0.026636621,0.06193553,-0.026421277,-2.0252372e-08,-0.009053995,-0.022655917,-0.05537436,0.09484807,0.006692196,-0.05305789,0.019044574,0.050973132,-0.004839857,0.07959955,-0.0562942,0.043415457,-0.051326852,0.04842562,-0.022588398,0.05024676,0.022963611,0.0699145,0.016860556,0.009093765,0.04256753,0.016887672,0.04927324,-0.0092127,0.013626016,0.045127258,-0.005615936,-0.039890807,0.0928744,-0.10173735,-0.11896241,-0.0064999964,-0.04553107,0.04174175,0.030028146,0.042279907,0.000696869,0.0012388963,-0.02783201,-0.048495434,0.04485023,0.009498387,-0.009533283,0.036473263,0.028421838,0.01844087,0.01952972,-0.021264598,0.08634994,-0.022555202,0.060081147,0.013670229,0.1497612,-0.021247797,-0.008887135,0.0306203,-0.007087516,0.024898361,0.05220465,0.012215928,0.02570937,0.046506412,0.08931996,-0.0010894431]
(1 row)

Note how the text content and vectors are stored in this Postgres instance.

Graph Embeddings

Next, we’ll rebuild the same embeddings database and enable a graph component. This graph component will also persist content to Postgres.

from txtai import Embeddings

# Create embeddings
embeddings = Embeddings(
content=url,
backend=pgvector,
pgvector={
url: url
},
graph={
backend: rdbms,
url: url,
approximate: False,
}
)

# Index dataset
embeddings.index(wikipedia.search(query))

Now, as with prior graph examples, let’s build a new graph with a query. Then we’ll plot that subgraph.

g = embeddings.graph.search(“””
MATCH P=({id:
Roman Empire})-[*1..3]->({id: Saxons})-[*1..3]->({id: Vikings})-[*1..3]->({id: Battle of Hastings})
RETURN P
LIMIT 20
“””, graph=True)
import matplotlib.pyplot as plt
import networkx as nx

def plot(graph):
labels = {x: f{graph.attribute(x, id)} for x in graph.scan()}
colors = [#D32F2F, #0277bd, #7e57c2, #757575]

results = embeddings.batchsimilarity(labels.values(), [Roman Empire, Germanic Barbarians, Viking conquest and siege, Norman Conquest of England])
colors = [colors[x[0][0]] for x in results]

options = {
node_size: 2000,
node_color: colors,
edge_color: #454545,
font_color: #efefef,
font_size: 11,
alpha: 1.0,
}

fig, ax = plt.subplots(figsize=(20, 9))
pos = nx.spring_layout(graph.backend, seed=512, k=0.9, iterations=50)
nx.draw_networkx(graph.backend, pos=pos, labels=labels, **options)
ax.set_facecolor(#303030)
ax.axis(off)
fig.set_facecolor(#303030)

plt.show()

plot(g)

🚀 Very exciting. A full graph embeddings database all backed by Postgres!

Let’s explore the database once again.

embeddings.save(test)
!PGPASSWORD=pass psql -h localhost -U postgres -c “SELECT * from sections order by indexid LIMIT 1”
!PGPASSWORD=pass psql -h localhost -U postgres -c “SELECT * from vectors order by indexid LIMIT 1”
!PGPASSWORD=pass psql -h localhost -U postgres -c “SELECT * from nodes LIMIT 1”
!PGPASSWORD=pass psql -h localhost -U postgres -c “SELECT * from edges LIMIT 1”
indexid | id | text | tags | entry
———+———–+———————————————+——+—————————-
0 | Main Page | Welcome to Wikipedia, +| | 2024-04-24 17:24:04.402629
| | the free encyclopedia that anyone can edit.+| |
| | articles in English | |
(1 row)

indexid | embedding
———+———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
0 | [0.006224656,0.010993197,-0.020153109,0.046154346,-0.0067520724,0.011807963,-0.014358369,0.028947443,-0.01586261,0.09301224,0.055368096,0.040113293,0.01760968,0.013503182,-0.016870098,-0.012503422,-0.008597899,0.026588641,-0.08471918,-0.04503593,0.060253955,-0.0031328013,0.11977076,0.024629632,-0.022491025,-0.03793595,0.0061959964,0.0072981887,0.00796152,-0.027184578,-0.10998758,0.07487334,0.08721705,-0.003783297,2.4116285e-05,0.01077903,0.009361188,0.020106519,0.025032397,0.026869925,-0.0111307595,-0.09997612,0.019141614,0.015201731,-0.000267303,0.12866877,-0.04923438,-0.059046485,0.013421367,0.04622524,-0.024259627,-0.01578652,-0.057170264,-0.058802612,0.055165343,-0.016757669,-0.11283095,-0.010731938,-0.03237114,-0.09259695,0.026988069,0.044143338,-0.062587716,0.12294508,0.017795669,-0.0022635453,-0.000859233,0.083078146,0.009367941,-0.08944039,0.020436421,0.03098923,0.08612748,0.06908283,-0.011492079,-0.057584476,0.007815615,0.07544962,-0.07507969,-0.031771705,0.06140103,0.045389958,0.0010914068,-0.014727611,-0.0048347805,-0.008656534,-0.011555558,-0.027875263,0.044627354,-0.041978024,0.0023647482,-0.068146914,0.10593634,0.00459672,-0.0043201237,-0.003424118,0.03128756,-0.031586997,0.006560516,0.047244154,0.06694147,-0.0024762554,-0.034794953,0.0685723,-0.115641095,-0.07013151,-0.029626537,0.05652201,-0.0047345776,-0.08600411,-0.02712477,0.06307427,-0.020134196,-0.05487676,-0.010889723,-0.012801617,0.0070655714,0.01565348,0.06468041,-0.0027397969,-0.052258722,0.025590474,0.0004874447,0.0567211,-0.01091167,-0.016167942,-0.056139555,-3.360483e-33,0.06776523,0.07398922,0.021548307,0.0522404,-0.063432045,0.009229409,-0.09691417,-0.05641955,-0.055137824,-0.04107145,0.055179913,0.06995813,-0.043880165,-0.060650233,0.0026008217,0.026983975,-0.03595947,0.11371047,0.018100752,0.027147746,0.034160867,0.050208986,-0.03631904,-0.0035121094,-0.06707664,0.0063270847,0.008653185,-0.11846966,0.0075610424,0.0021807787,0.015405556,-0.017979044,-0.04683855,-0.015657036,-0.04022284,-0.017653259,0.036167417,-0.042651214,0.005417714,-0.09401236,-0.032427326,-0.017289782,-0.04060469,0.015479944,-0.011029847,0.0719449,0.0051068533,-0.06828172,0.08947456,-0.04907346,0.016336497,0.032021444,-0.04396127,-0.0036975099,0.05712386,0.089574024,0.070081435,0.06301272,0.0010954054,0.01729774,0.047785297,0.09727387,-0.0016659853,0.01636651,-0.011960934,0.08042555,-0.044158004,0.015542993,0.039673716,-0.023705207,-0.0705359,-0.0060911574,0.00903571,0.056801423,-0.04288321,0.075399615,-0.060097944,-0.070493154,-0.039201744,0.02091038,0.021842068,-0.05289644,0.032512337,-0.04969522,0.014612853,0.03174613,0.019972498,-0.018262003,0.10062693,0.03011935,0.058835424,0.008656911,-0.0693178,-0.0003107625,-0.035816267,8.551262e-34,-0.08153472,-0.109941624,0.0010887359,0.058030974,-0.05916192,-0.017850945,-0.11167397,0.107069634,0.041289993,-0.019890498,-0.0026840265,-0.098246865,-0.052144755,0.06551777,-0.04089334,-0.028716525,0.03241684,-0.06699939,-0.09264921,0.124276765,-0.07738617,-0.008159692,-0.04621176,-0.003925314,-0.028218271,0.004362621,0.0662335,0.05448178,-0.049431797,0.001068466,-0.06137263,-0.07963246,-0.056226213,-0.050934546,-0.08301799,-0.03711833,0.001591565,-0.042424005,-0.020324506,-0.05731789,0.043870095,0.040546007,0.008878352,-0.06366917,-0.030763976,-0.028072147,-0.101492785,0.0049343915,0.008031439,-0.029323548,0.052847456,-0.015137294,0.02956745,-0.10447449,0.035620738,0.0025644598,-0.032033995,-0.075608805,0.060582157,-0.03741465,-0.05037591,0.024472151,-0.19789998,0.14253329,0.027650978,0.025539117,-0.09750419,0.07298771,0.017285004,-0.05192262,0.022350593,-0.033429917,0.034556758,-0.06539779,0.03567383,-0.023474114,0.04871094,0.0045313137,0.024971936,-0.09835969,-0.0012533984,-0.0019569201,0.015049834,0.009462184,0.026953677,0.045278806,0.024228122,0.0009281798,-0.023020085,-0.024668744,0.012790688,-0.021721361,-0.026636621,0.06193553,-0.026421277,-2.0252372e-08,-0.009053995,-0.022655917,-0.05537436,0.09484807,0.006692196,-0.05305789,0.019044574,0.050973132,-0.004839857,0.07959955,-0.0562942,0.043415457,-0.051326852,0.04842562,-0.022588398,0.05024676,0.022963611,0.0699145,0.016860556,0.009093765,0.04256753,0.016887672,0.04927324,-0.0092127,0.013626016,0.045127258,-0.005615936,-0.039890807,0.0928744,-0.10173735,-0.11896241,-0.0064999964,-0.04553107,0.04174175,0.030028146,0.042279907,0.000696869,0.0012388963,-0.02783201,-0.048495434,0.04485023,0.009498387,-0.009533283,0.036473263,0.028421838,0.01844087,0.01952972,-0.021264598,0.08634994,-0.022555202,0.060081147,0.013670229,0.1497612,-0.021247797,-0.008887135,0.0306203,-0.007087516,0.024898361,0.05220465,0.012215928,0.02570937,0.046506412,0.08931996,-0.0010894431]
(1 row)

ID | _metadata
—-+————————————————————————————————————————-
0 | {“id”: “Main Page”, “data”: “Welcome to Wikipedia,nthe free encyclopedia that anyone can edit.n articles in English”}
(1 row)

ID | _metadata | Source | Target
———-+——————————–+——–+——–
__0__179 | {“weight”: 0.7411725521087646} | 0 | 179
(1 row)

As we saw before, text content and vectors are stored in the database. Additionally, we now have graph node and edge data.

Let’s take this up a level.

Vector search with Postgres

Now that the data is persisted in Postgres, can we run vector search without loading the txtai database locally? Yes!

# Query with a search string
query = str(list(embeddings.transform(Roman Empire)))
query = f“””
SELECT id, (embedding <#>
{query}) * -1 AS score, text FROM sections s
JOIN vectors v ON s.indexid = v.indexid
ORDER by score desc LIMIT 5
“””

!PGPASSWORD=pass psql h localhost U postgres c {query}

id | score | text
—————————–+——————–+—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————-
Roman Empire | 0.6798915266990662 | The Roman Empire was the post-Republican state of ancient Rome and is generally understood to mean the period and territory ruled by the Romans following Octavian’s assumption of sole rule under the Principate in 31 BC. It included territory in Europe, North Africa, and Western Asia, and was ruled by emperors. The fall of the Western Roman Empire in 476 conventionally marks the end of classical antiquity and the beginning of the Middle Ages.
History of the Roman Empire | 0.6295346617698669 | The history of the Roman Empire covers the history of ancient Rome from the fall of the Roman Republic in 27 BC until the abdication of Romulus Augustulus in AD 476 in the West, and the Fall of Constantinople in the East in AD 1453. Ancient Rome became a territorial empire while still a republic, but was then ruled by Roman emperors beginning with Augustus, becoming the Roman Empire following the death of the last republican dictator, the first emperor’s adoptive father Julius Caesar.
Roman Republic | 0.6280723810195923 | The Roman Republic was the era of classical Roman civilization beginning with the overthrow of the Roman Kingdom (traditionally dated to 509 BC) and ending in 27 BC with the establishment of the Roman Empire. During this period, Rome’s control expanded from the city’s immediate surroundings to hegemony over the entire Mediterranean world.
Latin Empire | 0.613895058631897 | The Latin Empire, also referred to as the Latin Empire of Constantinople, was a feudal Crusader state founded by the leaders of the Fourth Crusade on lands captured from the Byzantine Empire. The Latin Empire was intended to replace the Byzantine Empire as the Western-recognized Roman Empire in the east, with a Catholic emperor enthroned in place of the Eastern Orthodox Roman emperors. The main objective of the Latin Empire was planned by Venice, which promoted the creation of this state for their self-benefit.
Augustus | 0.6021512150764465 | Gaius Julius Caesar Augustus (born Gaius Octavius; 23 September 63 BC – 19 August AD 14), also known as Octavianus or Octavian, was the founder of the Roman Empire; he reigned as the first Roman emperor from 27 BC until his death in AD 14. The reign of Augustus initiated an imperial cult as well as an era associated with imperial peace, the Pax Romana or Pax Augusta, in which the Roman world was largely free of armed conflict aside from expansionary wars and the Year of the Four Emperors. The Principate system of imperial rule established by Augustus lasted until the Crisis of the Third Century.
(5 rows)

Just like that, vector search without a local txtai instance! The only part needed is a way to vectorize the search query. This can easily be replaced with an API vectorization service.

We can also find the most similar rows for an existing row.

# Find top n results closest to an existing row
query = “””
SELECT id, text FROM sections s

JOIN vectors v ON s.indexid = v.indexid
WHERE v.indexid != 738 ORDER by v.embedding <#> (SELECT embedding FROM vectors WHERE indexid=738) LIMIT 5
“””

!PGPASSWORD=pass psql h localhost U postgres c {query}

id | text
———————————-+——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————-
History of the Roman Empire | The history of the Roman Empire covers the history of ancient Rome from the fall of the Roman Republic in 27 BC until the abdication of Romulus Augustulus in AD 476 in the West, and the Fall of Constantinople in the East in AD 1453. Ancient Rome became a territorial empire while still a republic, but was then ruled by Roman emperors beginning with Augustus, becoming the Roman Empire following the death of the last republican dictator, the first emperor’s adoptive father Julius Caesar.
Roman Republic | The Roman Republic was the era of classical Roman civilization beginning with the overthrow of the Roman Kingdom (traditionally dated to 509 BC) and ending in 27 BC with the establishment of the Roman Empire. During this period, Rome’s control expanded from the city’s immediate surroundings to hegemony over the entire Mediterranean world.
Roman Kingdom | The Roman Kingdom, also referred to as the Roman monarchy or the regal period of ancient Rome, was the earliest period of Roman history when the city and its territory were ruled by kings. According to tradition, the Roman Kingdom began with the city’s founding 753 BC, with settlements around the Palatine Hill along the river Tiber in central Italy, and ended with the overthrow of the kings and the establishment of the Republic 509 BC.
Byzantine Empire | The Byzantine Empire, also referred to as the Eastern Roman Empire, was the continuation of the Roman Empire centered in Constantinople during Late Antiquity and the Middle Ages. The eastern half of the Empire survived the conditions that caused the fall of the West in the 5th century AD, and continued to exist until the fall of Constantinople to the Ottoman Empire in 1453. During most of its existence, the empire remained the most powerful economic, cultural, and military force in the Mediterranean world. The term “Byzantine Empire” was only coined following the empire’s demise: its citizens referred to the polity as the “Roman Empire” and to themselves as “Romans”. Due to the imperial seat’s move from Rome to Byzantium, the adoption of state Christianity, and the predominance of Greek instead of Latin, modern historians continue to make a distinction between the earlier “Roman Empire” and the later “Byzantine Empire”.
Fall of the Western Roman Empire | The fall of the Western Roman Empire, also called the fall of the Roman Empire or the fall of Rome, was the loss of central political control in the Western Roman Empire, a process in which the Empire failed to enforce its rule, and its vast territory was divided into several successor polities. The Roman Empire lost the strengths that had allowed it to exercise effective control over its Western provinces; modern historians posit factors including the effectiveness and numbers of the army, the health and numbers of the Roman population, the strength of the economy, the competence of the emperors, the internal struggles for power, the religious changes of the period, and the efficiency of the civil administration. Increasing pressure from invading barbarians outside Roman culture also contributed greatly to the collapse. Climatic changes and both endemic and epidemic disease drove many of these immediate factors. The reasons for the collapse are major subjects of the historiography of the ancient world and they inform much modern discourse on state failure.
(5 rows)

Wrapping up

From prototyping to production, txtai is ready for all that can be thrown it’s way. As always, this functionality is just the beginning and will continue to improve over time. But this is a big deal and has impacts for future services such as txtai.cloud ☁️

Stay tuned!

Leave a Reply

Your email address will not be published. Required fields are marked *