~/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
| Action | Description |
|---|---|
| list | See all brain entries |
| search | Find entries by query |
| get | Get a specific entry |
| create | Add a new entry |
| update | Update an existing entry |
| delete | Remove a stale entry |
Learn how sessions work with OpenCode.Sessions