v1.0 — Local-firstISSN 0001 / Vol. I

Cognitive
Memory
At Light
Speed.

AlekhDB is a local-first GraphRAG database and MCP server engineered for autonomous AI agents — with Ebbinghaus decay, Doyle-style truth maintenance, and sub-millisecond retrieval.

Stippled ink illustration of a neural brain — AlekhDB cognitive memory
Visual_Asset_01Fig. 01 — Neural Map
<0.5ms
GraphRAG Latency
A
6 Tiers
Memory Taxonomy
B
0 Deps
Zero Compile
C
Local-first persistenceGraphRAG optimizedZero compile coreEbbinghaus decay engineDoyle truth maintenanceSub-ms retrievalNative MCP serverPOSIX mountableLocal-first persistenceGraphRAG optimizedZero compile coreEbbinghaus decay engineDoyle truth maintenanceSub-ms retrievalNative MCP serverPOSIX mountable
01§ Capabilities

What the engine does.

Six core behaviors borrowed from cognitive science and engineered for autonomous agents.

01

Ebbinghaus Decay

Biological forgetting curve thins low-salience nodes automatically — memory that ages, not bloats.

02

Doyle TMS

Justification-based truth maintenance keeps the knowledge graph internally consistent under contradiction.

03

Spaced Repetition

High-value memories are surfaced and reinforced on access; stale ones decay below the recall threshold.

04

AST Code Memory

First-class storage for parsed code — agents reason about structure, not just tokens.

05

POSIX Mount

The whole memory store mounts as a real filesystem. Read, diff, version with the tools you already use.

06

MCP Native

Model Context Protocol is the first-class interface — Claude, Cursor, and any MCP client plug in directly.

02§ Benchmarks

Measured, not promised.

All numbers from the open benchmark suite in the repository. Reproduce them with one command.

#
Metric
Value
Notes
01
10K Collision Probe
6.14ms
100% hit rate
02
Graph Seeding
0.54ms
Cold start
03
GraphRAG Query (p50)
0.42ms
1M-node graph
04
GraphRAG Query (p99)
1.18ms
Worst-case path
05
Ingest Throughput
82Kdoc/s
Single thread
06
Decay Sweep
11.3ms
Per 100K nodes
03§ Taxonomy

Six tiers of memory.

Inspired by cognitive psychology. Each tier has its own decay curve, retrieval cost, and access pattern.

I
Sensory
TTL · ≈ 200ms
Raw input buffer — tokens, file events, tool returns.
II
Working
TTL · Session
Active context window. Pinned facts for the current task.
III
Episodic
TTL · Days
Time-stamped event log of interactions and decisions.
IV
Semantic
TTL · Months
Distilled concepts, relations, and learned patterns.
V
Procedural
TTL · Months
Skills and workflows — how-to memory for reused chains.
VI
Archival
TTL · Indefinite
Cold storage with on-demand rehydration.
04§ Protocol

Plug into any MCP client.

One JSON-RPC contract. Drop the snippet into your client config and the agent inherits a memory.

~/.config/mcp/clients.json
01{
02 "mcpServers": {
03 "alekhdb": {
04 "command": "alekhdb",
05 "args": ["serve", "--store", "~/.alekh"],
06 "env": { "ALEKH_PROFILE": "agent" }
07 }
08 }
09}
Tested clients
  • Claude DesktopOK
  • CursorOK
  • ClineOK
  • Continue.devOK
  • Any MCP CLIOK
  • Custom AgentsOK
Read the spec
05§ Quickstart

From zero to recall in 5 seconds.

01
Clone

Zero dependencies. No compile step. Runs from source on any POSIX shell.

$git clone https://github.com/MAHADEV369/AlekhDB && cd AlekhDB
02
Seed

Bootstrap the six memory tiers and the decay schedule for an agent profile.

$./alekh seed --profile agent ~/.alekh
03
Ingest & Query

Push documents into the graph and ask in natural language. Sub-millisecond round-trip.

$./alekh ingest ./docs && ./alekh query "who broke the build last week?"
§ Colophon

Give your agent
a memory that
outlives the session.

Star on Github Read the README
MIT licensed · No telemetry · Single binary