~/docs/brain

Brain

The AI's long-term memory — facts, preferences, and history.


The Brain is the AI's long-term memory for a workspace. It stores facts, past decisions, user preferences, built services, known credential issues, and workspace history. The Orchestrator reads the brain before building and writes to it after every build.

Always Read Before Building

Before spawning the Architecture agent, the Orchestrator searches the brain for relevant context. It passes that context into the architecture prompt so the plan accounts for existing services, past decisions, and user preferences.

Always Write After Building

After a successful build, the Orchestrator adds or updates brain entries for:

  • New services created (name, directory, endpoints, purpose)
  • New secrets created (name, which service uses it)
  • User preferences that surfaced during the conversation
  • Decisions made and why
  • Issues encountered and how they were resolved

Brain Management Actions

ActionDescription
listSee all brain entries
searchFind entries by query
getGet a specific entry
createAdd a new entry
updateUpdate an existing entry
deleteRemove a stale entry

Learn how sessions work with OpenCode.Sessions