Typed graph storage
Columnar node groups and CSR relationship tables for cache-friendly traversal.
Embedded storage for agent memory
ffs is a Rust storage engine for AI systems that need semantic recall, relationship traversal, typed facts, and lineage to commit together.
Most AI apps split memory across a graph database, a vector database, and a relational store. The glue is where IDs drift, writes stop being atomic, and latency budgets get spent on translation.
ffs collapses those shapes into one embedded engine. The app opens a file. Graph edges, vectors, typed properties, and provenance records share the same buffer pool, WAL, and commit.
ffs favors the hot paths agents hit constantly: neighborhood reads, vector recall, schema-checked writes, and recovery after a crash.
Columnar node groups and CSR relationship tables for cache-friendly traversal.
HNSW search in tree today, with persistence moving into the storage substrate.
Types are checked before bad data reaches disk, not cleaned up in app code.
Snapshot isolation and crash recovery across graph, vector, and facts.
Graph-native pattern matching, with read and mutation paths in tree.
Derived nodes can carry source links and confidence as first-class data.
The eval harness compares in-process reads, vector search, graph traversal, and server-stack overhead. The point is architectural: fewer systems means less coordination tax.
| Comparator | Path | Result |
|---|---|---|
| sled | KV lookup | 1.8x |
| instant-distance | HNSW query | 2.6x |
| petgraph | 1-hop traversal | 9x |
| pgvector | HNSW query | 3.01x |
use ffs::cypher::{compile_query, parse};
use ffs::exec::collect_column;
use ffs::planner::{compile, CompileCtx};
use ffs::storage::RelTable;
let mut knows = RelTable::new(0, "KNOWS", 4, 4);
knows.add_edge(0, 0, 1, 1);
knows.add_edge(0, 0, 2, 2);
let q = parse("MATCH (a:Person)-[:KNOWS]->(b:Person) RETURN b")?;
let plan = compile_query(&q, |_| vec![0, 1, 2, 3]);
let ctx = CompileCtx::empty().with_rel_table("KNOWS", &knows);
let mut op = compile(plan, &ctx)?;
let neighbours = collect_column(&mut *op, 0);
ffs is early. The storage spine, transactions, schema and type system, B+-tree indexes, in-memory HNSW, Cypher parser/planner, executor, and Python binding work are underway in the repo.