Agentic-memory MCP server · dokoro

An agent thatremembers.

dokoro is a persistent brain for your LLM agent — five memory layers, each answering a different question, so the agent recalls the right kind of memory instead of the most textually similar one.

Working · episodic · semantic · procedural · affective — with bi-temporal facts and a track record of which tools to trust.

SQLite + LanceDB built on the MCP TypeScript SDK MIT byPawel/dokoro

5
Memory layers
3
Storage backends
40
MCP tools
2
Native edges*
SCROLL
§ 00 — Get started

Install per project

On npm as dokoro. One command — no clone, no build. Each project gets its own isolated memory in ./dokoro, so sessions, entities and tool-trust never leak between repos.

add to a project · run from the project directory
# add dokoro to the current project (Claude Code, or any MCP client)
claude mcp add dokoro -- npx -y dokoro

# CLI subcommands
npx dokoro init        # scaffold the .dokoro workspace
npx dokoro migrate     # run DB migrations

# lean install — skip the ~100MB native vector deps (lazy-loaded)
npm install --omit=optional
§ 01 — The Five Layers

Memory, separated by function

Most memory plugins dump everything into one vector store and retrieve by fuzzy similarity. dokoro follows the CoALA taxonomy used by Letta, Zep and Mem0: each layer owns a different question, a storage home, and its own tools — so the agent fetches the right kind of memory, not the most textually similar one. Each layer is also retained for a different span — from a single task to all-time.

§ 02 — The Lineage

How agent memory evolved

Agent memory has moved through four generations — from no memory at all, to one big similarity bucket, to tiered OS-like memory, to temporal graphs. dokoro sits at the current edge: function-separated layers, bi-temporal facts, and an affective layer that learns which tools to trust.

Gen 0 · 2022–23 — the bare LLM

The context window was the memory

An agent's only memory was its prompt — wiped at the end of every session. It re-learned the codebase, re-discovered decisions, and repeated tools that had already failed. Nothing persisted.

Gen 1 · 2023 — Mem0, early RAG

One vector store, retrieve by similarity

"Memory" became a single embedding index: dump everything in, pull back the most textually similar chunks. Useful, but undifferentiated — a stale plan, a one-off fact and a failed-tool note all compete in the same fuzzy ranking.

Gen 2 · 2023–24 — MemGPT / Letta

Tiered, OS-like memory

Borrowing from virtual memory: a small in-context "core" plus a large archival store the agent pages in and self-edits. Structure arrives — but the tiers are about size and recency, not about what kind of thing is being remembered.

Gen 3 · 2024 — Zep / Graphiti

The temporal knowledge graph

Facts became first-class and time-aware: entities and relations with validity windows, so you can ask what the graph believed at a past moment instead of overwriting history. Memory gains a timeline.

Gen 4 · 2025 — dokoro

Function-separated + affective

dokoro keeps the temporal graph (bi-temporal relations) and adds two moves no popular OSS lib makes together: memory split into five purpose-built layers (CoALA), and an affective layer that records every tool outcome and turns it into a routing policy — so the agent learns which tools and models to trust, not just what it once saw.

§ 03 — The Method

The session loop

The server stores and serves; the agent reads and writes. A Claude Code session forms a loop across the layers — resume informed, act, reflect, and persist what was learned for next time.

CYCLE · resume → orient → act → reflect → route → persist
Press replay to trace a session across the layers
active path working episodic semantic affective
§ 04 — The Distinguishing Trait

Affective memory — learning what to trust

Every tool outcome is recorded; the agent asks dokoro_feedback_route for a ranked track record and biases itself accordingly. No other popular OSS memory library — Mem0, Letta, Zep, Cognee, LangMem — does this natively.

PIPELINE · feedback_record → ranked feedback_route
Outcomes become a routing policy
Outcome & latency recorded per call; confidence when provided
dokoro_feedback_route · ranked scores
# MCP tools/call — ranked routing for this agent
{
  "name": "dokoro_feedback_route",
  "arguments": {
    "agent_id": "claude-code",
    "half_life_days": 14
  }
}

dokoro_session_recall
  n=89  decayed_rate=1.000
  wilson_lower=0.9583  confident=true
dokoro_entity_extract_deep
  n=142 success=125 timeout=15
  wilson_lower=0.8213  confident=true

Wilson lower bound rank

Ranking uses a Wilson lower bound on the success rate — a single lucky success can't outrank a long, proven record. The agent prefers the higher wilson_lower.

