Tomo¶
One PostgreSQL instance replaces your graph database, your vector database, and your ETL pipeline.
Python SDK for Apache AGE + pgvector on PostgreSQL. Cypher graph queries, vector similarity search, and hybrid graph+vector operations — all through a single connection string.
Get Started¶
git clone https://github.com/gregfelice/tomo.git && cd tomo
docker compose up -d
pip install tomo-sdk
import tomo
db = tomo.connect("postgresql://tomo:tomo@localhost:5488/tomo", graph="my_graph")
db.cypher("CREATE (:Person {name: '''Alice''', age: 30})")
db.commit()
df = db.cypher("MATCH (n:Person) RETURN n.name, n.age").to_df()
The Docker image is multi-arch (ARM + x86) — runs natively on Apple M-series, AWS Graviton, and Intel/AMD.
Detects your platform, checks Docker, pulls the image, starts the stack, and runs a smoke test.
cd terraform/aws # or gcp, azure, digitalocean, hetzner
terraform init
terraform apply -var="pg_password=strong-random-pw" -var="ssh_public_key=$(cat ~/.ssh/id_ed25519.pub)"
One command to get a tomo stack running on any major cloud. See the Cloud Deployment Guide.
What Tomo Does¶
import tomo
db = tomo.connect("postgresql://tomo:tomo@localhost:5488/tomo", graph="g")
# Cypher queries → DataFrames
df = db.cypher("MATCH (n:Person)-[:KNOWS]->(m) RETURN n.name, m.name").to_df()
# Vector search (pgvector)
results = db.vector_search("documents", "embedding", query_vec, k=10).to_df()
# Hybrid: graph traversal + vector similarity
results = db.hybrid_search(
cypher="MATCH (p:Paper)-[:CITES]->(cited) RETURN cited",
vector_table="papers",
vector_column="abstract_embedding",
query_vector=query_vec,
k=10,
).to_df()
# 19 graph algorithms with C/C++ backends
df = db.centrality(measure="betweenness")
df = db.communities(method="louvain")
df = db.pagerank()
Why Tomo¶
| Neo4j + Pinecone | Tomo | |
|---|---|---|
| Databases to manage | 2+ (graph + vector + relational) | 1 (PostgreSQL) |
| Connection strings | Multiple | One |
| Backup strategy | Per-database | pg_dump / pgBackRest |
| Transaction boundary | Distributed | Single ACID transaction |
| Vendor lock-in | Proprietary query engines | Standard PostgreSQL, Apache 2.0 |
| Performance | Baseline | Faster on all 12 benchmarks |
Benchmarks: AGE beat Neo4j, Kuzu, and NebulaGraph on all 12 workloads at every scale tested (10K, 100K, 1M). The SDK won 14/16 algorithm benchmarks against Neo4j GDS using igraph (C) and networkit (C++) backends.