DocsAgent Brain

Agent Brain

A persistent markdown scratchpad that the agent autonomously maintains across conversations. The brain stores context, preferences, and learned patterns.

Overview

The Agent Brain is a persistent markdown document attached to each agent. Unlike memory (discrete facts), the brain is a freeform scratchpad the agent uses to organize knowledge, track patterns, and maintain context across all conversations.

  • One brain per agent
  • Agent reads and writes autonomously — user views read-only
  • Content persists across all conversations and threads
  • Markdown format for structured notes

Viewing the Brain

Click the Brain icon on any agent card to open the brain viewer. It opens as a side sheet showing the full markdown content.

Agent brain viewer sheet opened from agent card
The brain viewer shows the agent's persistent scratchpad.
Note
The brain viewer is read-only. Only the agent can modify its own brain content during conversations.

Auto-Seeding

When an agent has its first conversation, the brain is automatically seeded with content derived from the agent's behavior rules. This gives the agent an initial knowledge base to work from.

Tip
Write detailed behavior rules during setup — they become the foundation of the agent's brain.

Clear / Reset

Use the Clear button in the brain viewer to wipe all brain content. This is useful when an agent has accumulated incorrect or outdated information. After clearing, the brain will be re-seeded from behavior rules on the next conversation.

Warning
Clearing the brain is irreversible. The agent loses all autonomously learned context. Only behavior rules will be restored on the next conversation.

API Reference

The brain can be read and updated programmatically via the REST API.

GET /api/agents/{id}/scratchpad

Returns the current brain content as a JSON object with a content field (markdown string).

bash
curl -H "Authorization: Bearer a2a_your_key" https://oya.ai/api/agents/{id}/scratchpad

PUT /api/agents/{id}/scratchpad

Replaces the brain content. Send a JSON body with a content field.

bash
curl -X PUT -H "Authorization: Bearer a2a_your_key" -H "Content-Type: application/json" -d '{"content": "# Updated Brain\n\nNew content here."}' https://oya.ai/api/agents/{id}/scratchpad
Warning
The PUT endpoint replaces the entire brain. There is no merge — whatever you send becomes the new brain content.