Agent memory
Your coding assistant forgets everything the moment you close the window. Every session restarts from nothing: the decision you made last Tuesday, the reason you rejected the obvious fix, the name of the service that actually owns that table. You re-explain your own project to it, daily.
The usual answer is to send your context to somebody's cloud. Gnarl's answer is that the memory is a search index on hardware you already own — and because the node is a peer, that memory is shared across your machines without a server in the middle.
With the Gnarly desktop app running:
claude mcp add --transport http gnarl-memory http://127.0.0.1:43300/mcp
That is the whole setup on one machine. Your assistant now has
memory_remember and memory_recall. Activate the same subscription key on
your other devices and what it learns on your laptop is recallable from your
desktop.
Why a mesh instead of a database
A single-machine memory is a file. The moment you have two machines it becomes a sync problem, and the usual fix is a hosted service that holds your context.
A Gnarl node is already a peer that replicates claims to other peers, so memory gets the same properties as any other index on the fabric:
- It follows you. Remember something on the laptop, recall it from the desktop. Same private mesh, and no account on either machine.
- It survives a closed lid. With
--replicas 2(the default), a peer holds a copy — so recall still works when the machine that learned the fact is asleep. - No one is in the middle. Text is embedded by a model on the node, and indexed and matched there. Nothing is uploaded to Lucenia, because there is no Lucenia in the path — no API key, no server of ours to go down or be handed a subpoena.
- It goes exactly as far as you say. The bullet above is replication, and a
copy on a peer is real data on a real other machine. Each index carries a
placement:
localnever leaves this machine,meshreaches the peers you have admitted,publicreaches the open fabric. Agent memory defaults tomesh. For a memory that must never leave the laptop, set that index tolocal— and accept that closing the lid takes it offline. - It spans distance. Home Wi-Fi, an office, a phone on cellular behind carrier NAT: devices on one subscription reach each other through the relay, with no VPN to set up.
On your other device in seconds
Remember something on the laptop and you can recall it on the desktop straight away. When the desktop has not heard of that memory yet, it asks up to eight of your other devices, over the signed peer connection or the relay, instead of waiting for the news to reach it. On two real desktop nodes the first recall after a remember found the memory in 0.11–0.23 seconds. Before v0.1.0-rc31 the same step could take about two minutes.
Recall says when it might be missing something. If a device that may hold the
memory has not answered — asleep, or out of reach — the response carries
"partial": true and returns what it found. An unreachable device makes the
answer partial; it does not make it an error, and it never makes an incomplete
answer look complete.
{"namespace": "default", "count": 0, "memories": [], "partial": true}
partial: false means every device that could hold the memory answered.
The tools your assistant gets
Exposed over MCP at http://127.0.0.1:43300/mcp, so any MCP client — Claude
Code, Cursor, Codex, or your own — can use them.
| Tool | What it does |
|---|---|
memory_bootstrap | Defaults plus a seed recall, for the start of a session |
memory_remember | Persist a fact, decision, or preference |
memory_recall | Retrieve what is relevant to the question at hand |
memory_answer | Recall, plus an answer composed on the node |
memory_update | Correct a memory in place |
memory_forget | Delete by id or scope (pinned entries survive by default) |
memory_rollup | Fold older entries into a summary so recall stays sharp |
memory_drift_check | Score an answer against pinned goals and anchors |
Setting it up
1. Install Gnarly.
Get the desktop app from the download page and launch it. It runs
a node in the background and answers on http://127.0.0.1:43300 — plain HTTP,
on loopback only. Installing it also puts the gnarl command
on your PATH.
2. Point your assistant at your own node.
The quickest way is in the app: Settings → Memory & agents, then Connect next to Claude Code, Cursor or Codex.
From a terminal, gnarl mcp install does the same:
gnarl mcp install --client claude # or cursor, or codex
With no --port, it wires the address the running node recorded for itself,
and if it finds none, the desktop app's http://127.0.0.1:43300/mcp. That is
the address the app's own Connect button writes, so the two always agree.
Pass --port only for a node you started on another port; an explicit port
uses HTTPS unless you add --no-tls.
It writes the config and tells you where, backing the file up first and keeping
every other entry in it — ~/.claude.json holds your whole Claude Code
configuration, not just MCP servers. Restart the client afterwards.
Use --print to see the block without touching anything:
gnarl mcp install --client codex --print
Codex is always printed rather than written, because merging into a TOML file we do not own would reformat it.
Doing it by hand
claude mcp add --transport http gnarl-memory http://127.0.0.1:43300/mcp
Cursor, in ~/.cursor/mcp.json:
{
"mcpServers": {
"gnarl-memory": {
"type": "http",
"url": "http://127.0.0.1:43300/mcp"
}
}
}
Codex, in ~/.codex/config.toml:
[mcp_servers.gnarl-memory]
url = "http://127.0.0.1:43300/mcp"
Each person points at their own loopback node, not someone else's IP. The mesh is what connects them.
The endpoint is always 127.0.0.1. /mcp answers the local machine and nothing
else — it is gated on the connecting socket, not on a header — so pointing a
second machine at this URL will not work, and is not how you share memory. That
is what step 3 is for.
3. Add your other devices.
With a Gnarl Personal subscription, paste the same key on each device:
- Desktop: Settings → System → Subscription, then restart Gnarly.
- Android and iOS: Private mesh → Subscription, then restart the node.
- Terminal:
gnarl activate <key>, then restart the node.
Every device activated with the key joins the same private mesh on its own. The mesh comes from the key, so there is no mesh name to agree on and no invite to send, and a running device sees a newcomer within seconds. See Connect your devices.
gnarl status should show peers > 0 on both. Only devices that prove they
belong to your mesh are admitted, so a neighbour's node on the same Wi-Fi never
receives your memories; see Who gets in.
Building your own agent
MCP gives your coding assistant a memory. To give an app or agent you are
writing its own memory, use the client libraries: pip install gnarl-client,
npm install gnarl-client, or go get github.com/gnarl-dev/go-client. With
Gnarly running they need no address — see Client libraries.
Build your own agent walks through it end to end, with a starter template your assistant can build from. On LangChain, LlamaIndex or the Vercel AI SDK, the framework adapters plug Gnarl in as the framework's memory.
Several people on one mesh
From v0.1.0-rc31, a node on a private mesh binds every memory call to the person asking, when that person presents a token. This is the first phase of private team memory.
Mint each person a token on a node of the mesh:
gnarl rbac issue --user alice --role memory
Their agent sends it as Authorization: Bearer <token> to /v1/memory/* on
the node's TLS mesh port, the address gnarl start prints as
Mesh: https://…. From then on:
- A memory call is bound to the token's person. Alice's agent remembers
and recalls as Alice. If it names another user, the answer is a bare
403 forbidden. The 403 does not say whether that user exists. Admin tokens are bound to their own person too. - A
memorytoken reaches memory and nothing else. It may call/v1/memory/*and thememory_*MCP tools only. Writer and Admin tokens keep their memory access. A Reader token has none. - The raw memory index is closed to tokens.
/v1/indexes/*document routes and the MCP index tools refuse a memory index to any token holder, and point to/v1/memory/*instead. - Shared and per-person memory come from the memory spaces.
personalis bound to the token's person. The team space (householdon the wire) is shared on purpose: it stays off until someone turns it on in Settings, and amemorytoken cannot use it. - Recall filters inside the vector search. The person filter runs inside the kNN search, not after it. With 1,000 people sharing one index, recall@10 went from 0.024 to 1.000, and no memory reached the wrong person.
- Forget only reaches your own. A forget aimed at another person's memory
id answers
not_in_scope. A missing id gets the same answer.
What phase 1 does not do yet:
- Your own devices are not bound by it. On loopback without a token, your Console, your CLI and your agents act as the device. They can still name any user, as they could before.
- Memories are not encrypted per person. The other devices on the mesh hold plain copies. An administrator can still delete or snapshot a whole memory index. Per-person encryption, with a recovery kit, is coming. Until it ships, put on a shared mesh only memories you would share with its devices' owners.
Try it
Ask your assistant to remember something specific, then start a new session and ask for it back. Then put the first machine to sleep and ask again from the second.
That last step is the one worth doing. It is the difference between a notes file and a fabric.
Honest limits
- Recall quality depends on embeddings. The default is on-device MiniLM:
semantic, offline, no API key. Every recall names the embedder it used, as
local_minilm(dim=384, semantic=true, offline=true). If it sayshashinginstead, the node could not load the model and fell back to matching words rather than meaning — paraphrased questions will miss. Give the node a data directory it can cache the model in, and check again. - Copies on other devices are not encrypted yet. A memory replicated to another device on your mesh is stored there as readable text, and something running on that device can read it. That is fine across your own devices. On a mesh you share with other people, see Several people on one mesh. Per-person encryption is on the roadmap, not in the product today.
- This is early-adopter software. Pre-1.0 and under active development: interfaces can change between releases, so treat memory you would be annoyed to lose as worth snapshotting.
Next
- Build your own agent — have Claude Code, Cursor or Codex build an agent on this memory
- Client libraries — Python, TypeScript and Go, with no address to configure
- Connect your devices — paste your key on each one
- Architecture — how a query executes with no coordinator
- Trust and verification — identity, signatures, and policy