Recency decay half-life

Stale failures fade via half_life_days — an outcome from three months ago counts for less than one from yesterday.

Confidence gate sample size

A confident flag flips true only once a tool clears the minimum sample size. Raw aggregates stay in dokoro_feedback_query.

§ 05 — Time Travel

Bi-temporal facts

Every entity_relations row carries valid_from / valid_to (Zep / Graphiti-style). Facts are never destructively overwritten — a superseded fact has its window closed and a new slice opens. Drag as_of to query the graph at any point in time.

ENTITY · auth/session.ts  —[uses]→  ?
uses → stateful-sessions
uses → jwt-stateless-tokens
Jan '26MarAprJunnow
2026-05-12

Window-closing on supersession is active for single-valued relations; genuinely many-valued relations like depends_on accumulate concurrent open facts instead of evicting each other. History is never deleted — it only stops surfacing in the default "now" view.

§ 06 — Persistence

Three backends, each to its strength

Structured data in SQLite, vectors in LanceDB, human-readable state on the filesystem. Hybrid search fuses FTS5 + vectors by Reciprocal Rank Fusion; an optional local LLM (Ollama) adds embeddings and deep extraction — the server runs fine without it.

SQLite · structured

Drizzle ORM
  • docs · entities · entity_relations
  • sessions · time_entries
  • tags · doc_tags · doc_entities
  • conversation_summaries
  • agent_feedback (affective)
  • FTS5 full-text index

LanceDB · vectors

semantic recall
  • doc_vectors + chunks
  • 512-token windows, 128 overlap
  • nomic-embed-text embeddings
  • cosine similarity recall
  • RRF-fused with FTS5

Filesystem · readable

working state
  • current-workspace.md
  • daily/*.md session logs
  • plans/*.json (procedural)
  • questions.json
  • assets/* · lock.json

Ollama · optional

graceful fallback
  • nomic-embed-text → embeddings
  • llama3.2 → deep extraction
  • without it: regex extraction
  • incremental SHA-256 indexing
§ 07 — The Companion

The tachibot bridge

tachibot-mcp does the thinking; dokoro remembers it. Three opt-in bridge tools (DOKORO_ENABLE_TACHIBOT_BRIDGE=true) land each model's stateless output in the right layer — and feed it back into the next decision.

LOOP · tachibot reasons → dokoro remembers → context flows back
Stop re-researching what you already looked up
→ semantic (LanceDB) → procedural (plans) context back to tachibot
§ 08 — The Catalogue

Every tool, by layer

Filter the toolset by the memory layer it reads or writes. Core tools ship on core-server.js; analytics and bridge tools register on their own servers.

Layer
Showing 0 of 40 entries
§ 09 — The Survey

How it compares

Four capabilities set dokoro apart — bi-temporal facts, per-agent affective feedback, workspace lock coordination, and WAL concurrency — all queryable as plain MCP tool calls or visible directly in the SQLite schema.

ProjectArchitectureNative temporalNative affectiveNative multi-agentConcurrent access
dokoroSQLite + LanceDB + entity graph✓ bi-temporal✓ agent_feedback✓ shared editable blocks + handoff✓ WAL + busy_timeout=5000
Mem0Vector + optional graph
Letta (MemGPT)Tiered, OS-like, self-editing◐ via metadata◐ via metadata◐ shared blocks
Zep / GraphitiTemporal knowledge graph✓ bi-temporal
CogneeGraph + vector poly-store◐ partial
LangMemModular over LangGraph
§ 10 — Under the Hood

How it holds together

Layer-driven, gracefully degrading, and built on the MCP TypeScript SDK.

i · TAXONOMY

Function-separated memory

Five layers along the CoALA taxonomy — the agent retrieves the right kind of memory, not the most similar text.

ii · TEMPORAL

Non-destructive facts

Supersession closes a fact's valid_to window and opens a new slice. as_of replays the graph at any moment.

iii · AFFECTIVE

Outcomes as policy

Wilson lower bound + recency decay turn per-tool records into a routing signal the agent can trust.

iv · STORAGE

Right tool per job

SQLite for structure, LanceDB for vectors, files for human-readable state — fused by Reciprocal Rank Fusion.

v · DEGRADE

Runs without Ollama

No local LLM? Regex extraction takes over and recall falls back to recency. Nothing hard-fails.

vi · BRIDGE

Zero cost when off

Three opt-in tools wire tachibot's multi-model output into memory. Disabled by default.