DocsAgent Brain

Agent Brain

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

Overview

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

  • One brain per OAgent
  • OAgent 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 OAgent 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 OAgent's persistent scratchpad.
Note
The brain viewer is read-only. Only the OAgent can modify its own brain content during conversations.

Auto-Seeding

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

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

Clear / Reset

Use the Clear button in the brain viewer to wipe all brain content. This is useful when an OAgent 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 OAgent 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.

Note
The UI calls this the Agent Brain, but the API path is /scratchpad. Both refer to the same content.

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.