LatticeDB
Embedded property-graph database with native vector and full-text indexing.
LatticeDB is a single-file local database for connected, semantic, and textual data. It lets you traverse relationships, run vector similarity search, and do BM25 full-text search over the same dataset in one engine and one query layer. It is designed for relationship-heavy workloads on a single machine, with zero-config operation and an embedded single-writer model.
LatticeDB is an embedded, single-file graph database that lets local applications query the same data by relationship, semantics, and text, then consume durable graph and application events from the same file. Workloads like Graph RAG, agent memory, and local knowledge tools are examples built on those primitives, not the definition of the engine.
- One file. Your entire database is a single portable file. No server, no configuration.
- One query layer. Graph traversal, HNSW vector similarity, and BM25 full-text — in the same query language.
- One event log. Durable named streams and a built-in graph changefeed share the same transaction/WAL path as graph writes.
- Local-first. Designed for one owning process on one machine, with WAL-backed durability.
- Fast. 0.13 μs node lookups. 0.83 ms vector search at 1M vectors with 100% recall.
// Find chunks similar to a query, traverse to their document, then to the author
MATCH (chunk:Chunk)-[:PART_OF]->(doc:Document)-[:AUTHORED_BY]->(author:Person)
WHERE chunk.embedding <=> $query_vector < 0.3
AND doc.content @@ "neural networks"
RETURN doc.title, chunk.text, author.name
ORDER BY chunk.embedding <=> $query_vector
LIMIT 10
Install
CLI
curl -fsSL https://raw.githubusercontent.com/jeffhajewski/latticedb/main/dist/install.sh | bash
Python
pip install latticedb
Published wheels are expected to bundle liblattice on supported platforms. Source installs can also bundle a staged native library during wheel builds with LATTICE_BUNDLE_LIB_DIR=/path/to/lib.
TypeScript / Node.js
npm install @hajewski/latticedb
Published package tarballs are expected to bundle liblattice on supported platforms. Source checkouts can stage the native library into the package with LATTICE_BUNDLE_LIB_DIR=/path/to/lib npm run bundle:native.
Java
Requires JDK 21+. See bindings/java/README.md for the Maven build, which compiles the JNI bridge and stages liblattice from zig-out/lib. A runnable knowledge-graph example is in bindings/java/src/main/java/io/latticedb/examples.
Go
See bindings/go/README.md for the current cgo workflow. The default consumer path uses installed pkg-config metadata; in-repo development can use -tags repolocal against zig-out/lib.
There is also a runnable graph/vector/text retrieval example in examples/go.
Recent binding-surface cleanups moved embedding helpers into dedicated modules and subpackages. See docs/client_api_migration.md for the preferred imports and current compatibility aliases.
Start Here
- Getting Started maps the shortest path for CLI, Python, TypeScript, Go, and Java.
- CLI Quickstart is the smallest copy-paste example in the repo.
- Examples Overview covers the larger graph/vector/text retrieval demos.
Example
A complete example: create a small knowledge graph with documents and authors, store embeddings, index text, then query across all three search modes.
The examples use the built-in hash_embed / hashEmbed / HashEmbed helper so they run with no
external service. It is a deterministic placeholder, not a semantic embedding: similar text does not
produce nearby vectors, so a distance threshold is arbitrary and a similarity query may match nothing.
Use a r