| name | memory |
| description | Persistent long-term memory system with beliefs, predictions, and knowledge graphs. Use for remembering decisions, learnings, and patterns across sessions. |
AI-IQ Memory System
Give your AI persistent memory that survives across sessions. Built on SQLite with hybrid search (keyword + semantic + graph).
When to Use
Use AI-IQ memory when you need to:
- Remember decisions: "Why did we choose React over Vue?"
- Track learnings: "Redis needs network_mode: host for Docker"
- Store preferences: "User prefers dark mode"
- Record errors: "API timeout bug fixed by increasing connection pool"
- Manage beliefs: "TypeScript adoption will improve code quality (confidence: 0.8)"
- Track predictions: "New feature will reduce support tickets by 20%"
Core Commands
All commands use the memory-tool CLI (installed with pip install ai-iq).
Adding Memories
memory-tool add learning "Redis needs network_mode: host in Docker" --project MyApp
memory-tool add decision "Chose PostgreSQL over MongoDB" --tags database,architecture --priority 8
memory-tool add pending "Review PR #123" --expires 2026-04-10
memory-tool add learning "Fixed CORS by adding credentials: true" --related 42 --project MyApp
Categories: project, decision, preference, error, learning, pending, architecture, workflow, contact
Priority: 0-10 (default: 5). Higher = more important.
Searching Memories
memory-tool search "docker networking"
memory-tool search "docker networking" --semantic
memory-tool search "docker networking" --keyword
memory-tool search "docker networking" --full
memory-tool get 42
Filtering & Listing
memory-tool list --project MyApp
memory-tool list --category decision
memory-tool list --stale
memory-tool list --expired
memory-tool pending
Updating & Deleting
memory-tool update 42 "Redis needs network_mode: host AND restart: always"
memory-tool delete 42
memory-tool merge 42 43
memory-tool supersede 42 43
Beliefs & Predictions
Track hypotheses and validate them over time.
memory-tool believe "TypeScript will improve code quality" --confidence 0.8 --project MyApp
memory-tool predict "New auth flow will reduce support tickets by 20%" --based-on 42 --confidence 0.7 --deadline 2026-05-01 --expect "Support tickets < 50/week"
memory-tool resolve 15 --confirmed "Support tickets dropped to 35/week"
memory-tool resolve 15 --refuted "Support tickets stayed at 80/week"
memory-tool beliefs
memory-tool beliefs --weak
memory-tool beliefs --strong
memory-tool beliefs --conflicts
memory-tool predictions --open
memory-tool predictions --confirmed
memory-tool predictions --refuted
memory-tool predictions --expired
Knowledge Graph
Entities and relationships for context-aware retrieval.
memory-tool graph add project "MyApp" "E-commerce platform"
memory-tool graph add person "Alice" "Senior developer"
memory-tool graph add feature "AuthFlow" "OAuth2 authentication"
memory-tool graph rel Alice works_on MyApp
memory-tool graph rel AuthFlow built_by Alice
memory-tool graph rel AuthFlow depends_on Redis
memory-tool graph fact MyApp language "TypeScript"
memory-tool graph fact MyApp status "production"
memory-tool graph get MyApp
memory-tool graph spread AuthFlow 2
memory-tool graph link 42 Redis
memory-tool graph auto-link
Focus (Context Loading)
Instantly load all context for a topic — memories, graph, pending items, beliefs, predictions.
memory-tool focus "whatsauction"
memory-tool focus "docker" --full
Focus pulls together:
- Top matching memories (hybrid search)
- Knowledge graph entity + facts + relationships
- Last session snapshot mentioning the topic
- Active runs in progress for the topic
- Pending TODOs for the topic
- Beliefs and predictions
- Suggested next actions
Use this at the start of a session to get up to speed on any topic.
Maintenance
memory-tool next
memory-tool dream
memory-tool conflicts
memory-tool stale
memory-tool hot
memory-tool snapshot "Added authentication, fixed CORS bug"
memory-tool auto-snapshot
memory-tool decay
memory-tool gc 180
memory-tool reindex
memory-tool backup
memory-tool restore /root/backups/memory/memories_20260402.db
memory-tool stats
Python API
For programmatic access in Python agents:
from ai_iq import Memory
memory = Memory()
memory.add("User prefers dark mode", category="preference", tags=["ui"])
results = memory.search("dark mode")
for r in results:
print(f"#{r['id']}: {r['content']}")
memory.update(1, "User STRONGLY prefers dark mode")
memory.delete(1)
memory.believe("TypeScript improves quality", confidence=0.8)
memory.predict(
prediction="Auth flow reduces tickets by 20%",
based_on=[42],
confidence=0.7,
deadline="2026-05-01",
expected_outcome="Tickets < 50/week"
)
memory.graph_add_entity("project", "MyApp", "E-commerce platform")
memory.graph_relate("Alice", "works_on", "MyApp")
memory.graph_set_fact("MyApp", "language", "TypeScript")
See PYTHON_API.md for complete API reference.
Key Features
- Single SQLite file - No servers, no setup, fully portable
- Hybrid search - FTS5 keyword + sqlite-vec semantic + graph traversal
- Memory decay - FSRS-6 algorithm (like human memory)
- Beliefs & predictions - Track confidence, validate hypotheses
- Knowledge graph - Entities, relationships, spreading activation
- Dream mode - AI-powered consolidation (REM sleep for memory)
- Memory tiers (v6) - Working / Episodic / Semantic promotion paths with different search weights
- W3C Verifiable Credentials (v6) - Ed25519-signed passports proving competence in 8 domains
- Capability-based access control (v6) - Wing/room namespaces, deny-by-default memory gating
- Drift detection (v6) -
validate scan/confirm/refute catches reinforced bad memories
- Auto-capture - PostToolUse hook logs errors automatically
- Framework-agnostic - Works with any Python agent, not locked to Claude
v6 Commands: Memory → Evaluation → Credential → Access Control
AI-IQ v6 is more than a memory system. It's a pipeline for building trustworthy AI agents:
1. Memory Tiers
Memories are classified into working (hot, recent), episodic (event-based), and semantic (validated truths). Promoted via dream mode. Search ranking weights differ per tier (1.2x / 1.0x / 0.8x).
memory-tool dream
memory-tool stats
2. Drift Detection (Validation)
Catches memories that got reinforced despite being wrong:
memory-tool validate scan --min-access 3 --min-age-days 30
memory-tool validate confirm <id> --notes "verified from logs"
memory-tool validate refute <id> --notes "this is wrong, X is correct"
memory-tool validate report
3. Passport (W3C Verifiable Credentials)
Agents earn competence credentials through proof-of-work (runs table). Ed25519-signed, W3C-compliant. 8 domains: code, devops, security, testing, documentation, research, planning, monitoring.
from ai_iq.passport_w3c import Passport
p = Passport(agent_id="alice")
credential = p.issue_credential("code", proof_count=50)
verified = p.verify_credential(credential)
4. Access Control (Wing/Room Namespaces)
Memories live in wings (broad categories) and rooms (specific contexts). Access is capability-based, deny-by-default. 5 predefined rules: finance.payments, security.secrets, devops.production, code.internal, general.public.
memory-tool add learning "Secret key rotation procedure" --wing security --room secrets
MEMORY_PASSPORT="<credential>" memory-tool search "rotation"
memory-tool search "rotation" --wing security --room secrets
The Pipeline in One Flow
1. Agent does work → runs table tracks outcomes
2. AI-IQ stores memories → classified into tiers
3. Dream mode promotes validated memories → semantic tier
4. Passport issues credentials ← proof-of-work from runs
5. Credential grants access ← to wing/room namespaces
6. Another agent presents credential → gets scoped memory access
This is what makes AI-IQ more than a memory system: the full chain from remembering to proving you're trustworthy to gating sensitive memory access.
Installation
pip install ai-iq
pip install ai-iq[full]
Examples
See examples/ for:
- Chatbot with memory
- Knowledge base builder
- Decision tracker
- Learning journal
Differentiators vs claude-mem
- Portable: Single SQLite file, not tied to Claude Code
- Beliefs & predictions: Track confidence, validate over time
- Knowledge graph: Entities, relationships, spreading activation
- Python API: Use in any Python agent (
from ai_iq import Memory)
- Dream mode: AI-powered consolidation and conflict detection
- Framework-agnostic: Works with Claude, OpenAI, local models, etc.
Documentation