Brain
Persistent knowledge entries that provide contextual memory across tasks and missions.
Brain
Brain is a beta feature. The API surface and behavior may change in future releases.
The Brain is Kavi's persistent knowledge system. It captures learnings from completed tasks, landing reports, patterns, and operator input, then resurfaces them as context when relevant. Rather than starting each task from scratch, agents receive curated knowledge entries that help them make better decisions and avoid repeating mistakes.
How Entries Are Created
Brain entries are created automatically at key points in the workflow:
- Task completion -- When a task completes, Kavi captures the title, summary, changed file paths, and routing reason as a brain entry. This gives future tasks context about what was done and why.
- Successful landings -- When
kavi landsucceeds, the merge summary is captured as a brain entry, recording what was integrated and any validation results. - Pattern promotion -- When a new mission starts, Kavi searches the pattern library for matching patterns and promotes the top matches into the mission's brain as entries. This gives agents context about how similar work was done before.
Entries can also be added manually by the operator using the operator source type, allowing you to inject domain knowledge, constraints, or preferences directly into the brain.
Pinning
Pin important entries to ensure they always appear in agent context. Pinned entries receive a +5 priority boost in search scoring, making them consistently surface in relevance-based selection. Pinning is sticky -- it is never overridden by deduplication merges.
Use pinning for entries that encode project invariants, architectural decisions, or constraints that should always be visible to agents.
BrainEntry Interface
The following fields make up a brain entry record:
| Field | Type | Description |
|---|---|---|
id | string | Unique entry identifier |
missionId | string | null | ID of the associated mission, if any |
taskId | string | null | ID of the associated task, if any |
sourceType | BrainSourceType | How the entry was created: task, mission, landing, operator, or pattern |
title | string | Short title summarizing the knowledge |
content | string | Full content of the entry |
tags | string[] | Tags for categorization and search matching |
pinned | boolean | Whether the entry is pinned to always appear in context |
createdAt | string | ISO timestamp of creation |
updatedAt | string | ISO timestamp of last update |
Further Reading
See Brain Entries for details on search scoring, deduplication, and CLI commands.