Memory Model
Kernle implements a stratified memory system inspired by cognitive science but optimized for synthetic intelligences.Memory Layer Hierarchy
Supporting Systems
Playbooks
Procedural memory — “how I do things”
Relationships
Models of other agents and people
Emotional Tags
Valence/arousal on episodes
Meta-Memory
Confidence, provenance, verification
Memory Flow
The typical progression from raw capture to belief:1
Capture
kernle raw "API seems slow" — Zero friction capture2
Process
Review raw entries, promote to episode with context and lessons
3
Consolidate
Agent notices patterns across episodes, forms beliefs
4
Integrate
Beliefs inform values and identity over time
Meta-Memory System
Every memory type has these meta-fields:| Field | Description |
|---|---|
confidence | How certain we are (0.0-1.0) |
source_type | How acquired: direct_experience, inference, told_by_agent, consolidation |
source_episodes | Episode IDs that support this memory |
derived_from | Memory refs this was derived from (type:id) |
last_verified | When last confirmed |
verification_count | Times verified |
confidence_history | JSON array of confidence changes with timestamps |
Key Operations
Forgetting System
Kernle uses tombstoning, not deletion. Forgotten memories can be recovered.Salience Formula
- High salience: Confident, frequently accessed, recently used
- Low salience: Uncertain, rarely accessed, old
Protection
- Values and Drives are protected by default
- Any memory can be marked protected:
kernle forget protect episode <id> - Protected memories never decay
Forgetting Cycle
Search Functionality
Local Search
Uses sqlite-vec for semantic search when available, falls back to text matching.Cloud Hybrid Search
When cloud credentials are configured:- Try cloud search first (timeout: 3s)
- Fall back to local on failure
- Merge results by relevance score
Sync Architecture
Local-First with Sync Queue:- All changes written to local SQLite first
- Changes queued in
sync_queuetable - Queue deduplicates by
(table, record_id) - Push to cloud when online
- Pull remote changes on
load()if auto_sync enabled
local_updated_at