Skip to main content

Brain Memory Brain

Start in one conversation​

Run anda memory guide for an offline introduction. No extra Brain or MIB setup is needed for ordinary memory. Tell Anda: “Remember that I prefer short release notes with a risk section.” After background processing, use /new and ask what it remembers. A reply saying “remembered” is not a storage receipt.

anda memory and TUI /memory show connection and processing status without model calls. The browser Memory workspace shows source-backed records and conversation activity. About you, Brain itself and System (the Brain's own $self and $system), a name search that calls no model, and the subjects and objects of records open entity pages: an entity's claims grouped by relation, each marked with Brain's current belief under the standard recall policy, with statements replaced by newer ones kept as history and a small graph of the related entities on that page. Records, entity pages and search list claims whose sources can be verified for you, and the Brain's own claims that carry no source at all, such as memory upgraded from KIP 1 and Maintenance conclusions; those are marked unsourced and read-only. Source quotes link to original messages when their stored mapping and digests match. Search may call a model and does not retry automatically.

Review a record's Correct, Stop using or Delete preview before confirming. Stopping use retains archived records; deletion purges the previewed native set. Source exclusions survive restart, and processing Notes are reset. Original chats, files, logs, backups and already delivered context remain. Unsupported or incomplete source scopes cannot be removed through this interface. A correction first asks which change it is: I said it wrong replaces your earlier claim, Things changed records a new value from now while the old one stays true for its time, and You recorded it wrong asks Brain to re-read the original message and repair the record. Deletion reports its erasure plan: completed, partial when a surface could not be verified, or blocked by a legal hold.

To start a conversation with restricted memory, run anda agent run --memory-mode no-store --prompt '…' or --memory-mode off; the chat apps don't offer a memory mode. These modes constrain automatic Brain access, including background writes; they are not incognito modes for chat or providers. Restricted modes also reject nested agents, bookmarks and cron changes.

For questions that must survive across conversations, use Set up a memory inbox or anda memory inbox setup. Review and apply the configuration, then explicitly run anda restart. Custom runtime files and environment overrides are preserved. Subscribe to a record to get a real native inbox item when it changes. In TUI, use /memory inbox, /memory answer <number> <text> and /memory retry <number>; retries reuse the saved event and text.

Read the inbox with anda memory inbox. Follow the printed anda memory inbox --cursor <next_cursor> command for another page. With --json, the cursor is in result.next_cursor.

MIB comparisons and business learning are advanced, separate features. anda memory evaluate plan --help describes the isolated CLI workflow in MIB-enabled builds. Costs may be incomplete. A memory comparison does not approve business learning or prove improvement.

Anda Brain is the long-term memory system behind Anda Bot. It is not a plain vector database or an ever-growing Markdown file; it is a memory brain designed for agents.

Brain turns conversations, files, tool results, and channel context into a growing Cognitive Nexus: people, projects, preferences, events, decisions, timelines, and the relationships between them.

Three-Phase Loop​

Formation​

Formation encodes useful conversations and work results into structured memories. It does not only ask whether a sentence appeared; it asks who, which project, what preference, what decision, what event, and when it happened.

Recall​

Recall lets Anda query the memory graph with natural language. Good recall explains the current task instead of returning nearest text fragments alone.

Maintenance​

Maintenance consolidates fragments, merges duplicate information, reduces the influence of stale knowledge, and preserves timelines when facts change.

How to Teach Anda​

You do not need to maintain memory files. A better approach is to state stable facts, changes, and preferences clearly.

Remember: I like short release notes, but keep a risk section.
The default model provider for this workspace changed from A to B.
When we mention Alice, we mean the mobile team designer.
Do you remember the background of the payments migration project?

What Makes a Good Memory​

  • Context: project, person, file, channel, or time range is clear.
  • Evolution: when a preference changes, state the old and new versions.
  • Boundaries: temporary information can be marked as only valid for the current task.
  • Correction: when Anda remembers incorrectly, state the correct version directly.

Local Data and Model Providers​

Memory graph data is stored locally in ~/.anda/db by default. Model providers may still participate in memory formation, recall support, and summarization, so choose providers and endpoints according to your privacy needs.

To make a provider preferred for memory-related tasks, add the brain label:

model:
providers:
- family: anthropic
model: "deepseek-v4-pro"
api_base: "https://api.deepseek.com/anthropic"
api_key: "YOUR_API_KEY"
labels: ["primary", "brain"]

Share memory with other agents​

Claude Code, Codex and other MCP clients on the same machine can use Anda's memory over MCP. Give each agent a token of its own; add --write to let it tell memory what to remember:

anda memory agents add claude-code --write

The command prints the token once, with the setup for Claude Code and Codex:

claude mcp add --transport http --scope user anda-memory http://127.0.0.1:8042/mcp/memory --header "Authorization: Bearer <token>"
# ~/.codex/config.toml; export ANDA_MEMORY_TOKEN=<token> before starting Codex
[mcp_servers.anda-memory]
url = "http://127.0.0.1:8042/mcp/memory"
bearer_token_env_var = "ANDA_MEMORY_TOKEN"

Other clients connect to the same Streamable HTTP endpoint with an Authorization: Bearer <token> header. It is served at /mcp/memory on the daemon's address, accepts only a loopback host name (localhost, 127.0.0.1 or ::1) and refuses requests from web pages; every request still needs a token, and a client on another machine connects through a tunnel.

ToolAccessWhat it does
recall_memoryevery tokenAnswers one question from memory with Anda's memory model; waits briefly for the agent's own notes still being processed
search_memoryevery tokenFinds entities by name without a model
read_memory_entityevery tokenLists an entity's claims, newest first, with Anda's current belief and source quotes, without a model
remember--writeRecords a note in the agent's own words and submits it to Formation; an idempotency_key makes a retry safe
memory_note_status--writeReports whether a note has been processed

A note is the agent's statement, attributed to it as a named participant (for example "Claude Code"), never to you and never to Anda itself. It is kept in a conversation of its own with the source agent:claude-code, and the Memory workspace shows what Formation made of it with that source, ready to correct, stop using or delete like any other record.

A token reads what Anda reads, so only give one to an agent you trust with your memory, and remember that what it reads reaches its model provider. Recall and Formation run on Anda's memory models and are billed there. anda memory agents lists the grants and when each was last used, and anda memory agents revoke <id|client> stops a token at once. Tokens last 90 days unless --days sets another lifetime (up to 3650). Anda keeps only a digest of each token, so a lost token cannot be shown again: revoke it and add a new one. While Anda prepares an update, the endpoint answers 503 until it finishes.

Optional native runtime​

Set brain.runtime_config to a trusted JSON/YAML file relative to the configuration directory; BRAIN_RUNTIME_CONFIG overrides it. Restart to install bindings before Space loading. The browser Brain inbox and TUI /brain inbox, /brain status, /brain formation <id> use the authenticated caller. Reading is not execution permission; retry an answer with the same event key and text. Recall receipts prove delivery only, and Formation acceptance is not completion. The learning feature is independent of mib; semantic, utility, trust and automatic learning require explicit native configuration and authority. Current IM transports are not automatic action adapters. MIB persistent memory does not claim normal/ungated learning or complete costs. Each Formation window is an observed intent with a durable receipt, so an interrupted submission replays the same receipt instead of forming the window twice. recall_memory first waits briefly for the conversation's own pending windows and says which are still being processed. brain_attention also returns due commitments and fired watches since you last looked, and brain_feedback records the assistant's own report as attributed evidence, never a grade.

brain:
runtime_config: brain-runtime.yaml

Older browser tokens keep working without a re-export: runtime requests retain the original user identity, and the embedded Brain accepts a token that names no audience while still verifying its signature and expiry.