Observed since 21 Oct, 09:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Open-source memory infrastructure for pi agents - inspired by Honcho. Provides peer representations, reasoning, and context assembly for stateful AI agents.
Open-source memory infrastructure for pi agents, inspired by Honcho.
Part of the 0xKobold ecosystem.
pi install npm:@0xkobold/pi-kobold
# pi-learn loaded as sub-extension automatically
pi install npm:@0xkobold/pi-learn
# Or in pi-config.ts
{
extensions: [
'npm:@0xkobold/pi-learn'
]
}
# Or temporary (testing)
pi -e npm:@0xkobold/pi-learn
┌─────────────────────────────────────────────────────────────┐
│ Pi-Learn │
├─────────────────────────────────────────────────────────────┤
│ Session Events │ SQLiteStore │ Reasoning Engine │
│ ──────────────── │ ───────────── │ ──────────────── │
│ • session_start │ • Workspaces │ • Message batch │
│ • before_agent │ • Peers │ • Conclusions │
│ • message_end │ • Sessions │ • Observations │
│ • turn_end │ • Messages │ • Peer cards │
│ │ • Conclusions │ • Summaries │
│ │ • Observations │ • Dreaming │
├─────────────────────────────────────────────────────────────┤
│ Ollama Integration │
│ ┌─────────────────┐ ┌─────────────────────────┐ │
│ │ Embeddings │ │ Reasoning Model │ │
│ │ nomic-embed- │ │ (configurable) │ │
│ │ text-v2-moe │ │ │ │
│ └─────────────────┘ └─────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Inspired by Honcho's hierarchical structure:
Messages flow through a full pipeline:
processed=falseBiographical cache:
Dreaming is background reasoning that synthesizes deeper insights:
Automatic data pruning:
| Command | Description |
|---|---|
/learn status | Show memory status |
/learn context | Show assembled context |
/learn config | Show configuration |
/learn enable | Enable reasoning |
/learn disable | Disable reasoning |
/learn dream | Trigger dream cycle |
/learn prune | Prune old data |
| Tool | Description |
|---|---|
learn_add_message | Add a message to memory |
learn_add_observation | Store raw observation for later reasoning |
learn_add_messages_batch | Batch add multiple messages |
learn_get_context | Retrieve assembled peer context |
learn_query | Search memory with embeddings |
learn_reason_now | Trigger immediate reasoning on unprocessed observations |
learn_trigger_dream | Manually trigger dreaming |
learn_get_peer_card | Get biographical info card |
learn_update_peer_card | Update peer card manually |
learn_list_peers | List all peers in workspace |
learn_get_stats | Get memory statistics |
learn_get_summaries | Get peer summaries |
learn_prune | Trigger retention pruning |
learn_search_sessions | Search sessions by keyword |
learn_get_session | Get specific session with messages |
learn_list_sessions | List all sessions |
learn_tag_session | Tag sessions for categorization |
{
"learn": {
"workspaceId": "default",
"reasoningEnabled": true,
"reasoningModel": "kimi-k2.5:cloud",
"embeddingModel": "nomic-embed-text-v2-moe:latest",
"tokenBatchSize": 1000,
"dream": {
"enabled": true,
"intervalMs": 3600000,
"minMessagesSinceLastDream": 5,
"batchSize": 50
},
"retention": {
"summaryRetentionDays": 30,
"conclusionRetentionDays": 90,
"retentionDays": 0
}
},
"ollama": {
"apiKey": "your-api-key"
}
}
Environment variables:
LEARN_REASONING_MODEL - Override reasoning modelLEARN_EMBEDDING_MODEL - Override embedding modelLEARN_TOKEN_BATCH_SIZE - Override token batch sizeOLLAMA_API_KEY - Override Ollama API keyLibrary functions are importable for programmatic use:
// Core modules
import { SQLiteStore } from "@0xkobold/pi-learn/core/store";
import { ReasoningEngine, type ReasonedConclusion } from "@0xkobold/pi-learn/core/reasoning";
import { ContextAssembler } from "@0xkobold/pi-learn/core/context";
// Shared types and utilities
import { cosineSimilarity, GLOBAL_WORKSPACE_ID } from "@0xkobold/pi-learn/shared";
// CLI renderers
import { renderStats, renderPeerCard } from "@0xkobold/pi-learn/renderers";
// Use vector search
const store = new SQLiteStore(dbPath);
const results = await store.searchSimilar(workspaceId, peerId, "query text", 10);
// Manual reasoning
const reasoningEngine = new ReasoningEngine(ollama, model);
const conclusions = await reasoningEngine.reasonOnObservations(workspaceId, peerId, observations);
// Auto-summarize at thresholds
const assembler = new ContextAssembler(store, ollama, model);
await assembler.autoSummarize(workspaceId, peerId, reasoningEngine);
Data is stored in SQLite at ~/.pi/memory/pi-learn.db:
-- Tables
workspaces, peers, sessions, messages,
observations, conclusions, summaries, peer_cards
-- Indexes for performance
idx_conclusions_peer, idx_conclusions_created,
idx_summaries_peer, idx_messages_session
Pi-learn requires Ollama running locally or via cloud:
nomic-embed-text-v2-moe:latest (required for semantic search)kimi-k2.5:cloud)# Pull required models
ollama pull nomic-embed-text-v2-moe:latest
# Pull your preferred reasoning model
ollama pull kimi-k2.5:cloud
@0xkobold/pi-kobold — Meta-extension that bundles this and other sub-extensions@0xkobold/pi-ollama — Ollama integration for pi agents@0xkobold/pi-persona — Scope-aware persona managementgit clone https://github.com/0xKobold/pi-learn
cd pi-learn
npm install
npm run build
pi install ./
See CHANGELOG.md for version history.
MIT
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Public sponsor counts have not been collected. These signals belong to the repository owner.
github · 1 observations shown. Missing days are unknown.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-22 | 0 | 2026-10-22T13:25:06.0686764Z |
Observed since 21 Oct, 09:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:fa9f40bc9e470997bfe7b02a1b6acf8227903306cb65b3b120c11f6aeec45552