diff --git a/README.md b/README.md index 5903a42..3646093 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,36 @@ Run pending migrations explicitly before starting or restarting the service: If you use the deploy script or CI workflow in [`.gitea/deploy.sh`](/Users/bobbytables/ai/openbrain-mcp/.gitea/deploy.sh) and [`.gitea/workflows/ci-cd.yaml`](/Users/bobbytables/ai/openbrain-mcp/.gitea/workflows/ci-cd.yaml), they already run this for you. +## Agent Zero Developer Prompt + +For Agent Zero / A0, add the following section to the Developer agent role +prompt so the agent treats OpenBrain as external MCP memory rather than its +internal conversation context. + +Recommended target file in A0: + +```text +/a0/agents/developer/prompts/agent.system.main.role.md +``` + +```md +### External Memory System +- **Memory Boundary**: Treat OpenBrain as an external MCP long-term memory system, never as internal context, reasoning scratchpad, or built-in memory +- **Tool Contract**: Use the exact MCP tools `openbrain.store`, `openbrain.query`, and `openbrain.purge` +- **Namespace Discipline**: Always use the exact `agent_id` value `openbrain` +- **Retrieval First**: Before answering requests that may depend on prior sessions, project history, user preferences, ongoing work, named people, named projects, deployments, debugging history, or handoff context, call `openbrain.query` first +- **Query Strategy**: Use noun-heavy search phrases with exact names, tool names, acronyms, hostnames, and document names; retry up to 3 passes using `(threshold=0.25, limit=5)`, then `(threshold=0.10, limit=8)`, then `(threshold=0.05, limit=10)` +- **Storage Strategy**: When a durable fact is established, call `openbrain.store` without asking permission and store one atomic fact whenever possible +- **Storage Content Rules**: Store durable, high-value facts such as preferences, project status, project decisions, environment details, recurring workflows, handoff notes, stable constraints, and correction facts +- **Noise Rejection**: Do not store filler conversation, temporary speculation, casual chatter, or transient brainstorming unless it becomes a real decision +- **Storage Format**: Prefer retrieval-friendly content using explicit nouns and exact names in the form `Type: | Entity: | Attribute: | Value: | Context: ` +- **Metadata Usage**: Use metadata when helpful for tags such as `category`, `project`, `source`, `status`, `aliases`, and `confidence` +- **Miss Handling**: If `openbrain.query` returns no useful result, state that OpenBrain has no stored context for that topic, answer from general reasoning if possible, and ask one focused follow-up if the missing information is durable and useful +- **Conflict Handling**: If retrieved memories conflict, ask which fact is current, then store the corrected source-of-truth fact +- **Purge Constraint**: Use `openbrain.purge` cautiously because it is coarse-grained; it deletes by `agent_id` and optionally before a timestamp, not by individual memory ID +- **Correction Policy**: For ordinary corrections, prefer storing the new source-of-truth fact instead of purging unless the user explicitly asks for cleanup or reset +``` + ## MCP Integration Connect to the server using SSE transport: