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.

English | 中文

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:

ProductCore questionTypical representation
EventWhat happened?episodic anchor Concept + Evidence refs
ExperienceWhat did the agent try, observe, and learn while pursuing a goal?Experience + ordered ExperienceSteps
KnowledgeWhat is generally true?Proposition + Assertion (+ Evidence); Insight
SkillWhat 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

ModeSystem PromptPurposeTrigger
FormationBrainFormation.mdEncode Evidence, claims, Events, and meaningful Experiencesconversation or structured trace
RecallBrainRecall.mdRetrieve knowledge, experiences, skills, and action-relevant contextbusiness agent query / pre-action briefing
MaintenanceBrainMaintenance.mdConsolidate, compare, compile, review, metabolize, and retain memoryscheduled, 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

  1. A business agent sends conversation messages, or a structured trace containing observable actions and observations.
  2. The host supplies captured source handles; observed payloads enter through ingestion without model re-typing. Durable intake records completed effects or pending processing work.
  3. Brain extracts durable semantic claims as Proposition + Assertion, attributed to the actor who made them.
  4. When the process has reuse value, Brain additionally encodes an Experience with ordered ExperienceSteps.
  5. One coherent formation commits as one atomic transaction, leaving no misleading partial state.
  6. Brain may create a SleepTask for deeper semantic or procedural consolidation.
  7. 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:

  1. Memory answer — "What do we know / remember?"
  2. 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 DEPENDENTS after a material revision and flags derived artifacts stale for 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_fire Activity and each outward decision as an action_gate Activity whose DecisionRecord says 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-destructive MERGE 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, calibrates utility against 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:

AxisMeaningHomeTypical update
confidenceStrength of one actor's stance toward one PropositionAssertionnew evidence → new Assertion
memory_strengthHow available a memory should be for future cognitionMnemonicState Facetreinforcement and disuse
salienceHow noteworthy a memory isMnemonicState Facetimpact, correction, identity weight
utilityExpected future decision value — the admission bet (Skills too; their graded record is GradingState)MnemonicState Facetexplicit calibration through the decision an outcome is linked to
supersessionAn actor's own revision of an earlier claimAssertion lifecycleexplicit correction
retentionStorage lifecycleretention statepolicy, review, archive ladder
trustHow much a source is creditedGovernancepolicy, never cognition
authorityWhat the caller may doGovernancepolicy, 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

  1. Selectivity — the empty write is valid; over-extraction creates cognitive debt.
  2. Absolute time — resolve relative time expressions at encoding.
  3. Event ≠ Experience — store an Event for "what happened"; store Experience only when the trajectory itself can teach future behavior.
  4. Observable process only — store actions, observations, outcomes, and concise rationales; never require hidden chain-of-thought.
  5. Evidence before claim — truth-sensitive durable claims carry Evidence, captured from the transport envelope rather than re-typed by the model.
  6. Attribution is not impersonation — recording "Alice said X" needs no permission to be Alice; inference is recorded as inference.
  7. Reinforcement ≠ evidence — repetition raises accessibility; only genuinely new evidence justifies a stronger epistemic stance.
  8. Derived summaries are not new roots — message → Event → Experience → Insight may still have one epistemic root.
  9. Failure is first-class — preserve failed attempts when they reveal boundary conditions, counterexamples, or recovery procedures.
  10. Contrast before compilation — compare successful and failed Experiences before promoting a Skill.
  11. Prospective memory is first-class — promises, reminders, and deadlines remain explicit Commitments, and a due date passing is not an outcome.
  12. Self-continuity is reconstructed — the SelfModel is consolidated from evidence rather than rewritten from the latest conversation.
  13. Unbounded histories are nodes — traces, milestones, and maintenance histories do not grow forever inside one attribute.
  14. Provenance survives consolidation — derived Knowledge and Skills retain Activity lineage back to their sources.
  15. Correction preserves history — nothing is repaired by making the past less true.
  16. Past must affect the future — functional memory is measured by behavioral impact, not storage volume.
  17. 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.
  18. 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:

CapabilityExample
Semantic retentionDoes Brain remember a stable fact?
Temporal evolutionDoes Brain know what was true before vs. now?
Epistemic honestyDoes it report contested as contested and insufficient as insufficient?
Experience reconstructionCan it reconstruct the relevant state-action-observation path?
Procedural transferCan a learned Skill solve a related new task?
Error avoidanceDoes it avoid a previously observed failure mode?
Context discriminationDoes it avoid applying a Skill when preconditions do not hold?
Causal memory impactDoes 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.

Dependencies

Load the smallest relevant Interface; the full specification is for implementation and audit, not a mandatory per-turn prompt:

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.