mem
Persistent memory for AI agents
Key-value storage with tagging and full-text search, backed by SQLite. Let AI agents store and recall facts across sessions.
Features
- Key-value storage with tagging
- Full-text search across stored memories
- SQLite-backed - no external dependencies
- Store, recall, list, and forget operations
- MCP server and CLI modes
Install
go install github.com/hegner123/mem@latestThe Problem: AI agents forget everything between sessions
# Session 1: "The database is on port 5431, not 5432"
# Session 2: "What port is the database on?"
# Agent: "Typically 5432" - WRONG
#
# Context windows reset. Conversation history is gone.
# Important facts must be rediscovered every time.Solution
$ mem store --key "db-port" --value "PostgreSQL runs on port 5431 (non-standard)" --tags "database,config"Output
{"stored":true,"key":"db-port","tags":["database","config"]}Comparison
| Metric | Value |
|---|---|
| Storage | SQLite - zero setup |
| Retrieval | Key lookup + full-text search + tag filtering |
| Persistence | Survives across all sessions |