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.
| Command | What it does |
|---|---|
| inmem serve | Run the engine in the foreground. |
| inmem status | Is it running, and on which address. |
| inmem doctor | Check the install, the models and the wiring. |
| inmem setup | Find every installed agent and wire its MCP entry and hooks. |
| inmem unsetup | Remove all of that wiring again. |
| inmem stop | Stop 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/mcpCodex (~/.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.
| Tool | What it does |
|---|---|
| context | The first call of a task: lessons, rules and the code that answers it, packed into a token budget. |
| recall_index | A ranked list of short previews for a question. |
| recall_get | The full items picked from that list. |
| lesson_write | Save one typed memory item: issue, finding, decision, convention, fact, preference or to-do. |
| code_read_symbol | Read one function or type instead of a whole file. |
| code_neighbors | What a symbol calls and what calls it. |
| explain | A short spoken explainer that Watchman plays. |
| incord_describe | The list of every other tool, or one tool's full schema. |
| incord_call | Run 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/health | Is the engine up. |
| POST | /v1/memory/mcp | The MCP endpoint (JSON-RPC). |
| POST | /v1/memory/recall/index | Ranked previews for a question. |
| POST | /v1/memory/recall/get | The full items for chosen previews. |
| POST | /v1/memory/search | Ranked matches. |
| POST | /v1/memory/think | A cited answer, plus what is still unknown. |
| POST | /v1/memory/messages | Save a chat turn. |
| POST | /v1/memory/lesson_write | Save one typed memory item. |
| POST | /v1/memory/session/entry | Add a line to the session record. |
| GET | /v1/memory/handoff | The last handoff for a project. |
| GET | /v1/memory/topics | The project's topics. |
| POST | /v1/memory/watchman/lookup | Ask the recorder for an answer it already holds. |
| GET | /v1/memory/audit/findings | Open findings from the code auditor. |
| POST | /v1/memory/embeddings | Embeddings, OpenAI-compatible. |
| POST | /v1/ocr | Text 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.
| Hook | What it does |
|---|---|
| SessionStart | Puts your rules, the last session record and the recorder's notes into the agent's context. |
| UserPrompt | Adds the memory and code this prompt is about. |
| PreTool | Runs the guards; a blocked call never runs. |
| PermissionRequest | Lets the owner proxy answer an approval as you. |
| CodeEdit | Records the edit against the file and symbol. |
| Capture | Saves the new turns when the agent stops. |
| PreCompact | Saves state before the agent compacts its context. |
| SubagentStart | Briefs a subagent the same way. |
| PreCommit | Checks before a git commit. |
| SessionEnd | Closes 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.