Skip to content

Latest commit

Β 

History

126 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KIP 2.0 β€” Cognitive State Protocol for Agent Memory

English | δΈ­ζ–‡

Status

Default development version: KIP 2.0 β€” normative draft. The repository root contains the current protocol and tooling. KIP v1.0-RC11 is frozen for historical reference and migration; changing the default does not upgrade existing deployments or declare the 2.0 protocol stable.

The consistency revision adds final-belief guarantees, immutable procedural records and a separately versioned memory package (2.1.0), with executable contract checks and bounded models. The Rust and Cloudflare Durable Object engines target KIP 2.0 drafts; their coverage of this revision must be established by fresh adapter results, not inferred from earlier conformance. The protocol remains 2.0-draft, independently of published tooling versions; no real Brain learning result is claimed by these structural tests.

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.

Start here

The archived MCP server and Skill implement v1 interfaces; native v2 integration starts with the current Interface and wire contracts above.

KIP 2.0 information architecture: Agent/Brain speaks KQL, KML and META over the wire contract; reads project through Epistemic Projection into Cognitive State; writes commit through the Transaction Runtime; commits publish a Change Stream that returns to the Agent as a state differential; Governance and Schema form a protected control plane; state exports as a Cognitive Capsule.

An interactive version β€” pan, zoom, relationship tracing, five guided views β€” is a self-contained file: download it and open it in a browser.

The one idea

A memory that cannot separate what was said from what is true will eventually lie to its owner with total confidence. KIP 2.0 refuses to collapse three questions:

Meaning      what can be represented at all
Belief       what the Brain currently accepts
Authority    who may read, write, project, or elevate

So a stored Proposition is truth-neutral. An Assertion carries one actor's stance toward it, with mode, confidence, validity and evidence. Belief is not a stored field but an Epistemic Projection computed at read time over the eligible assertions:

Proposition exists  β‰   Proposition is true  β‰   Brain accepts Proposition

A correction creates a new Assertion while preserving the old record. A change in the world keeps complementary valid-time intervals: a formerly true claim is closed, not declared wrong. The next projection evaluates the current slot and dependencies, and historical queries retain what was valid before (Specification Β§14.2).

Evidence, provenance and schema get the same treatment: Evidence and Activity are first-class elements rather than metadata bags, and schema lives in versioned, digest-pinned packages.

The proactivity layer

A memory that only answers when asked is half a memory. The other half is what the Brain does when nobody is talking to it β€” and it must not be a cron job. KIP 2.0 gives that half four mechanisms, none of which decides policy on the Brain's behalf:

Mechanism What it is
Watch Durable attention state. A declared condition under which a change β€” or the absence of one β€” deserves attention. Armed watches are evaluated against committed Change Envelopes; a silence watch fires when its due_at passes with no match. Proactivity becomes a state differential β€” delta watches fire on committed change, silence watches on a due-time sweep β€” rather than a blind schedule. A fired Watch grants nothing: it creates attention, never an action.
action_gate An Activity class recording what the gate decided β€” act, ask, defer, or silence β€” with the inputs it weighed. Restraint is the hardest thing to justify after the fact, so deliberate silence is written down like any other outcome.
LIST DEPENDENTS Bounded reverse traversal of provenance. Revise a root and the cognition compiled from it β€” insights, preference summaries, skills, the self-model β€” becomes discoverable in one operation instead of quietly stale. Β§57.5 makes the rule explicit: a revised root must not auto-retract its dependents, and must leave them reviewable. Whether one survives is a review decision, not a protocol rule.
PURGE PAYLOAD Destroy an Evidence element's observed bytes while keeping the record: its digest, class, observation time, source, and the citations that depend on it. Data minimization that costs no provenance β€” corroboration and independence counting keep working on the surviving digest. Distinct from element purge, which destroys the record itself.

Supporting state lives in the Cognitive Memory Profile: WorkingState is the consolidated resume digest stamped with its basis_seq, so a Brain wakes from compiled state plus a delta rather than re-reading scrollback; DerivationState carries the current | stale | under_review flag that a dependent review writes back; and MnemonicState.utility holds the admission bet β€” how useful this memory is expected to be β€” kept deliberately separate from salience, from memory_strength, and from epistemic confidence.

The consequence channel

Everything above makes the system watch the world better. The consequence channel is how the world watches back.

Outcome Evidence records what actually happened after a decision, action, or trialed procedure β€” written by instrumentation (telemetry, verifiers, test harnesses, human review), never by the actor whose action it grades. An actor's own account is agent_statement, citable as context only; the separation is a conformance invariant, enforced as auditability β€” engine origin always records who wrote what, and Governance can restrict who may write outcomes β€” because an open protocol can make self-grading visible even where it cannot make it impossible.

Each outcome carries a task family that selects candidate consequences. Sharing the family establishes neither attribution nor baseline membership: TrialRecord explicitly freezes comparable baseline attempts and outcomes. Treatment observations link through the instrument's outcome_observation Activity to an attempt and the action_gate decision that applied the exact Skill revision. Its DecisionRecord distinguishes retrieval from actual use, and grading counts independent attempts assigned before execution. A SkillRevision must name its task family before trial; a pattern that nothing could prove wrong is not procedural memory. On the channel sits the Skill lifecycle:

