Preview of version 0.1 · not announced yet
Open source · Rust · Apache-2.0

A graph database where every customer gets their own graph.

awanadb stores each tenant as its own graph, with its own schema and indexes. An idle tenant uses no memory. Vector search, text search and PageRank retrieval run inside the engine, so a GraphRAG lookup is one call.

# source release coming soon · the server is a single 1.5 MB binary cargo install --git https://github.com/intiamaru/awanadb awana-server awana serve --data ./data
tenant: acmetenant: globextenant: initech
1.5 MBserver binary. Idles at under 3 MB of memory.
3 µspoint lookup by key, in process. 0.06 ms over HTTP.
5 msmulti-hop GraphRAG retrieval over 144,000 nodes, one call.
0 MBmemory used by a tenant nobody is querying.

Three things other graph databases make expensive

awanadb is built for products where each customer, user or agent has its own knowledge graph.

A graph per customer

A tenant is a directory: one segment file, one log. Its data, schema and indexes are physically separate. Deleting a customer is deleting a directory.

Elsewhere: one shared graph with a tenant_id on every node, or one in-memory graph per customer.

Tenants that sit idle

The server opens a tenant when a request arrives and closes the least recently used ones. A closed tenant costs disk only. A thousand customers who log in once a week cost almost nothing.

Elsewhere: memory is provisioned for every graph, used or not.

Retrieval for GraphRAG

HNSW vectors, BM25 text and personalized PageRank are procedures inside the engine. graph.retrieve chains them in one call over one snapshot.

Elsewhere: a graph database, a vector database and a keyword index, kept in sync and queried in turns.

A tenant is a directory

Every design decision follows from that one.

  • Immutable segment, memory-mapped. Typed columns per label and sorted adjacency lists. Reads touch memory in order, with no decoding and no locks.
  • Node id = label + row. Reading a property is an array access. Following an edge is reading a slice. No index lookup per hop.
  • Write-ahead log + delta. A transaction is durable when its checksummed record is written. A checkpoint folds the delta into a new segment with an atomic rename.
  • Schema per tenant. Open by default; declare types, required properties and allowed endpoints to make it strict.
data/tenants/ ├── acme/ │ ├── graph.seg # columns, adjacency, indexes │ ├── graph.wal # writes since last checkpoint │ └── tenant.json # key hash, quotas ├── globex/ │ ├── graph.seg │ └── ... └── initech/ # idle: closed, 0 MB of memory └── ...

Measured, with the conditions stated

A social graph of 100,000 people and 2.3 million edges on one laptop. Median milliseconds, lower is better. Every engine returned the same answers.

Queryawanadb
in process
awanadb
HTTP
Kuzu
in process
Neo4j
Bolt
FalkorDB
Point lookup by key0.0030.0611.560.910.34
Who a person follows0.0050.0650.931.410.38
Distinct friends of friends0.0290.0922.230.980.36
Count 3-hop paths from a person0.0450.117.176.700.69
Shortest path between two people0.280.352.691.470.43
Count every 2-hop path (55.9 million)2.972.355.6069961434
Top 3 most followed (2.3M edges)45.342.7110646553
People aged 30–40 by country4.644.512.9536.28.18

awanadb is fastest on 13 of the 14 queries; Kuzu wins one aggregation (last row). “In process” is the engine as a library, with no socket; Kuzu is measured the same way. Neo4j and FalkorDB run in Docker with default settings. All 14 queries, the scripts and the caveats are in bench/RESULTS.md. These are small graphs; nothing here says how any engine behaves at a billion edges.

Multi-hop retrieval in one call

The HippoRAG 2 pipeline (facts link the question to entities, PageRank ranks the passages) as a single procedure. Benchmark: 2WikiMultihopQA, the paper's 1,000 questions, recall@5.

