CongraphDB Documentation¶
"SQLite for Graphs & Vectors" — A high-performance, embedded hybrid graph-vector database for Node.js built with Rust
CongraphDB is an embedded, serverless hybrid graph-vector database designed for local-first AI applications. Built with Rust for memory safety and extreme performance, it combines the power of native graph traversals with high-performance vector similarity search.
What's New in v0.2.1¶
- Hybrid Graph-Vector Engine — Unified storage for both property graph data and high-dimensional vector embeddings.
- High-Performance HNSW — Native parallelization for batch ingestion and metric-aware scoring (Cosine, L2, IP).
- Graph RAG Algorithms — Specialized algorithms and optimized retrieval APIs for AI/LLM workflows.
- Chained Page Storage — Architectural support for large data payloads exceeding single-page limits.
- Query Engine Upgrades — Support for
UNWINDclause, parameterized queries ($placeholder), and explicit connection closing.
See the Changelog for full release notes.
Quick Start¶
const { Database } = require('congraphdb');
// Create or open a database
const db = new Database('./my-graph.cgraph');
db.init();
// Create a connection
const conn = db.createConnection();
// Define schema
await conn.query(`
CREATE NODE TABLE User(name STRING, age INT64, PRIMARY KEY (name))
`);
await conn.query(`
CREATE REL TABLE Knows(FROM User TO User, since INT64)
`);
// Insert data
await conn.query(`
CREATE (alice:User {name: 'Alice', age: 30})
-[:Knows {since: 2020}]->
(bob:User {name: 'Bob', age: 25})
`);
// Query
const result = await conn.query(`
MATCH (u:User)-[k:Knows]->(f:User)
WHERE u.name = 'Alice'
RETURN u.name, k.since, f.name
`);
// Get all results
const rows = result.getAll();
for (const row of rows) {
console.log(row);
}
db.close();
Features¶
- :rocket: Hybrid Graph-Vector Engine — A unified storage engine for both property graph data and high-dimensional vector embeddings.
- :zap: High Performance — Rust-powered with memory-mapped I/O, columnar storage, and vectorized execution.
- :robot: Native Vector Search — Built-in HNSW index with parallel ingestion and metric-aware scoring (Cosine, L2, IP).
- :brain: Graph RAG Ready — Specialized algorithms and optimized retrieval APIs designed for AI/LLM workflows.
- :mag: Dual Query Interface — Cypher graph query language OR JavaScript-native API for flexible development.
- :package: Embedded & Serverless — No separate database process. Store data locally in a single
.cgraphfile. - :moneybag: ACID Transactions — Serializable transactions with write-ahead logging (WAL) and crash recovery.
- :lock: Memory Safe — Built with Rust — no segfaults, no memory leaks.
Resources¶
- Installation Guide — Get started with CongraphDB
- Quick Start — Learn the basics
- SDK Project — Working examples and code samples
- API Reference — Complete API documentation
- GitHub Repository — Source code
Status¶
CongraphDB is currently in alpha development (v0.2.1). The core storage engine and transaction system are hardened with chained page support and WAL recovery. It features comprehensive Cypher query support, a high-performance HNSW Vector Index, specialized Graph RAG algorithms, and a JavaScript-native API.
License¶
MIT License — see LICENSE file for details.