Skip to main content
A Brain is an organization-level knowledge base: a set of documents that Keystroke extracts, chunks, embeds, and indexes for hybrid (semantic + keyword) search. Agents attach Brains to answer questions from your content; workflows write documents into them — usually by syncing an external app like a wiki, an issue tracker, or a file store.

The model

Using a Brain from an agent

Attach one or more Brain references to an agent. The agent gets brain_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 with brain(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
The handle also provides 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