| 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)
- Auto-capture - PostToolUse hook logs errors automatically
- Framework-agnostic - Works with any Python agent, not locked to Claude
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