← all repositories
liliang-cn/cortexdb

An agent brain that fits in one SQLite file — and can explain itself

CortexDB gives Claude Code, Codex and friends a shared, local-first memory backed by a real RDF knowledge graph, no embedding service required.

cortexdb
Velocity · 7d
+2.9
★ / day
star history

What it does It’s a Go library and MCP plugin that stores AI agent memory — facts, RAG knowledge, media — in a single SQLite file. Agents get /remember and /recall, an auto-recall hook that tells them what happened to a file before they open it, and a capture pass that distils idle sessions into durable memories. Point several agents or machines at one cortexdb-grpc server and they share the same brain.

The interesting bit It works without an embedding model: lexical mode is a first-class citizen, not a fallback apology. And recall is traceable — every query has a plan, ranked hits, and a note when it was degraded. Memories are also marked verified vs. guess, and recall keeps the two apart, which is a rare bit of epistemic hygiene.

Key highlights

  • RDF 1.2 graph with SPARQL 1.1/1.2, RDFS + OWL 2 RL inference, and SHACL validation — passing the W3C test suites; read-only Cypher too
  • Hybrid retrieval: HNSW/IVF/binary vector indexes plus FTS5 full-text search
  • Full history: every version of an entity, triple or schema, with as_of queries and an entity timeline
  • A 3D live-view web UI where recalls light up the graph in real time, on desktop or phone
  • import_agent_memory pulls in what Claude Code, Codex and DeepSeek Harness already remember
  • Embedded mode claims 100k 768-d vectors opening in 0.28 s with a 193 MB heap, with power-cut-safe snapshots

Caveats

  • The Claude Code mod leans on haiku for planned recall and capture, and mods are an early-access feature
  • The env-var surface is enormous — media transcription, CLIP embeddings, trace rotation — so expect a long configuration read
  • CORTEXDB_REVIEW_GATE is explicitly a curation filter, not access control

Verdict If you want your coding agents to remember things across sessions — and to see why they remembered them — this is one of the more serious takes on agent memory. If you just wanted a vector store, it’s a lot of ontology for that."

Frequently asked

What is liliang-cn/cortexdb?
CortexDB gives Claude Code, Codex and friends a shared, local-first memory backed by a real RDF knowledge graph, no embedding service required.
Is cortexdb open source?
Yes — liliang-cn/cortexdb is open source, released under the MIT license.
What language is cortexdb written in?
liliang-cn/cortexdb is primarily written in Go.
How popular is cortexdb?
liliang-cn/cortexdb has 529 stars on GitHub.
Where can I find cortexdb?
liliang-cn/cortexdb is on GitHub at https://github.com/liliang-cn/cortexdb.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.