cortexdb
Provides an Obsidian plugin for using CortexDB from an Obsidian vault.
Integrates OpenAI-compatible embeddings endpoints to generate vector embeddings for semantic retrieval, falling back to lexical mode when no endpoint is configured.
Supports PostgreSQL with pgvector as an alternative storage backend via a postgres:// DSN for memory and knowledge graph data.
Stores AI memories and the knowledge graph in a local SQLite database file by default.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
CortexDB
AI memory and a knowledge graph in one SQLite file. Pure Go, no service to run, works without an embedding model.

Install
Go library |
|
Claude Code |
|
Codex |
|
Claude Code mod (optional) |
|
DeepSeek Harness |
|
Obsidian | unzip a release's |
Shared-brain server |
|
Clients |
|
Related MCP server: mcp-local-memory
Use
db, _ := cortexdb.Open(cortexdb.DefaultConfig("brain.db"))
defer db.Close()
brain := db.KnowledgeMemory()
_, _ = brain.Remember(ctx, cortexdb.KnowledgeMemoryRememberRequest{MemoryID: "alice-tabs", UserID: "alice", Scope: "user", Content: "Alice prefers tabs."})
rec, _ := brain.Recall(ctx, cortexdb.KnowledgeMemoryRecallRequest{Query: "what does Alice prefer?", UserID: "alice"})
fmt.Println(rec.ContextPack.Text)The plugin gives Claude Code and Codex one global brain at ~/.cortexdb/cortexdb.db, /remember, /recall and an auto-recall hook. A session starts with an index of what the brain knows about its project, an agent about to open a file is told what happened to it before, and a session's durable facts are captured with <private> text and credentials kept out. Point several agents or machines at one cortexdb-grpc and they share the same memory and graph.
In Codex, review and trust the plugin hooks in /hooks to activate automatic
recall. See the plugin guide for setup and
cortexdb-mcp --doctor --self-test diagnostics (v2.119.0+).
Live view
A web UI over the brain, local or shared: run cortexdb-mcp-stdio --graph-3d, or ask the agent to call serve_graph_3d.
Graph: the knowledge graph in 3D. A recall from any agent or machine lights the records it returned, and the Live feed says who asked what.
Recalls: every recall with its plan, its hits and why each ranked (
CORTEXDB_RECALL_LOG=1).Changes and Activity: every fact added, replaced or retracted, and the tool calls the brain handled.
Ontology: the declared types held against what the records are actually typed as.
Library: the same memories as a reading room, shelved by project.
Read-only, light by default, works on a phone, in English or Chinese (the toggle in the top bar). See the guide.
Claude Code mod
cortexdb-live is an optional mod that runs inside Claude Code on top of the cortexdb plugin. Install it after the plugin:
/plugin install cortexdb-live@cortexdbThe mod calls three of the plugin's tools itself, and a hook gets no permission prompt, so allow them once in ~/.claude/settings.json (not needed in bypass mode):
"permissions": {
"allow": [
"mcp__plugin_cortexdb_cortexdb__knowledge_memory_recall",
"mcp__plugin_cortexdb_cortexdb__graph_statistics",
"mcp__plugin_cortexdb_cortexdb__memory_save"
]
}Without them the status line names the missing rules.
Planned recall. Before the brain is searched, haiku turns each prompt into keywords in Chinese and English, aliases, entity names and a retrieval mode. A bare "ok" or "go ahead" searches nothing. The band above the prompt shows what was recalled; expand it to see the plan and every hit. Hide lasts until the next recall;
/cortexdb-showbrings the hidden one back.Status line. Which brain the session uses, its node count and how long the last recall took, or why the brain can't be reached.
Capture. 90 seconds after a session goes idle, haiku distils the new part of the conversation into durable memories (
auto:<session>:<slug>). Each later pass replaces a memory under the same slug rather than adding a copy. Older memories a new one makes untrue (a host moved, a decision reversed) are marked superseded: kept, but no longer recalled as current. The project's Claude Code file memory (~/.claude/projects/<project>/memory/) is shown to haiku as already recorded, so a capture does not restate a note in other words. A prompt with an image attached is not recalled for.
Haiku runs on Claude Code's own model access, so no API key is needed. Language: /config → cortexdb-live → language (auto, zh, en). The mod honours the plugin's own switches: cortexdb-recall --disable and cortexdb-session-end --disable turn recall and capture off for both. While the mod runs, the plugin's shell recall and capture hooks stand down, so nothing is done twice. Codex keeps those hooks. Mods are an early-access Claude Code feature.
What's inside
Vectors (HNSW, IVF, flat, binary codes), FTS5 full-text search, hybrid and graph retrieval
EmbeddedConfigfor small devices: an SQ8 index, bounded SQLite caches, snapshots that survive a power cut — 100k 768-d vectors open in 0.28 s with a 193 MB heapRAG knowledge, scoped agent memory, context packs with sources — memories say whether they were verified or are a guess, and recall keeps the two apart
RDF 1.2 knowledge graph: SPARQL 1.1/1.2, RDFS + OWL 2 RL inference, SHACL Core + SHACL-SPARQL, RDF/XML import — passing the W3C SPARQL 1.1/1.2, RDF 1.2 (Turtle, TriG, N-Triples, N-Quads, RDF/XML) and SHACL test suites; RDFS and OWL 2 RL are covered by the repo's own tests — and read-only Cypher
Palantir-style ontology with governed actions
100+ tools, in-process or over MCP
serve_graph_3d: a live 3D view to find, ask, query and expand, on desktop or phone, with a Changes page that says in words what was added, replaced or retracted as it happens, and an Entity page with each relation, why its value is in effect and what it replaced; or the same brain as a library, each memory a book on its project's shelfimport_agent_memory: bring in what Claude Code, Codex and DeepSeek Harness already remember — memory notes,CLAUDE.md/AGENTS.md, Codex's memories, and optionally past sessions distilled into memories — into a local or shared brainChange feed: every committed write, in order, exactly once
Observability: a request id and a W3C trace (
traceparent) from MCP through gRPC to the trace and the recall log, recalls that explain themselves and say when they were degraded, embedder health in/metricsand/healthz, and an opt-in recall log with a/recallspageImages, recordings and videos (
ingest_media): found by a text question through their caption, visible text and transcript, a hit saying where in the file — with or without an embedder; with a CLIP-style media embedder also by what they show, and by an image (search_media)History of the graph and the ontology: for an entity, relation, triple or schema, every version, when and why it changed, and which one is in effect and why (
graph_history,knowledge_graph_history,ontology_history);as_ofon SPARQL, find, expand and Cypher; an entity timeline, an As of pin and an ontology version list in the live viewSQLite by default, PostgreSQL + pgvector with a
postgres://DSN
Environment
Variable | Meaning |
| Database file (default |
| Use a shared |
| Bearer token for that server |
| Server listen address (default |
|
|
| Server: the embeddings endpoint and key ( |
| Embedding model and dimension, for both (default |
| Server: |
| Server and |
| Server: log calls slower than this, with the time each stage took (default |
| Server: log every call; also append the records to a JSON-lines file |
| Server: |
| Server: rotate the trace file at this size ( |
| Server: probe the embedder this often, for |
| Server and |
| How long ( |
| Server and |
| An OpenAI-compatible |
| A CLIP-style embedding endpoint (infinity's |
|
|
| Seconds between the video frames captioned ( |
Docs
Website · Guide (full feature reference) · Examples · Changelog · 中文
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Shared long-term memory for AI agents: save and recall context as a searchable knowledge graph.
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Persistent memory and knowledge graph for AI assistants — keyword + vector + graph search.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceSemantic memory for AI agents — local-first MCP server with hybrid search, knowledge graph, contradiction detection, and plan-then-commit consolidation.227 npm4AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceA lightweight, powerful local memory server for AI agents supporting text, entities, and relations. Enables persistent codebase understanding and user preference management.26 npm62MIT

Loreofficial
AlicenseBqualityCmaintenanceCross-agent memory server: hybrid (vector + full-text + knowledge-graph) recall, per-user private/shared visibility, write-side secret/PII redaction, and as-of-date bi-temporal fact queries. Auto-injection hooks for Claude Code / Cursor / Codex; self-hostable on PostgreSQL or SQLite.4660 PyPI10MIT- AlicenseNot gradedqualityDmaintenanceSelf-hosted, governed long-term memory and knowledge-graph server for AI agents with access control, hybrid retrieval, and typed graph linking.AGPL 3.0