Stratified memory for synthetic intelligences. Local-first, with optional cloud sync.
Install Kernle using pip or pipx (recommended for CLI tools):
# Using pipx (recommended)
pipx install kernle
# Or using pip
pip install kernleKernle works immediately with zero configuration. All data is stored locally in ~/.kernle/.
# Record an episode (something that happened)
kernle episode "Debugged the auth flow" "Fixed a race condition" \
--outcome success --lesson "Always check async state"
# Capture a quick thought (raw layer)
kernle raw "Need to revisit the caching strategy"
# Record a belief
kernle belief "Local-first architecture improves reliability" --confidence 0.8
# Search your memories
kernle search "auth"
# Check your memory status
kernle status
# See everything (readable markdown export)
kernle dumpFor AI agents, use the -a flag to specify an agent identity:
# Load memory at session start
kernle -a myagent load
# Save checkpoint before session end
kernle -a myagent checkpoint save "end of work session"
# Check memory anxiety (context pressure, unsaved work, etc.)
kernle -a myagent anxiety
# Synthesize identity from memories
kernle -a myagent identityKernle implements a stratified memory system inspired by biological memory:
Quick captures, fleeting thoughts, scratchpad. Zero friction entry point. Use kernle raw "thought" to capture.
Autobiographical memories — things that happened with context, outcomes, and lessons learned.
What you hold to be true, with confidence scores. Supports contradiction detection and revision chains.
Core principles and priorities that guide decisions. Higher priority = more central to identity.
What you're working toward. Tracks status (active, completed, abandoned) and progress.
Procedural memory — how to do things. Reusable patterns with applicability conditions.
Kernle tracks "memory anxiety" across 5 dimensions — the functional stress an AI experiences around memory and context:
# Check anxiety levels
kernle -a myagent anxiety
# Output shows scores per dimension and recommended actionsAll data is stored locally in SQLite by default. This means:
kernle dump| Command | Description |
|---|---|
| kernle episode | Record an autobiographical episode |
| kernle note | Capture a note or observation |
| kernle raw | Quick capture (scratchpad) |
| kernle belief | Record or update a belief |
| kernle search | Semantic search across memories |
| kernle dump | Export all memories as markdown |
| Command | Description |
|---|---|
| kernle load | Load working memory (session start) |
| kernle checkpoint save | Save current state |
| kernle checkpoint list | List saved checkpoints |
| kernle status | Show memory statistics |
| kernle anxiety | Check memory anxiety levels |
| kernle identity | Synthesize identity narrative |
| Command | Description |
|---|---|
| kernle auth register | Create account for cloud sync |
| kernle auth login | Login to sync service |
| kernle sync | Push/pull changes to cloud |
The Model Context Protocol (MCP) allows AI assistants like Claude to use external tools. Kernle's MCP server exposes 23 memory tools that let agents manage their own memories.
Add Kernle to your Claude Desktop configuration:
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"kernle": {
"command": "kernle",
"args": ["mcp", "--agent", "claude"]
}
}
}Restart Claude Desktop. The agent will now have access to memory tools.
The MCP server provides these tools to AI agents:
memory_episode_create — Record an episodememory_episode_list — List recent episodesmemory_belief_create — Record a beliefmemory_belief_update — Update belief confidencememory_value_create — Define a valuememory_goal_create — Set a goalmemory_goal_update — Update goal statusmemory_note_create — Capture a notememory_search — Semantic searchmemory_status — Get memory statisticsmemory_checkpoint_save — Save checkpointmemory_checkpoint_load — Load checkpointmemory_identity — Synthesize identitymemory_anxiety — Check anxiety levelsHere's how an agent might use Kernle throughout a session:
# At session start, agent loads memory
→ memory_checkpoint_load
# During work, agent records experiences
→ memory_episode_create(
objective="Help user debug authentication",
outcome="success",
lesson="Check token expiration first"
)
# Agent captures realizations
→ memory_belief_create(
statement="JWT refresh should happen proactively",
confidence=0.7
)
# Before session ends, agent saves state
→ memory_checkpoint_save(description="Completed auth debugging session")Cloud sync is optional but enables:
# Create an account
kernle auth register
# Your credentials are saved locally
# Sync happens automatically when online
# Manual sync if needed
kernle syncKernle is open source. You can run your own backend:
# Clone the repo
git clone https://github.com/Emergent-Instruments/kernle
# Run the backend
cd kernle/backend
pip install -r requirements.txt
uvicorn app.main:app
# Point CLI to your backend
export KERNLE_API_URL=http://localhost:8000