# Repository Briefing: tigerless-labs/agent-memory
> Source: https://repoforai.com/repo/tigerless-labs/agent-memory (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/tigerless-labs/agent-memory
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B+ (72/100 · Maintenance 31/35 · Adoption 15/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: CLI, MCP, Local AI, Self-Hosted
- **Momentum**: 4,052 ★ total (+1 24h / +218 7d) · 197 forks
- **Topics**: `agent-memory`, `ai-agents`, `claude-code`, `codex`, `llm`, `local-first`, `long-term-memory`, `markdown`, `mcp`, `python`, `retrieval`, `sqlite`
- **When to Use**: Best for: Developers and teams sharing one local store across agent hosts who want inspectable memories, ranked recall, and scheduled consolidation. Skip if: You need a managed multi-tenant memory service, cannot retain raw transcripts, or require air-gapped automated distillation without a verified offline reasoner.

## Overview
```text
### Architecture & Core Mechanics
agent-memory is a Python 3.12+ uv workspace. The root project depends on the core, CLI, and adapter packages; MCP, executor, harness, vector, and CJK features are exposed as extras. Each memory is a Markdown file under `<type>/<group>/<name>.md`, with schema fields, validity, links, and provenance in frontmatter. Session-start hooks inject `MEMORY.md`. Ranked recall runs locally over a rebuildable SQLite FTS5 projection with BM25 and optional reciprocal rank fusion (RRF) of vector results. Links live in files, not in a separate graph database.

At conversation boundaries, hooks copy the trace before distillation. The reasoner gets a narrow toolkit: `recall`, `read`, and `submit_operations`. Endpoint mode uses native function calling; headless host mode runs a separate process per batch by default and serves those tools over stdio MCP. Sleep runs on a separate schedule to consolidate the store. `.index/` is disposable, whereas `.state/` carries runtime state such as the distillation watermark and write lock.

### Key Capabilities & Differentiators
Recall defaults to eight hits, each with a one-line abstract, path, anchor, and score. An agent can open just the outline or matching section, read the full file, or use `mem trace` for cited evidence. Integrations include Claude Code, Codex CLI, Hermes, and Muse Code; Muse native mode requires 1.4.4 or newer and caps a batch at eight model steps. Supersession preserves history for `mem recall --as-of`; sleep can add or update but can only propose deletion. Chinese text needs the `cjk` extra for jieba segmentation, with optional vectors such as `BAAI/bge-small-zh-v1.5` for queries that share no terms.

In a bounded LongMemEval-S study, agent-memory scored 127/240 (52.9%) versus MemCore’s 86/240 (35.8%); the no-memory baseline was 7/120 (5.8%). The haystack was capped at 12 sessions per episode, so this is an end-to-end result, not a standard LongMemEval score or an isolated retrieval comparison. A separate interoperability check passed all nine ordered writer/reader pairings across Claude Code, Codex CLI, and Hermes.

### Trade-offs & Limitations
Compared with plain Markdown plus `grep`, this adds ranked recall, unattended capture, and historical queries, but also introduces hooks, an index to sync, and scheduled maintenance to monitor. Compared with a vector-first or graph-backed memory system, stable paths make hits easier to inspect and migrate, while file links provide navigation without a separate graph engine. The default ASCII lexical path is inadequate for Chinese body text; CJK segmentation helps, but paraphrases without shared terms may need vectors. The MemCore result does not establish large-corpus scaling or show whether writing or retrieval drove the gain.

Local recall is not the same as an offline write pipeline. A hosted reasoner can receive session-derived content, and enabling raw review evidence can send cited historical messages. Full trace retention protects against missed distillation but increases storage and privacy obligations. In Codex, CLI recall can need explicit write access for the access log even when hooks already work; setup does not silently broaden the sandbox. Back up the store and its runtime state, not just the current memory files.

### Hardware & Deployment Guide
Install from a checkout with Python 3.12+ and uv: `uv sync --all-packages` provides `mem`, `mem-mcp`, and `mem-hook`. There is no listed GitHub release or PyPI publication. Start with `mem init`; the default store is `~/agent-memory-store`. Point each host at the same store using `AGENT_MEMORY_STORE`, then run `mem setup --host ...`; add `--mcp` if the host needs the MCP integration. `mem doctor` runs a minimal live reasoner check by default. `--no-live` can inspect configuration offline but does not certify readiness.

Default lexical recall is local and needs no provider key. Automated reasoning may use host credentials or a configured endpoint. `mem cron install` can schedule maintenance where the current user has a working crontab; use absolute store and binary paths, and keep environment-only secrets in a private mode-600 `--env-file` rather than in the crontab. Start sizing from retained traces, index size, and concurrent reasoner batches. If enabling vectors, measure indexing and query costs with the selected model before rolling it out.
```

## Key Capabilities
```text
- Storage: Markdown is authoritative; SQLite `.index/` can be rebuilt, but `.state/` holds the write lock and distillation watermark.
- Retrieval: FTS5/BM25 returns paths, anchors, abstracts, and scores; optional vectors join the ranking through RRF.
- Write path: Session hooks archive traces first; the distillation reasoner works through `recall`, `read`, and `submit_operations`.
- Lifecycle management: `mem sleep` consolidates separately from capture; deletion requires confirmation and `recall --as-of` resolves historical validity.
- Chinese retrieval: The `cjk` extra adds jieba segmentation; changing the tokenizer triggers a full index rebuild on the next sync.
- Host setup: `mem setup` preserves unrelated settings, stops on conflicts, and checks readiness rather than treating a config write as success.
```

## Quick Start / Clone
```bash
git clone https://github.com/tigerless-labs/agent-memory.git
cd agent-memory
uv sync --all-packages
```
