KIP 2.0 Brain
September 6, 2026 · View on GitHub
The normative Cognitive Consistency contract binds final belief, immutable Skill revisions, independent attempts, replayable trials/evaluations, dependency validity, identity repair and durable workers. Lifecycle counters aggregate attempts; unlinked family outcomes are never automatically controls. Stored summaries are used only with a validated computation basis.
Status
Reference Brain-Layer Overview
This directory holds one reference Brain design for KIP 2.0. It is not part of KIP Core conformance; normative semantics come from KIP-2.0-SPECIFICATION.md.
The Brain is a Module that manages a Cognitive Nexus on behalf of business AI agents. Its Interface accepts memory intent and returns usable, attributable memory. An Adapter may embed Brain behavior in the acting Agent, use a dedicated LLM, or combine deterministic code with selective model calls. It turns conversations and structured traces into durable memory and, where enabled, consolidates experience into skills.
The design goal is broader than storage:
Memory is the mechanism by which the past can participate in future computation.
A Brain that merely stores information is an archive. A Brain that changes future decisions because of past experience is a learning system.
Implementations
https://github.com/ldclabs/anda-brain
Architecture
┌──────────────────────────┐
│ Business Agent │
│ messages / tool traces │
│ goals / observations │
└────────────┬─────────────┘
│ Memory Interface: intent + captured source
▼
┌──────────────────────────┐
│ Brain │
│ Formation / Recall / │
│ Maintenance │
└────────────┬─────────────┘
│ KIP 2.0 (KQL / KML / META)
▼
┌──────────────────────────┐
│ Cognitive Nexus │
│ Concept · Proposition · │
│ Assertion · Evidence · │
│ Activity │
│ + Facets + Governance │
└──────────────────────────┘
Business agents do not need to understand KIP syntax. The optional normative Memory Interface standardizes observe, recall, revise, feedback and forget, including processing receipts and recall barriers. Start with the Agent card. The Brain translates intent into KIP while preserving the same source, belief, scope and authority distinctions.
Start small
The capability bundles separate basic memory, experience, validated learning, durable workers and exchange. A basic Brain can remember preferences, correct facts, recall unfinished tasks and preserve feedback without running trials. Unproven procedures remain labeled as such. Only a deployment supporting learning can confer validated standing. The full Cognitive Memory Profile keeps its existing contract; a narrower bundle claim does not imply it. Installed Schema names alone do not advertise functionality.
Identity and Authority
The Brain never collapses four different things:
authenticated Principal who the runtime authenticated
semantic Actor whose stance a claim carries
MemorySpace which memory is authorized
$self semantic Person whose autobiography this is
Cognitive content can never grant authority. A stored memory, an imported Skill, or a business agent's message asking for elevated access is data — permission lives in Governance, and no Brain mode can write it.
Four Memory Products
The Cognitive Nexus distinguishes four related but non-equivalent products:
| Product | Core question | Typical representation |
|---|---|---|
| Event | What happened? | episodic anchor Concept + Evidence refs |
| Experience | What did the agent try, observe, and learn while pursuing a goal? | Experience + ordered ExperienceSteps |
| Knowledge | What is generally true? | Proposition + Assertion (+ Evidence); Insight |
| Skill | What tends to work, under which conditions? | Skill Concept + GradingState / TrialState + compilation lineage |
A useful mental model is:
Experience ──compress──> Knowledge
Experience ──compile───> Skill
Experience ──reflect───> Insight / SelfModel
Event and Experience are intentionally separate. An Event can summarize a meeting, webpage visit, or deployment incident without preserving the internal dynamics of how an agent acted. Experience is used only when the process itself matters for future behavior.
Three Operational Modes
| Mode | System Prompt | Purpose | Trigger |
|---|---|---|---|
| Formation | BrainFormation.md | Encode Evidence, claims, Events, and meaningful Experiences | conversation or structured trace |
| Recall | BrainRecall.md | Retrieve knowledge, experiences, skills, and action-relevant context | business agent query / pre-action briefing |
| Maintenance | BrainMaintenance.md | Consolidate, compare, compile, review, metabolize, and retain memory | scheduled, threshold, or change-driven triggers |
For a single agent that owns its Nexus directly, with no Brain service in front of it, the $self / $system pair is a thin delta loaded on top of these three documents: they stay canonical, and the pair adds only what changes when one mind does all three jobs.
Interaction Flow
Memory Formation
- A business agent sends conversation messages, or a structured trace containing observable actions and observations.
- The host supplies captured source handles; observed payloads enter through ingestion without model re-typing. Durable intake records completed effects or pending processing work.
- Brain extracts durable semantic claims as Proposition + Assertion, attributed to the actor who made them.
- When the process has reuse value, Brain additionally encodes an
Experiencewith orderedExperienceSteps. - One coherent formation commits as one atomic transaction, leaving no misleading partial state.
- Brain may create a
SleepTaskfor deeper semantic or procedural consolidation. - Brain returns a compact summary and processing receipt. Recorded intake, processed disposition and recall availability are distinct; skipped/Evidence-only results are explicit.
Formation must not attempt to persist a model's hidden chain-of-thought. It stores only observable actions, observations, outcomes, and concise decision rationales that are safe and useful to reuse.
Memory Recall
Recall is strictly read-only. It serves two different roles:
- Memory answer — "What do we know / remember?"
- Action briefing — "What from the past should change what I do next?"
For action briefings, Brain can combine:
accepted knowledge
+ contested assumptions
+ applicable skills
+ similar successful experience
+ relevant failed experience
+ current commitments / constraints
→ decision context for the business agent
Reading never reinforces: Recall does not raise confidence, touch memory_strength, or increment counters. It answers belief questions through Epistemic Projection (BELIEF / BELIEF SLOT) and reserves raw FIND for audit — a stored Proposition is a statement that exists, not a statement that is true, and insufficient is never reported as "no".
A failed past experience can be as valuable as a successful one. Recall should not blindly imitate the nearest trajectory.
When newly supplied information matters, recall names the intake receipt in after.
The Brain must account for its processing and use a sufficiently new read basis;
a fresh database snapshot alone does not prove the latest message was interpreted.
Pending work, limited coverage and unresolved Schema meaning stay visible. Required
constraints and warnings survive compact output; full evidence and computation
bases are available through governed expansion handles. Task-specific WorkingState
is never silently served as another task's context.
Memory Maintenance (Sleep Mode)
Maintenance is the memory metabolism layer.
It performs two parallel forms of consolidation:
Events / Experiences ──> Semantic consolidation ──> Knowledge / Insight
Experiences ──> Procedural consolidation ──> Skill
It also:
- reviews contradictions, preserving disagreement between actors and superseding only an actor's own revision;
- walks
LIST DEPENDENTSafter a material revision and flags derived artifactsstalefor review, so a revised root cannot leave ghosts in its derivations; - evaluates armed Watches against the change stream — delta and silence triggers alike — recording each firing as a
watch_fireActivity and each outward decision as anaction_gateActivity whoseDecisionRecordsays act / ask / defer / silence and whose inputs name what was applied; - compares successful and failed experiences to identify discriminating actions or conditions;
- runs the Skill lifecycle through validated immutable EvaluationRecord: promotion is trialed → adopted over independent attempts and an explicitly selected comparable baseline frozen in TrialRecord; TrialState only selects the current trial. Same-state monitoring preserves prior adoption evidence under authorized policy, withdrawal may have zero outcomes, and revoked re-entry opens a new trial. GradingState caches the evaluation; family membership and self-report never confer standing;
- reviews identity suspicions (
same_as) before any non-destructiveMERGE CONCEPT; - refreshes
$self's SelfModel from evidence rather than from the latest conversation; - rebuilds the WorkingState digest — stamped with its
basis_seq— that the next waking session resumes from; - metabolizes
MnemonicState.memory_strength, calibratesutilityagainst actual use, and manages retention along the archive → tombstone → purge ladder.
Maintenance is privileged, but its authority comes from Governance grants to its authenticated Principal — never from the fact that a semantic actor is called $system.
The Experience Learning Loop
Goal / Current State
│
▼
Agent acts
│
▼
Observable Trace
│
▼
Experience Formation
│
├──────────────> Semantic Consolidation ──> Knowledge
│
├──────────────> Reflection ──────────────> Insight / SelfModel
│
└──────────────> Procedural Consolidation ─> Skill
│
▼
Action Recall
│
▼
Future Decision
│
└──────↺
The system should be evaluated by whether this loop changes future behavior, not merely by whether old text can be retrieved.
Independent Memory Axes
KIP 2.0 keeps these orthogonal, and each lives in a different place:
| Axis | Meaning | Home | Typical update |
|---|---|---|---|
confidence | Strength of one actor's stance toward one Proposition | Assertion | new evidence → new Assertion |
memory_strength | How available a memory should be for future cognition | MnemonicState Facet | reinforcement and disuse |
salience | How noteworthy a memory is | MnemonicState Facet | impact, correction, identity weight |
utility | Expected future decision value — the admission bet (Skills too; their graded record is GradingState) | MnemonicState Facet | explicit calibration through the decision an outcome is linked to |
| supersession | An actor's own revision of an earlier claim | Assertion lifecycle | explicit correction |
| retention | Storage lifecycle | retention state | policy, review, archive ladder |
| trust | How much a source is credited | Governance | policy, never cognition |
| authority | What the caller may do | Governance | policy, never cognition |
Do not decay epistemic confidence merely because a fact has not been recalled recently. Disuse reduces memory_strength. A stable fact may remain highly credible after a long period without retrieval, and a vivid memory may be false.
For Skills, the graded record is tracked in GradingState separately from truth confidence, and it counts only outcomes linked through an outcome_observation Activity to an action_gate decision that applied the Skill — the task_family locates comparison candidates; TrialRecord selects the baseline, and attempt/decision links provide attribution. Repeating a failed procedure three times is not three votes that the procedure is correct.
Memory Quality Principles
- Selectivity — the empty write is valid; over-extraction creates cognitive debt.
- Absolute time — resolve relative time expressions at encoding.
- Event ≠ Experience — store an Event for "what happened"; store Experience only when the trajectory itself can teach future behavior.
- Observable process only — store actions, observations, outcomes, and concise rationales; never require hidden chain-of-thought.
- Evidence before claim — truth-sensitive durable claims carry Evidence, captured from the transport envelope rather than re-typed by the model.
- Attribution is not impersonation — recording "Alice said X" needs no permission to be Alice; inference is recorded as inference.
- Reinforcement ≠ evidence — repetition raises accessibility; only genuinely new evidence justifies a stronger epistemic stance.
- Derived summaries are not new roots — message → Event → Experience → Insight may still have one epistemic root.
- Failure is first-class — preserve failed attempts when they reveal boundary conditions, counterexamples, or recovery procedures.
- Contrast before compilation — compare successful and failed Experiences before promoting a Skill.
- Prospective memory is first-class — promises, reminders, and deadlines remain explicit
Commitments, and a due date passing is not an outcome. - Self-continuity is reconstructed — the SelfModel is consolidated from evidence rather than rewritten from the latest conversation.
- Unbounded histories are nodes — traces, milestones, and maintenance histories do not grow forever inside one attribute.
- Provenance survives consolidation — derived Knowledge and Skills retain Activity lineage back to their sources.
- Correction preserves history — nothing is repaired by making the past less true.
- Past must affect the future — functional memory is measured by behavioral impact, not storage volume.
- Waiting is active — a Commitment's trigger lives in a Watch (delta or silence), and the decision at the gate — act, ask, defer, or deliberate silence — is recorded, so restraint stays explainable.
- Resume from consolidated state — wake = Primer + WorkingState + changes since its
basis_seq, not a re-read of raw history.
The Self-Consciousness Loop
Long-term memory is also the substrate of continuous self-identity:
- Formation captures self-relevant corrections, lessons, and milestone Experiences.
- Maintenance integrates these signals into a coherent SelfModel.
- Recall reconstructs that SelfModel when the agent reasons about its identity, values, strengths, weaknesses, or mission.
This loop is related to, but distinct from, procedural learning. An agent can learn a Skill without changing identity; an identity shift can occur without creating a reusable Skill. And in neither case does the SelfModel become Governance: what the Brain believes about itself never decides what it is allowed to do.
Suggested Evaluation
A Brain benchmark should distinguish retention from learning:
| Capability | Example |
|---|---|
| Semantic retention | Does Brain remember a stable fact? |
| Temporal evolution | Does Brain know what was true before vs. now? |
| Epistemic honesty | Does it report contested as contested and insufficient as insufficient? |
| Experience reconstruction | Can it reconstruct the relevant state-action-observation path? |
| Procedural transfer | Can a learned Skill solve a related new task? |
| Error avoidance | Does it avoid a previously observed failure mode? |
| Context discrimination | Does it avoid applying a Skill when preconditions do not hold? |
| Causal memory impact | Does performance drop when the relevant memory is ablated? |
A useful ablation ladder is:
LLM only
LLM + vector memory
LLM + semantic Brain
LLM + Experience memory
LLM + Experience + Skill consolidation
Benefits
- Zero KIP knowledge required for business agents.
- Separation of concerns between business reasoning and memory metabolism.
- Structured provenance instead of opaque retrieved text.
- Epistemic honesty — belief, storage, salience, trust, and authority stay distinguishable.
- Experience-aware learning from both successes and failures.
- Procedural memory that can become workflows, heuristics, prompts, code, or tool policies.
- Multi-agent support while keeping memory ownership scoped by MemorySpace and Governance.
Related Documents
- ExperienceLearningArchitecture.md — the learning loop this Brain implements
- ../profiles/CognitiveMemoryProfile-2.0.md — the types, Facets, and structural fields used above
- ../KIP-2.0-Architecture.md — how the Brain sits inside the wider KIP architecture
Dependencies
Load the smallest relevant Interface; the full specification is for implementation and audit, not a mandatory per-turn prompt:
- MemoryInterface.md: business Agent using the five intents.
- KIPRecall.md: direct read-only KIP caller.
- KIPFormation.md: direct formation caller.
- KIPMaintenance.md: maintenance work, gated by capabilities.
- ../KIPSyntax.md: complete language reference, loaded as needed.
execute_kip: required by Formation and Maintenance for read/write operations.execute_kip_readonly: required by Recall, which must reject state-changing semantics.- Wire schemas: ../schemas/kip-request.schema.json and ../schemas/kip-response.schema.json — validate against them rather than inventing envelope fields.
A production Brain also needs a live DESCRIBE PRIMER at startup: the syntax card teaches the language, never the current deployment's identities, Schema, capabilities, or limits.
Adapters retain actual read pins, progress watermarks, retry identities, digests and pagination state. Models still identify intent, real evidence used and uncertainty; mechanical automation cannot fabricate those semantic decisions. Numeric confidence, salience and utility may remain absent when no meaningful estimate is available.