The model
Using a Brain from an agent
Attach one or more Brain references to an agent. The agent getsbrain_search and brain_read tools scoped to the attached references — use a qualified {brain}:{filter} reference to expose only a slice:
src/agents/support.ts
Using a Brain from a workflow
Open a handle withbrain(reference) and call durable document operations. Every upload requires source; revision is your change fingerprint (more on this in Sync workflows):
src/workflows/upload-example.ts
list (cursor-paginated, by documentId prefix), updateMetadata, delete, and deleteMany. Uploads are synchronous through indexing — when uploadDocument resolves with outcome: "ready", the content is searchable.
Where to go next
- Filters — when to use a filter instead of a second Brain, and how to slice a corpus for different agents
- Sync workflows — best practices for keeping a Brain in sync with an external app
- Agents — attaching Brains as agent knowledge
- Workflows — the durable execution model sync workflows build on