# agentmem [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/oxgeneral/agentmem  
**GitHub Stars:** 10  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/agentmem

## Description
Lightweight persistent memory for AI agents. Hybrid search. 16 tools. One SQLite file.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "agentmem": {
    "command": "uvx",
    "args": ["agentmem-lite"]
  }
}
```

## Documentation

## What agentmem MCP server does

The agentmem MCP server stores agent memory in a SQLite file and makes that data available across sessions. It supports five memory tiers: `core` for permanent facts, `procedural` for behavioral rules, `learned` for discovered knowledge, `episodic` for events, and `working` for short-lived task state. Working memories expire after 24 hours by default; learned and episodic memories can be compacted after 90 days.

Search combines SQLite FTS5 keyword matching with vector similarity, then applies adaptive ranking and an optional recency boost. The package can use a best-quality embedding setup, a smaller hash-based setup, or a standard-library-only mode. It also supports namespace filtering for separate users, agents, or projects.

## How it works

The agentmem MCP server runs as a stdio process and reads or writes the configured SQLite database. Start it with `python -m agentmem --db memory.db`, then point an MCP client at that command and database path. A single database can hold memories in multiple namespaces, with prefix matching available when recalling data.

Each stored memory can be updated through a supersedes chain rather than silently overwritten. The history operation follows those versions. Regex-based extraction identifies entities such as URLs, IP addresses, ports, email addresses, environment variables, paths, mentions, hashtags, and money amounts. Conversation processing can extract facts, decisions, TODOs, configuration values, and preferences from supplied chat messages without using an LLM.

## Setup and configuration

Install the package with one of the available dependency profiles:

- `pip install agentmem-lite[all]` for sqlite-vec and model2vec support.
- `pip install agentmem-lite` for sqlite-vec with hash embeddings.
- `pip install agentmem-lite --no-deps` for the standard-library-only mode.
- `pip install -e ".[all]"` when installing from a source checkout.

The MCP launch command accepts the database location through `--db`. The same package includes a CLI for initialization, imports, searching, maintenance, conversation processing, statistics, and export. An optional HTTP service can be started with `agentmem serve-http --port 8422` or the `agentmem-http` command; it provides REST endpoints and CORS support.

## Tools and capabilities

The agentmem MCP server exposes these tools:

- `remember`, `recall`, and `save_state` for writing, searching, and preserving current task state.
- `today`, `forget`, `unarchive`, and `stats` for retrieval and memory administration.
- `compact` and `consolidate` for archiving old low-value entries and merging near duplicates.
- `update_memory` and `history` for tracking changing facts.
- `related` and `entities` for entity-based discovery.
- `get_procedures` and `add_procedure` for behavioral rules.
- `process_conversation` for extracting memory from chat history.

The Python API also imports Markdown files, while the REST interface exposes 14 endpoints corresponding to most of these operations.

## Limitations and notes

Semantic search quality depends on the selected embedding backend, while the zero-dependency mode uses no external embedding package. Working-memory expiration and other cleanup behavior require the relevant maintenance operations or configured defaults. The MCP interface is documented for stdio; HTTP is provided separately as a REST API.

_Full upstream README: https://allmcps.com/mcp/agentmem/readme_

