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 SIs and people
Emotional Tags
Valence/arousal on episodes
Meta-Memory
Confidence, provenance, verification
Memory Flow
The typical progression from raw capture to belief:Meta-Memory System
Every memory type has these meta-fields:| Field | Description |
|---|---|
confidence | How certain we are (0.0-1.0) |
strength | Memory strength (0.0-1.0), decays over time based on access patterns |
source_type | How acquired: direct_experience, inference, told_by_si, 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 |
Belief Revision Tracking
v0.14+: The
supersedes and superseded_by fields on beliefs are deprecated. They still exist for backward compatibility with older data, but new writes always set them to NULL. Revision history is now tracked via audit events (belief.revised and belief.deactivated). These fields will be removed in v0.15.is_active field to check whether a belief is current (true) or has been revised/archived (false). To view a belief’s revision history, query the audit log (kernle audit export or get_audit_log()) rather than walking the old supersession chain.
Key Operations
Forgetting System
Kernle uses continuous strength decay instead of binary forgetting. Every memory has astrength field (0.0 to 1.0) that decays over time based on access patterns. Memories with strength 0.0 are considered forgotten but can be recovered.
Strength Scoring
- High strength: Frequently accessed, recently used, reinforced through retrieval
- Low strength: Rarely accessed, old, not reinforced
- Zero strength: Effectively forgotten, but recoverable
Protection
- Values and Drives are protected by default
- Any memory can be marked protected:
kernle forget protect episode <id> - Protected memories never decay in strength
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
- Scalar fields: Last-write-wins based on
local_updated_at - Array fields (tags, lessons, etc.): Set union merge preserves data from both sides