Agentic-memory MCP server · v0.3.1

An agent that remembers.

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, a track record of which tools to trust, and file claims and handoffs so a second agent never collides with the first.

$claude mcp add dokoro -- npx -y dokoro
5
Memory layers
3
Storage backends
44
MCP tools
MIT
License

SQLite + LanceDB · built on the MCP TypeScript SDK · Node ≥ 22. Tool count includes the analytics tool and three opt-in bridge tools.

Get started

Install per project.

On npm as dokoro. One command — no clone, no build. Run it from the project directory: each project gets its own isolated memory in ./dokoro (override with DOKORO_PATH), so sessions, entities and tool-trust never leak between repos.

add to a projectshell
1# add dokoro to the current project (Claude Code, or any MCP client)
2claude mcp add dokoro -- npx -y dokoro
3
4# CLI subcommands
5npx dokoro init # scaffold the dokoro workspace
6npx dokoro migrate # run DB migrations
7npx dokoro browse # interactive memory browser (TUI)
8
9# lean install — skip the ~100MB native vector deps (lazy-loaded)
10npm install --omit=optional
npx -y dokoro runs the unified server (all tools). With --omit=optional, LanceDB is lazy-loaded: only vector tools error, and session_recall falls back to substring + recency.
ollama (optional)shell
1# optional — embeddings + deep entity extraction
2ollama pull nomic-embed-text
3ollama pull llama3.2
4ollama serve
Needed only for dokoro_entity_extract_deep and vector indexing — every other tool works without it.
Works with your agent
  • Claude Codeclaude mcp add …
  • Gemini CLIMCP over stdio
  • Cursor · Continue · ClineMCP extension or settings entry
  • Any MCP clientJSON-RPC 2.0 over stdio

Building from source or pinning a local checkout? See the README quick start ↗

The five layers

Memory, separated by function.

Most memory plugins dump everything into one vector store. dokoro follows the CoALA taxonomy used by Letta, Zep and Mem0 — each layer owns a question, a storage home, its own tools, and its own retention span.

Workingwhat am I doing?this task · 22 tools

The scratchpad for the task in hand — plus a file-lock so two agents don't trample each other. Like RAM: fast, current, cleared when the task ends.

claimed: auth-refactor · open Q: needs a regression testlives in · current-workspace.md · lock.json · questions.json
Episodicwhat happened?per session · 3 tools

A dated diary of past sessions, written at session end and auto-compacted as it grows. A fresh session resumes days later instead of re-investigating.

Mon — fixed race in session refresh; partial fix in auth/session.tslives in · sessions · time_entries · conversation_summaries
Semanticseen this before?permanent · 2 tools

The knowledge graph: entities (files, services, decisions), how they relate, plus document vectors. Answers by meaning, not text match — every relation is bi-temporal.

auth/session.ts —uses→ jwt-stateless-tokenslives in · entities · entity_relations · doc_vectors (LanceDB)
Proceduralwhere in the plan?per plan · 6 tools

The plans and checklists the agent is working through, with progress and blockers. “Where am I in the plan” survives the context window.

plan auth-hardening · 3/7 done · task 4 blockedlives in · docs(doc_type='plan') · plans/*.json
Affectivewhich tool to trust?all-time · 3 tools

A per-tool, per-agent track record — success, failure, latency, confidence. Wilson-ranked and recency-decayed into a routing policy.

entity_extract_deep · 88% success · prefer over regexlives in · agent_feedback
The method

The session loop.

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

  1. 01Resumeworkspace_status · session_recallread working + episodic — start informed, not blank
  2. 02Oriententity_graph · plan_statusread semantic + procedural — what's relevant, what's left
  3. 03Actworkspace_claim · session_log · question_addwrite working — claim, log progress, record questions
  4. 04Reflectfeedback_recordwrite affective — capture each tool outcome
  5. 05Routefeedback_routeread affective — bias toward what historically worked
  6. 06Persistworkspace_dumpwrite → episodic — ready for the next recall
In practice

Monday's fix, recalled on Thursday.

Summaries are written at session end with dokoro_session_summary_add. dokoro_session_recall narrows by query and an ISO since, then re-ranks by embedding similarity — falling back to recency offline. Long sessions are auto-compacted into one recallable entry, so nothing drops out of recall.

claude code · two sessions
# Monday
You ▸ The concurrent-login test is flaky. Fix it.
Claude ▸ [calls dokoro_session_log] Logged: root cause = race in session refresh, partial fix in auth/session.ts. Open question: needs a regression test.
# Thursday · fresh session, zero context
You ▸ Pick up the login bug from earlier this week.
Claude ▸ [calls dokoro_session_recall { query: "login", since: "2026-05-12" }] Resuming from Monday's session — writing the regression test now.
The lineage

How agent memory evolved.

From no memory at all, to one similarity bucket, to tiered OS-like memory, to temporal graphs. dokoro sits at the current edge.

Gen 0 · 2022–23
The context window was the memory
Wiped every session. Re-learned the codebase, re-discovered decisions, repeated tools that had already failed.
the bare LLM
Gen 1 · 2023
One vector store, retrieve by similarity
Useful but undifferentiated — a stale plan, a one-off fact and a failed-tool note all compete in one fuzzy ranking.
Mem0, early RAG
Gen 2 · 2023–24
Tiered, OS-like memory
Core + archival store the agent pages in and self-edits. Tiers are about size and recency, not kind.
MemGPT / Letta
Gen 3 · 2024
The temporal knowledge graph
Facts with validity windows — ask what the graph believed at a past moment instead of overwriting history.
Zep / Graphiti
Gen 4 · 2025
Function-separated + affective
Five purpose-built layers, bi-temporal facts, and an affective layer that learns which tools and models to trust.
dokoro
The distinguishing trait

Affective memory — learning what to trust.

Every tool outcome is recorded — outcome and latency automatically for wrapped calls, confidence when provided via dokoro_feedback_record. The agent asks dokoro_feedback_route for a ranked track record and biases itself accordingly. None of Mem0, Letta, Zep, Cognee or LangMem does this natively.

Wilson lower bound
A single lucky success can't outrank a long, proven record. The agent prefers the higher wilson_lower.
Recency decay
Stale failures fade via half_life_days — last quarter counts for less than yesterday.
Confidence gate
confident flips true only past a minimum sample size. Raw aggregates stay in dokoro_feedback_query.
dokoro_feedback_routejson
1{
2 "name": "dokoro_feedback_route",
3 "arguments": {
4 "agent_id": "claude-code",
5 "half_life_days": 14
6 }
7}
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
  decayed_rate=0.864
  wilson_lower=0.8213  confident=true
  1. tool call→
  2. outcomeok · fail · latency→
  3. agent_feedbackSQLite row→
  4. recency decayhalf_life_days→
  5. wilson boundlower-bound rank→
  6. route
Time travel

Bi-temporal facts.

Every entity_relations row carries valid_from / valid_to (Zep / Graphiti-style). Facts are never 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.

auth/session.ts—[uses]→jwt-stateless-tokens
Jan '26MarMayJulnow
as_of 2026-07-07stateful-sessions valid → 2026-05-12 · jwt-stateless-tokens valid 2026-05-12 → now
dokoro_entity_graph · as_ofjson
1{
2 "name": "dokoro_entity_graph",
3 "arguments": {
4 "entityId": 7,
5 "as_of": "2026-04-01T00:00:00Z"
6 }
7}

Pass as_of and traversal returns only relations valid at that moment. A closed fact stops surfacing in the default “now” view — but history is never deleted.

Window-closing on supersession applies to single-valued relations (FUNCTIONAL_RELATION_TYPES, superseded_by by default). Many-valued relations like depends_on or implements accumulate concurrent open facts instead of evicting each other.

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. Ollama is optional — without it, dokoro falls back gracefully.

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
Multi-agent

Claims, handoffs, presence.

Works for one agent today; prevents collisions when you add another. Every timestamp is a server-assigned SQLite unixepoch, so agents on different machines never disagree about expiry.

Advisory file claimsdokoro_file_claim

Per-file leases (default 300s, max 3600s); renew by re-claiming. Claims warn — they never block.

All-or-nothingper-path conflict report

Claiming several paths acquires every one or none; conflicts name the live holder, intent, expiry and presence.

Stale takeover900s presence TTL

An expired claim, or one whose holder's heartbeat is stale, is taken over automatically. force:true is recorded as a forced takeover.

Shared blocks & handoffsblock_* · handoff_*

Editable blocks with optimistic version compare-and-set, and handoffs that exactly one agent can atomically claim.

Housekeeping

Automatic archiving.

  • Validated plans are archived by dokoro_plan_validate — still listed, marked (archived), read-only.
  • Opportunistic sweep on workspace claim: daily files older than 7 days and finished plans older than 30 days move to the archive — never the current week, never a claimed file.
  • On demand with dokoro_archive_sweep — dryRun to preview, status_only for the last run.
dokoro/
├── daily/ # current week + last 7 days ├── archive/daily/2026-W20/ # swept, by ISO week └── .mcp/plans/ ├── my-plan.json # live plans └── archive/2026-06/ # finished, by month
The dashboard

Supervise agents live.

npx dokoro browse is a terminal dashboard over the whole memory folder — ten categories, from the live workspace and plans to file claims, agent presence, open questions and the feedback ledger. File watchers keep lists live; changed lines flash as agents work.

dokoro browse · file claims — live
dokoro › File claims ──────────────────────────────────────── ▸ src/auth/session.ts alice · live · 4m left src/cli/browse-ui.tsx bob · stale · expired ──────────────────────────────────────── ↑/↓ move · enter open · r release · ? help ⚑ holder is live — not releasing
/fuzzy filter (exact substrings rank first)
shybrid FTS5 + LanceDB search (needs Ollama)
?overlay every keybinding
aarchive the selected live plan or daily file
wmove a daily file to its ISO-week archive
rrelease a stale file claim (gated)
padvance a plan one legal step (gated)
escrestore list, clear filter, or go back
Observe-firstcouncil-ruled

Read everywhere, write only where gated. Command palettes, multi-select and inline editing were rejected — a coordination dashboard must never race the agents it watches.

Liveness gater · claims

Releases a stuck claim only when the holder's heartbeat is stale past the 900s TTL or the lease expired. A live holder is refused — the TUI has no force path.

Fresh-read, drift abortp · plans

Advances a plan one legal step (draft → active → completed). The plan is re-read before writing; if its status drifted since you confirmed, the write aborts.

Gated mutationkey → confirm → re-read → gate

Every write is armed by one key, confirmed y/n, re-read, then gated. It either lands race-guarded in SQL or is refused with a toast.

Not a TTY (pipes, CI)? It prints a static category summary instead.

The catalogue

Every tool, by layer.

44 tools, grouped by the memory layer they read or write. Core tools ship on the core server; dokoro_compress_week lives on the analytics server and the bridge tools are opt-in.

Workingworkspace · shared blocks · handoffs · presence · file claims · questions22+
  • dokoro_workspace_status
    Check workspace status and active sessions.
  • dokoro_workspace_claim
    Claim the workspace with a file-based lock so two agents don't collide.
  • dokoro_workspace_dump
    Flush the active workspace into durable storage; registers docs in SQLite.
  • dokoro_session_log
    Log development session entries with tags as work happens.
  • dokoro_regenerate_current
    Auto-generate or refresh current.md from recent activity.
  • dokoro_update_current_section
    Update a specific section of current.md.
  • dokoro_get_current_focus
    Read the current focus and active tasks from current.md.
  • dokoro_block_write
    Create/update a shared editable block; optimistic version compare-and-set.
  • dokoro_block_read
    Read a shared block: content, version, last updater.
  • dokoro_block_list
    List shared blocks with version + updater.
  • dokoro_handoff_write
    Record a cross-session handoff: summary + open items.
  • dokoro_handoff_inbox
    Read open handoffs available to an agent.
  • dokoro_handoff_claim
    Atomically claim a handoff so only one agent takes it.
  • dokoro_presence_ping
    Heartbeat: announce this agent is active (upsert, server clock).
  • dokoro_presence_list
    List agents live within the TTL (read-time liveness, no sweeper).
  • dokoro_file_claim
    Advisory per-file claim with a lease (default 300s) — warns, never blocks.
  • dokoro_file_release
    Release your file claims — specific paths or all. Owner-aware, idempotent.
  • dokoro_claim_list
    List open file claims with holder liveness (live / stale / unknown).
  • dokoro_question_add
    Record an open question during development.
  • dokoro_question_answer
    Answer a previously logged question.
  • dokoro_question_list
    List all tracked questions.
  • dokoro_question_check
    Check the status of open questions.
Episodicsession recall and summaries3+
  • dokoro_session_recall
    Read past session summaries — filter by query, session_id, since; semantically re-ranked.
  • dokoro_session_summary_add
    Write a session-end summary; auto-compacted past the token budget.
  • dokoro_compress_week
    Compressed weekly summary — sessions, tasks, decisions (analytics server).
Semanticentity graph and deep extraction2+
  • dokoro_entity_graph
    Search or traverse the entity graph. Accepts as_of for point-in-time queries.
  • dokoro_entity_extract_deep
    LLM-powered deep extraction on a document via Ollama (llama3.2).
Proceduralplans and checklists6+
  • dokoro_plan_create
    Create a development plan with tasks.
  • dokoro_plan_check
    Check progress on a plan's tasks.
  • dokoro_plan_blocker
    Report a blocker on a plan task.
  • dokoro_plan_validate
    Validate plan completion criteria (auto-archives the plan).
  • dokoro_plan_status
    Get an overall plan status summary.
  • dokoro_plan_list
    List all plans, archived ones included.
Affectivetool-outcome ledger and routing3+
  • dokoro_feedback_record
    Record a tool-call outcome (success / failure / partial / rejected / timeout) with confidence + latency.
  • dokoro_feedback_route
    Ranked track record — Wilson lower bound + recency decay.
  • dokoro_feedback_query
    Raw per-tool success rates, recent failures, agent-specific stats.
Setupinit · archive · assets5+
  • dokoro_init
    Initialize the dokoro workspace and database.
  • dokoro_archive_sweep
    Sweep stale daily files and finished plans into the archive (dryRun, status_only).
  • dokoro_save_image
    Save an image asset (base64 or URL).
  • dokoro_save_file
    Save a file asset.
  • dokoro_list_assets
    List saved assets.
Bridgeopt-in · DOKORO_ENABLE_TACHIBOT_BRIDGE=true3+
  • bridge_index_research
    Index tachibot research output into LanceDB. Deterministic IDs — no duplicates.
  • bridge_import_plan
    Import planner_maker phases into dokoro plans (plan_check / _validate / _status).
  • bridge_get_context
    Pull prior research + plans as a paste-ready context block for the next reasoning call.

Parameters and return shapes: docs/tools.md ↗ · README tool tables ↗

How it compares.

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

ProjectArchitectureNative temporalNative affectiveNative multi-agentConcurrent access
dokoroSQLite + LanceDB + entity graph✓ bi-temporal✓ agent_feedback✓ shared blocks + handoff + file claims✓ 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————
Under the hood

How it holds together.

The agent never holds it all in context — it pulls the slice it needs from the layer that owns it, then writes back what it learned.

i · TaxonomyFunction-separated memoryFive layers along the CoALA taxonomy — the agent retrieves the right kind of memory, not the most similar text.
ii · TemporalNon-destructive factsSupersession closes a fact's valid_to window and opens a new slice. as_of replays the graph at any moment.
iii · AffectiveOutcomes as policyWilson lower bound + recency decay turn per-tool records into a routing signal the agent can trust.
iv · StorageRight tool per jobSQLite for structure, LanceDB for vectors, files for human-readable state — fused by Reciprocal Rank Fusion.
v · DegradeRuns without OllamaNo local LLM? Regex extraction takes over and recall falls back to recency. Nothing hard-fails.
vi · BridgeZero cost when offThree opt-in tools wire TachiBot's multi-model output into memory. Disabled by default.
vii · ClaimsMulti-agent file claimsAdvisory per-file leases so agents sharing a worktree see who is editing what. Conflicts warn — they never block.
viii · Browsedokoro browseA live terminal dashboard over all ten memory categories, with gated actions. Static summary when not a TTY.
ix · ScopeStrictly per-projectOne memory per project, cross-project writes forbidden, no registry, no --all. Memory never leaks between repos.

Full system diagram, data flow and storage notes: docs/architecture.md ↗ · Animated walkthroughs: bypawel.github.io/dokoro ↗

The companion

TachiBot thinks. dokoro remembers.

Multi-model calls are stateless — research and plans evaporate when the turn ends. Three opt-in bridge tools (DOKORO_ENABLE_TACHIBOT_BRIDGE=true) land each model's output in the right layer and feed it back into the next decision.

Bridge toolDirectionWhat it does
bridge_index_researchtachibot → semanticIndexes research output into LanceDB. Re-indexing the same source + query replaces the old entry.
bridge_import_plantachibot → proceduralImports planner_maker phases into dokoro plans, usable by plan_check / _validate / _status.
bridge_get_contextdokoro → tachibotPulls relevant prior research + plans as a paste-ready context block for the next reasoning call.