Long-term memory for AI agents
Real memory.
Recall with reasons.
Ahok Memory is a self-hosted memory engine for AI agents. Store once, then retrieve by similarity, recency, and importance — with a trace that shows why every memory surfaced.
- Runs
- Self-hosted
- Storage
- SQLite or Postgres
- Reach
- Python, Node, MCP
Query
“What did we decide about the pricing page?”
Pricing v2 approved after the usage-based test.
0.91Episodicrecency84importance62Brand voice: plain verbs, sentence case.
0.78Semanticrecency41importance88Standup notes, 3 Nov — pricing copy review.
0.55Episodicrecency95importance30
How a memory comes back
Three steps, in order. The last one is the difference between a memory engine and a vector table.
- 1
Store
An agent writes a memory with a user id and optional tags. Memories stay partitioned by user, so one person's context never leaks into another's.
- 2
Consolidate
Episodes become semantic facts. Temporal edges record what happened before what, and reinforcement raises the memories that keep proving useful.
- 3
Recall
A query is scored by similarity, recency, and importance. The result comes back with the reasons it surfaced, not just a list of nearest vectors.
Install
Use the SDK when you want embedded memory. Run the server when several agents, people, or services need to share it.
- Local SQLite by default; Postgres for production.
- Same memory across OpenAI, Anthropic, or a local model.
- MCP server included for Claude, Cursor, and other clients.
Or run the HTTP server: npx openmemory-js serve
Python
pip install openmemory-pyNode.js
npm install openmemory-jsThen follow the quick start. It takes one file.
Built for inspection
Memory is only useful if you can check it. The data model is visible in the API and in the dashboard.
- Sectors
- Episodic, semantic, and procedural memories are stored separately, so an event and a learned fact do not compete for the same slot.
- Edges
- Temporal and semantic links connect memories. Multi-hop questions can follow a chain instead of guessing from a flat index.
- Traces
- Every recall exposes its score and the factors behind it. When a memory looks wrong, you can see why it was chosen.
Start with one memory. Add the second when you need it.