CALL graph.retrieve({
  label: 'Passage', limit: 5,
  link:   {label: 'Fact', property: 'emb', k: 5,
           via: 'ABOUT', keep: 5, rarity: 'MENTIONS'},
  vector: {property: 'emb', value: $question,
           k: 200, weight: 0.05, scores: true},
  types:  ['MENTIONS', 'REL', 'SAME_AS'],
  weight: 'w'
}) YIELD node, score
RETURN node.text, score
Same data, same vectorsrecall@5p50
Text search (BM25)66.10.29 ms
Vector search71.00.49 ms
awanadb, one graph.retrieve call83.35.4 ms
The same pipeline in Postgres (pgvector + SQL)77.21,354 ms

1,000 questions, bge-base embeddings (110 M parameters), no LLM at question time. Same call on HotpotQA: 90.7 at 6.0 ms; MuSiQue: 60.5 at 6.2 ms. The HippoRAG 2 paper reports 90.4 on this dataset with a 7 B-parameter embedder and an LLM filtering the facts; this table is about what the engine adds, with the model held fixed.

Quickstart

Start the server, create a tenant, write and read. Any HTTP client is a driver.

export AWANA_ADMIN_KEY=change-me
awana serve --data ./data &

# a tenant, with its own key
KEY=$(curl -s localhost:7474/v1/tenants -H "Authorization: Bearer $AWANA_ADMIN_KEY" \
        -d '{"name": "acme"}' | jq -r .key)

curl -s localhost:7474/v1/t/acme/query -H "Authorization: Bearer $KEY" -d '{
  "query": "CREATE (a:Person {name: $n})-[:KNOWS]->(:Person {name: \"Bea\"})",
  "params": {"n": "Ana"}}'

curl -s localhost:7474/v1/t/acme/query -H "Authorization: Bearer $KEY" \
  -d '{"query": "MATCH (a:Person)-[:KNOWS]->(b) RETURN a.name, b.name"}'
from awanadb import Admin

admin = Admin("http://localhost:7474", key="change-me")
admin.create_tenant("acme")
db = admin.connect("acme")

db.query("CREATE VECTOR INDEX ON :Chunk(emb)")
db.query("UNWIND $rows AS r CREATE (c:Chunk) SET c = r", rows=[
    {"id": 1, "text": "Cusco was the Inca capital", "emb": [1, 0, 0]},
    {"id": 2, "text": "Lima is on the coast", "emb": [0, 1, 0]},
])

for row in db.vector_search("Chunk", "emb", [0.9, 0.1, 0], k=1, returning="node.text"):
    print(row)
import { Admin } from "awanadb";

const admin = new Admin({ url: "http://localhost:7474", key: "change-me" });
await admin.createTenant("acme");
const db = admin.connect("acme");

await db.query("CREATE (:Person {name: $name})", { name: "Ana" });
const people = await db.query("MATCH (p:Person) RETURN p.name AS name");
console.log(people.records());  // [{ name: "Ana" }]
use awanadb::{Graph, Options, Params};

let mut g = Graph::open("./acme", Options::default())?;
g.query("CREATE (:Person {name: 'Ana'})-[:KNOWS]->(:Person {name: 'Bea'})", &Params::default())?;
let r = g.query("MATCH (a)-[:KNOWS]->(b) RETURN a.name, b.name", &Params::default())?;
println!("{:?}", r.rows);

What 0.1 does not do

Stated here so nobody finds it in production. The full list is in docs/limits.md.

  • No replication yet. A tenant is a directory; copy it after a checkpoint.
  • A subset of Cypher. No list comprehensions, subqueries or UNION. Unsupported syntax fails; it never runs with another meaning.
  • One label per node.
  • A checkpoint rewrites the tenant's segment. Sized for tenants up to a few gigabytes.
  • Measured on small graphs. Up to 13.7 million edges per tenant, on one laptop. Larger is untested.
  • Whole-graph analytics are not the goal. A vectorized engine can be faster on queries that scan everything.
  • No TLS in the server. Put a reverse proxy in front.
  • New. The storage format may change before 1.0.

The name

Awana is Quechua for loom, and for the act of weaving. Each weaver works their own cloth with their own pattern on the same kind of frame. That is the data model: one engine, a separate graph per tenant.

Its sibling

If you already run Postgres and want no new system, quipu gives you GraphRAG as a Postgres schema. awanadb is for when retrieval latency or the cost per tenant matters more than having one database.