> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anonalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Memory for your coding agent

> Architecture decisions, past fixes and house conventions that survive the end of the session.

[← All use cases](/use-cases/overview)

<div className="uc-examples"><a href="https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/memory_basics.py">memory\_basics.py</a><a href="https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/multi_agent_shared_space.py">multi\_agent\_shared\_space.py</a></div>

## The scenario

Your coding agent is excellent for an hour and then the session ends. Next time
it re-proposes the pattern you rejected, re-introduces the bug you fixed in
March, and re-asks why the module is structured that way.

The codebase is in its context. The *reasoning about* the codebase is not —
that lived in conversations, pull request threads and a decision nobody wrote
down.

## Step 1 — Connect over MCP

The fastest path is no code at all. Point the agent at our MCP endpoint and it
gets `record`, `retrieve`, `reason` and `list_spaces` as tools.

```bash theme={null}
claude mcp add --transport http anona https://memory.anonalabs.com/mcp \
  --header "Authorization: Bearer anona_live_YOUR_KEY"
```

MCP tools load at session start, so restart the agent after adding it. Full
setup, including keyless OAuth, is on the [MCP page](/mcp-integration).

## Step 2 — Give it the habit, not just the ability

MCP gives an agent the *ability* to remember. It will not reliably do so unless
told when. Our [Agent Skill](/integrations/skills) installs that habit — recall
before a task, record after it — without you writing prompt scaffolding.

```bash theme={null}
npx skills add anonalabs/Anona-Memory-SDK
```

## Step 3 — Record decisions, not diffs

Git already has your diffs. What it does not have is why.

```python theme={null}
client.record(
    space_id="platform",
    content="We rejected connection pooling in the worker: it pins a pgbouncer slot for the poll interval.",
    agent_id="claude-code",
    metadata={"repo": "platform", "kind": "decision"},
)
```

Scoping by `agent_id` keeps one agent's working notes separable while leaving
the decisions readable by everyone — the same shape as
[Two agents, one space](/use-cases/two-agents-one-space).

## Evals

1. Record three decisions. Start a fresh session. Ask the agent why one of them
   was made, and check it retrieves rather than reasons from the code.
2. Ask about something never recorded. It should say so — an agent that
   confabulates a decision is worse than one with no memory.
3. Re-run a task the agent previously got wrong. The correction should surface.
4. Check the write actually happened: `list_memories` after the session, rather
   than trusting that the tool was called.

## Guardrails

<Warning>
  **Never record secrets.** Agents paste freely, and a key or connection string
  written into memory is retrievable by everyone with access to the space and
  will resurface in later prompts. Keep credentials out of the content you store.
</Warning>

* **A shared team space needs a convention** for what is worth recording.
  Without one it fills with restatements of the code, which crowds out the
  decisions.
* **Record the rejected option and why.** "We use X" is weak; "we rejected Y
  because Z" stops the next agent proposing Y.
* **MCP tools only load at session start** — adding the server mid-session
  exposes nothing until you restart.

## Built from

Both are complete, runnable scripts:
[`memory_basics.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/memory_basics.py),
[`multi_agent_shared_space.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/multi_agent_shared_space.py).
