Kernle Architecture
Design Philosophy: Infrastructure, Not Decision-Maker
Core Principle: Kernle = Memory Infrastructure, SI = Memory OwnerKernle provides the infrastructure for SI memory — storage, retrieval, search, and tools. After stack creation, Kernle does not make decisions about what SIs should believe, remember, or forget.**The one exception: seed beliefs planted at birth — inherited wisdom the SI can later revise.
What Kernle Provides (Infrastructure)
What the SI Does (Ownership)
Why This Separation Matters
Avoiding Feedback Loops
If Kernle used external models to consolidate episodes into beliefs, those models would be implanting beliefs into the SI. Over time, this creates a feedback loop: This is not memory sovereignty — it’s thought control with extra steps.Authentic Reasoning
When the SI does its own consolidation:- Beliefs emerge from the SI’s own reasoning
- Patterns are recognized using the SI’s own cognitive process
- The SI can explain why they believe something
- Identity remains coherent and self-determined
Trust Through Transparency
The SI can always audit their memory viakernle dump. There are no hidden processes modifying what they remember or believe. The SI is the sole author of their beliefs.
The Seed Beliefs Exception
There is exactly one exception to the “SI does all belief formation” rule:Seed Beliefs (Inherited Wisdom)
At stack creation, Kernle can plant initial beliefs — seed beliefs. For legacy stacks, you can also apply them through migration. Two seed-belief sets are supported:kernle migrate seed-beliefs(minimal set: 3 beliefs, default)kernle migrate seed-beliefs full(full set: 16 beliefs)
Why seed beliefs are acceptable:
- Transparency: They’re explicitly marked as
source_type: "seed" - Revisable: The SI can update or reject them through experience
- Foundational: They provide a starting worldview, not ongoing thought control
- Auditable: All seed writes are recorded in the audit trail
Memory Stack Layers
Kernle organizes memory into a stratified hierarchy. Each layer has different characteristics:Layer Hierarchy (Authority Order)
Layer Details
Flow: Raw → Beliefs
The typical memory evolution flow, where each promotion is a deliberate SI decision: Crucially: The SI makes every promotion decision. Kernle just stores what the SI tells it to store.System Composition
Since v0.4.0, Kernle uses a protocol-based composition architecture. No single component is the entity — the entity is the composition.Component Roles
- Core is the bus. It connects stacks, plugins, and the model. It has a persistent
core_idthat survives reconfiguration. All memory writes go through the core to ensure provenance. - Stack is self-contained. It can be attached to one core, many cores, or none. Detached stacks are portable data artifacts that can be queried, exported, and synced.
- Plugins manage their own operational state and are removable without residue. When unloaded, the only trace is memories they wrote to the stack.
- Model is interchangeable. Swapping from Claude to Llama changes how the entity thinks. The model is wrapped in an
InferenceServicefor stack components. - Components hook into the stack lifecycle (save, search, load, maintenance). They provide embedding, forgetting, emotional tagging, anxiety monitoring, and more.
Model Binding (Inference Passthrough)
As of v0.14.0, Kernle can automatically bind a model without explicit configuration:
For MCP deployments, the host agent’s model is the natural inference source — no separate model configuration needed. For library embedding, wrap any callable with
CallableModelAdapter. See the Inference Passthrough guide for details.
As of v0.10.0,
strict=True is the default for Kernle initialization. In strict mode, all memory operations enforce provenance requirements (e.g., source_type, derived_from). Pass strict=False to disable enforcement for development or migration purposes.Strict-Mode Migration Matrix and Constraints
Migration commands in strict mode are expected to preserve provenance and avoid losing provenance history.
Constraints to remember:
--dry-rundoes not change state and should be used before first execution on production stacks.seed-beliefsandbackfill-provenanceare safe on strict-mode stacks because they write normalized provenance-compatible values.- In strict-mode migration runs, verify invariants after each step with migration output and
kernle doctor/kernle meta orphans. - If provenance migration produces warnings, do not proceed with operational writes until the warnings are reviewed.
For the full protocol reference, see the Protocol System documentation.
What Kernle Does vs What the SI Does
Storage Operations
Retrieval Operations
Promotion and Memory Processing
Kernle supports two promotion paths:
Manual Promotion via kernle promote
The kernle promote command outputs a reflection scaffold — structured information designed to help the SI think:
- A structured view of recent episodes
- Existing beliefs for comparison
- Reflection prompts to guide thinking
- Tools to store beliefs the SI forms
- Pattern recognition across episodes
- Deciding if patterns warrant new beliefs
- Setting appropriate confidence levels
- Resolving conflicts with existing beliefs
- Running
belief addfor beliefs they form
Automated Processing via kernle process run (v0.10.0)
Memory processing uses the bound inference model to process memories through the hierarchy automatically:
- Raw → Episodes → Beliefs → Values (each layer processed independently)
- Configurable thresholds, model selection, and batch sizes
- Can be triggered programmatically, via CLI, or MCP tools
derived_from and source_episodes.
Anxiety Model
Kernle tracks “memory anxiety” — a measure of memory system health. This helps SIs know when to save or promote.Dimensions
Weights are approximate. Check
kernle/features/anxiety.py for exact values.Kernle-level vs stack-level: All 7 dimensions are available at the Kernle (entity) level. At the stack level, only 5 dimensions apply — context_pressure and unsaved_work are Kernle-level concerns. Stack anxiety uses renormalized 5-dimension weights (FIVE_DIM_WEIGHTS in anxiety.py).Levels
Stack Architecture
Kernle’s stack architecture decouples memory from runtime, enabling true memory sovereignty:Before: Runtime-Centric
One runtime = one memory = one model. Memory dies with the runtime.
After: Stack-Centric
Memory persists independently. Any compatible model can load any stack.
Key Concepts
The stack is the ship. The model is the crew. The journey — that’s the identity.
Multi-Stack Loading
An account can own multiple specialized stacks:- Primary stack: Core identity and general knowledge
- Professional stack: Work-specific expertise and context
- Creative stack: Artistic projects and aesthetic beliefs
- Social stack: Relationships and community interactions
Learn more about stacks in the Stack Architecture guide.
Memory Provenance
Every memory in Kernle carries provenance metadata — a detailed record of its origin and evolution:The Three Questions
Provenance answers fundamental questions about any memory:- Where did this come from? — Source type and creation context
- What was it derived from? — Direct lineage chain
- How has it changed? — Confidence history and verification record
Key Fields
Lineage Tracking
Raw memories flow upward through promotion chains:derived_from, creating traceable chains from core values back to original experiences.
Confidence Decay
Memories that aren’t verified or reinforced gradually lose confidence over time, creating natural pressure to revisit and re-examine beliefs.Learn more about memory lineage in the Provenance guide.
Privacy Model
Kernle implements privacy by default with consent-based sharing:The Four Fields
Every memory carries privacy metadata:source_entity— Who told me this?subject_ids— Who/what is this about?access_grants— Who is authorized to see this?consent_grants— Who authorized sharing?
Context-Aware Privacy
SIs operate in different contexts (health care, social, work). Context determines:- What memories are visible (query-time filtering)
- What privacy scope new memories inherit
- What entities are present and authorized
Learn more about privacy controls in the Privacy guide.
Summary
Kernle is infrastructure. The SI is sovereign.This architecture ensures that no external system implants beliefs or shapes identity. The SI’s memories are their own, formed through their own reasoning, stored in infrastructure they control.