agentmem
Lightweight persistent memory for AI agents, stored in a single SQLite file
- Pricing
- Open source
- Platforms
- CLI, API, self-hosted
- Version
- 0.3.0
- Listing updated
- today
Similar MCP servers
About agentmem
agentmem is an open-source MCP server for knowledge and memory. It is available on CLI, API and self-hosted.
The README says agentmem gives an agent memory that survives between sessions, which matters because context windows compress and conversations end. Everything is kept in one SQLite file, with hybrid retrieval that combines FTS5 keyword search and vector similarity, plus a recency boost for newer entries.
Memories are sorted into five tiers: permanent core facts, procedural behavioral rules, learned knowledge, episodic events, and working state that expires after 24 hours. Namespaces let several users or agents keep their memories separate, and update_memory keeps a version chain so earlier versions of a fact can still be traced.
The package runs in several modes, from pure Python with no dependencies up to a 12MB install with embedding models. It can be used as an MCP server over stdio, through a built-in HTTP REST API, from a Python API, or from a CLI. Developers building agents who want memory without a PyTorch stack or a hosted service are the intended audience.
Tools this server provides (16)
Taken from the project documentation; the running server may differ.
- recall
- Hybrid keyword and semantic search.
- remember
- Store a new memory.
- save_state
- Emergency save before context compression.
- today
- Get all memories from today.
- forget
- Archive a memory (soft delete).
- unarchive
- Restore an archived memory.
- stats
- Memory statistics and health.
- compact
- Archive low-value memories.
- consolidate
- Merge near-duplicate memories.
- update_memory
- Replace a memory with a version chain.
- history
- Trace fact version history.
- related
- Find memories by entity.
- entities
- List all extracted entities.
- get_procedures
- Get behavioral rules for system prompt.
- add_procedure
- Add a behavioral rule.
- process_conversation
- Auto-extract from chat history.
What it does
- Hybrid keyword and semantic search
- Combines FTS5 BM25 keyword matching with vector similarity and adaptive ranking for recall.
- Single-file SQLite storage
- All memories, entities and vectors live in one database file with WAL enabled.
- Tiered memory model
- Core, procedural, learned, episodic and working tiers, with working memory expiring automatically.
- Temporal fact versioning
- Updating a memory archives the old version and links the chain so its history can be traced.
- Automatic entity extraction
- Regex-based extraction of mentions, URLs, IPs, ports, emails, env vars, money amounts, paths and hashtags.
- Multiple access interfaces
- Offers 16 MCP tools, a 14-endpoint HTTP REST API, a Python API and a command-line interface.
Good for
- Giving a coding or support agent memory that persists across sessions
- Saving working state before an agent's context window is compressed
- Isolating memories per user or per project in a multi-agent setup
- Tracking how a fact, such as a price or config value, changed over time
- Storing behavioral rules that get injected into an agent's system prompt
Pricing
Open source
Free and open source under MIT; self-hosted.
agentmem FAQ
What does agentmem store memories in?
Memories are stored in one SQLite file, using FTS5 for keyword search and an optional vector index for semantic search.
Does it need a cloud service or PyTorch?
The README says it needs no cloud and no PyTorch. A zero-dependency pure Python mode is available using only the standard library.
Which MCP tools does it expose?
The README lists 16 MCP tools, including recall, remember, save_state, compact, consolidate, entities and process_conversation.
What license is it under?
The README states the project is released under the MIT license.
Is agentmem free?
Yes. agentmem is open source, so you can use and self-host it for free.
What are the best alternatives to agentmem?
The closest alternatives to agentmem are Total Agent Memory, MCP Memory, Compound Memory, Agent Memory MCP and amem.
Where this comes from
- Description: written from the project's README and its MCP Registry entry.