| name | botmem |
| description | Persistent structured memory for LLM agents using botmem CLI. Use when storing, retrieving, or managing agent memory — facts, knowledge graph relationships, conversation summaries, and context blocks. Use for memory recall, ingestion of conversation content, knowledge graph queries, and exporting full context for prompt injection. |
botmem — Persistent LLM Memory
CLI tool providing four memory types: blocks (working memory), archival (long-term facts), knowledge graph (entity relationships), and conversation summaries.
Prerequisites
botmem binary on PATH (go install github.com/stukennedy/botmem@latest)
- Configured via
botmem init (supports Claude Code CLI, Anthropic API, or Ollama)
- Config at
~/.botmem/config.yaml, DB at ~/.botmem/botmem.db
Commands
Memory Blocks (working memory — always-on context)
botmem block set <label> <content>
botmem block get <label>
botmem block list [type]
botmem block delete <label>
Archival Memory (long-term facts with FTS5 search)
botmem archive add <text> --tags tag1,tag2
botmem archive search <query>
botmem archive list [--tag tag]
Knowledge Graph (entity-relationship triplets)
botmem graph add <subject> <predicate> <object>
botmem graph query <entity>
botmem graph search <predicate>
botmem graph entities [type]
Conversation Summaries (hierarchical)
botmem summary add <text> [--level N]
botmem summary list [--level N]
Context Export (full memory dump for prompt injection)
botmem context
Ingest (LLM-powered extraction from conversation text)
botmem ingest <text>
echo <text> | botmem ingest
Ingest requires a configured LLM provider. It automatically:
- Updates memory blocks (human, persona, context)
- Extracts tagged facts → archival
- Extracts entity-relationship triplets → knowledge graph
- Generates conversation summary
Integration Patterns
Session Start — Load Context
Run botmem context and include the JSON in system prompt for full memory recall.
After Important Conversations — Ingest
Summarise the conversation and pipe to botmem ingest to automatically extract and store structured memories.
Ad-hoc Recall — Query
Use botmem graph query <entity> or botmem archive search <term> for targeted recall.
Periodic Maintenance
Use botmem block set context <current situation> to keep working memory current.
Custom DB Path
All commands accept --db <path> to use a different database file. Useful for per-agent or per-project memory stores.