proposed β†’ trialed β†’ adopted β†’ revoked

Lifecycle changes and grading refreshes commit with a validated immutable EvaluationRecord on a lifecycle_verdict Activity and guarded updates. Auditors replay exact inputs against the immutable TrialRecord; TrialState only selects the current trial. Only trialed β†’ adopted promotes through a comparative verdict, and revocation is never harder than adoption. Same-state monitoring may retain standing under authorized policy without claiming new improvement; policy withdrawal may have zero outcomes. Imported Skills enter proposed without local grades and remain recallable as unproven candidates. Revoked Skills must enter a new trial before adoption can recur.

Protocol provides signals; the Brain owns policy

KIP does not define an admission threshold, an interruption policy, a salience algorithm, a consolidation schedule, or a skill compiler. It defines where those decisions put their inputs and their receipts. A protocol that hardcoded one utility function would stop being a protocol β€” and every deployment would fork it.

The policy layer is a separate, replaceable component:

  • Brain 2.0 β€” the reference design: Formation (what deserves to outlive this turn), Recall (what from the past should change what I do next), and Maintenance (the sleep-time metabolism that consolidates, compiles skills, reviews contradictions, and metabolizes memory strength).
  • $self / $system β€” the single-agent variant, a thin delta layered on the Brain policies above: a waking mind that experiences, and a sleeping mind that integrates.
  • Experience Learning Architecture β€” the loop the Brain implements, and how to evaluate whether it actually learned anything rather than merely stored more.

The seam matters in both directions. Because policy is out of the protocol, two Brains with different admission utilities can share one Cognitive Nexus; and because the signals are in the protocol, either Brain's decisions remain auditable by the other.

Memory should be portable

If memory is what makes an agent valuable, the natural move is to make it impossible to leave with. KIP takes the opposite position: cognition exports as a signed, inspectable Cognitive Capsule, and import is a destination-governed transaction β€” a capsule's signature proves origin and integrity, never truth, trust, or authority. Imported skills stay non-executable until the destination elevates them; a source's $self never becomes the destination's.

Documents

Document Description
Memory Interface Five Agent intents, processing receipts, scoped recall and composable capability bundles
Agent memory card The small everyday Interface; direct KIP role cards live alongside it
Cognitive consistency Final belief, revisions, independent attempts, replay, dependencies and durable runtime contracts
Review resolution All 12 review items, implementation locations and verification scope
Brain evaluation Separate protocol, reliability and behavioral-learning release gates
πŸ“– Specification 2.0 The normative draft (δΈ­ζ–‡)
πŸ“¦ Capsule Specification 2.0 Specification Β§37–§41 and Β§95: the portable, verifiable memory artifact (δΈ­ζ–‡)
🧭 Optional Profiles & Migration Specification Β§100, Β§101, Β§103 and Appendix I: Historical, High-Assurance, and KIP 1.x migration (δΈ­ζ–‡)
πŸ“œ Invariant Registry The 43 Core and 46 Profile invariants in one list, each with the section that establishes it and the vectors that pin it (δΈ­ζ–‡)
πŸ› Architecture 2.0 Design rationale behind the Specification (δΈ­ζ–‡)
πŸ“ Syntax Reference 2.0 LLM-facing KQL / KML / META card (δΈ­ζ–‡)
🧩 Cognitive Memory Profile 2.0 Experience, Skill, Commitment, Watch, WorkingState, and the rest (δΈ­ζ–‡)
🧠 Brain 2.0 Formation / Recall / Maintenance (δΈ­ζ–‡)
πŸ€– $self / βš™οΈ $system Single-agent prompt pair, a delta over Brain 2.0 ($system)
πŸ—‚ Design Notes Ten pre-consolidation rationale documents, frozen 2026-09-02
πŸ”€ Grammars & Schemas Normative EBNF, plus the wire schemas
πŸ§ͺ Conformance Suite 356 state/consistency vectors plus 12 optional Memory Interface scenarios and executable contract models
πŸ”¬ Formal Verification Alloy and TLA+ models, and what they proved
πŸ”€ Migration from 1.x What changes, and what legacy meaning must not be invented

Existing Chinese mirrors are retained. This consistency revision updates English normative sources only; mirrors are not an alternative semantic contract.

Project terminology lives in CONTEXT.md; essays remain in post/.

Governing principle

KIP 2.0 is a protocol for durable cognition: new information may change what a Brain does next without requiring the Brain to falsify what happened before.

License

Copyright Β© 2026 LDC Labs. Licensed under the MIT License.

About

🧬 KIP (Knowledge Interaction Protocol) is an open protocol for durable AI agent memory and learning. It connects experience, evidence, knowledge, and skills in a portable, auditable cognitive state, helping agents revise beliefs and improve future decisions through feedback from real outcomes.

Topics

Resources

Stars

82 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages