Docs · Agent memory

Inmem

Incord Memory

Inmem is the memory engine under Watchman. Hooks in your agents save every turn and every code edit as it happens, file it to the right project, and hand the right part back on the next call: your rules, the lessons from earlier sessions, and the code the task is about, in one call.

Shipped. Ships inside Watchman, which installs and starts it for you.

What it is

Inmem is one program, inmem, that runs on your machine. Watchman starts it as a background service: a scheduled task on Windows, a LaunchAgent on macOS, a systemd unit on Linux. Everything it keeps is stored per project under ~/.incord.

Nothing is written by hand. Hooks in each agent capture every turn and every code edit. When a session starts, the same hooks give the agent your rules, the newest session record and the code the task touches, so a new window picks up where the last one stopped.

Capture

Hooks save each turn and code edit as it happens, filed by the folder it came from.

Recall

One context call packs lessons, rules and code into a token budget, newest facts first.

Guards

Rules run in code before each tool call and can block it, not as text an agent may skip.

What it keeps

  • TURNS: every chat turn from every agent, searchable by meaning and by keyword.
  • LESSONS: one typed item each, an issue, finding, decision, convention, fact, preference or to-do, pointing at code by file and symbol instead of pasting it.
  • SESSION RECORD AND HANDOFF: what the last session left open, found true or decided, read back into the next one after a clear or a compaction.
  • TOPICS: each piece of work gets its own topic as it happens, so related turns, code and records stay together.
  • A KNOWLEDGE GRAPH per project, linking conversations, messages and topics.
  • A CODE INDEX of your projects, so an agent can read one symbol instead of a whole file.
  • THE RECORDER: how each step was done (model, tools, order), so a step seen to give the same answer can be served instead of run again.

Install and run

With Watchman you install nothing: the app downloads the engine and its local models, starts it, and wires your agents. The engine listens on 127.0.0.1:9180 by default.

CommandWhat it does
inmem serveRun the engine in the foreground.
inmem statusIs it running, and on which address.
inmem doctorCheck the install, the models and the wiring.
inmem setupFind every installed agent and wire its MCP entry and hooks.
inmem unsetupRemove all of that wiring again.
inmem stopStop the engine.

Health check: GET /v1/memory/health. The log is ~/.incord/inmem.log.

Connect an agent over MCP

The MCP server speaks over HTTP, not stdio. `inmem setup` adds it to every agent it finds. To add it by hand:

Claude Code

claude mcp add --scope user --transport http memory http://127.0.0.1:9180/v1/memory/mcp

Codex (~/.codex/config.toml)

[mcp_servers.memory]
url = "http://127.0.0.1:9180/v1/memory/mcp"

Supported clients include Claude Code, Codex, Cursor, Windsurf, Antigravity, OpenCode, VS Code and Continue. On your own machine no key is needed; from another machine a call needs an API key or an OAuth token.

MCP tools

An agent sees a small core by default, so its context is not filled with tool schemas. Every other tool is reached through incord_describe and incord_call.

ToolWhat it does
contextThe first call of a task: lessons, rules and the code that answers it, packed into a token budget.
recall_indexA ranked list of short previews for a question.
recall_getThe full items picked from that list.
lesson_writeSave one typed memory item: issue, finding, decision, convention, fact, preference or to-do.
code_read_symbolRead one function or type instead of a whole file.
code_neighborsWhat a symbol calls and what calls it.
explainA short spoken explainer that Watchman plays.
incord_describeThe list of every other tool, or one tool's full schema.
incord_callRun any of those tools by name.

Behind incord_call: recall and search (recall, memory_search, think, file_history), corrections (edit_memory, forget_memory), the graph, topics, code search and references, the auditor, the recorder (watchman_lookup, watchman_handoff, watchman_report), settings, orchestration, team versions, and the heavy-job queue.

HTTP API

Every MCP tool can also be called as POST /v1/memory/tools/{name}, and GET /v1/memory/tools lists them all. The routes most integrations use:

GET/v1/memory/healthIs the engine up.
POST/v1/memory/mcpThe MCP endpoint (JSON-RPC).
POST/v1/memory/recall/indexRanked previews for a question.
POST/v1/memory/recall/getThe full items for chosen previews.
POST/v1/memory/searchRanked matches.
POST/v1/memory/thinkA cited answer, plus what is still unknown.
POST/v1/memory/messagesSave a chat turn.
POST/v1/memory/lesson_writeSave one typed memory item.
POST/v1/memory/session/entryAdd a line to the session record.
GET/v1/memory/handoffThe last handoff for a project.
GET/v1/memory/topicsThe project's topics.
POST/v1/memory/watchman/lookupAsk the recorder for an answer it already holds.
GET/v1/memory/audit/findingsOpen findings from the code auditor.
POST/v1/memory/embeddingsEmbeddings, OpenAI-compatible.
POST/v1/ocrText in an image, from the local OCR model.

Auth: send a key as X-API-Key or Authorization: Bearer. Calls from your own machine need none until you create keys. Admin routes need the admin token.

How it connects to Watchman

Watchman is the app; Inmem is the engine it builds, ships and starts. Watchman writes which agents to wire and which models to fetch, and the engine does the rest.

HookWhat it does
SessionStartPuts your rules, the last session record and the recorder's notes into the agent's context.
UserPromptAdds the memory and code this prompt is about.
PreToolRuns the guards; a blocked call never runs.
PermissionRequestLets the owner proxy answer an approval as you.
CodeEditRecords the edit against the file and symbol.
CaptureSaves the new turns when the agent stops.
PreCompactSaves state before the agent compacts its context.
SubagentStartBriefs a subagent the same way.
PreCommitChecks before a git commit.
SessionEndCloses the session.

Sessions in Watchman's own terminal are captured from Watchman's record; sessions in other terminals are captured from each agent's own transcript.

Privacy

  • Memory is a set of files under ~/.incord on your machine.
  • Text inside <private>…</private> is always removed before anything is stored.
  • Team sync is off until you turn it on, and is end-to-end encrypted between your devices and teammates.
  • A cloud copy exists only if you link an account; then it syncs both ways.
  • The phone link sends sealed messages through a relay that cannot read them.
  • Keys are kept in your operating system's credential store.

Other docs

How every service reaches Watchman, in one place: How it connects.