← Back to Leaderboard
AWujiangXu

WujiangXu/A-mem

Linked-note memory for retrieving and updating an LLM agent’s conversation history

View on GitHub ↗
RAG & Data ToolQuickstart ↓
Engineering Health (Methodology)
B+ · 68/100
Maintenance Activity
● Updated 1mo ago
Latest Release
Rolling commits (main)
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance26/35
Fork Adoption16/25
Release Cadence6/20
License Clarity20/20
CLIAPILocal AI
Total Stars
★ 1,019
24h Growth
+0
7d Growth
+2
Forks
120

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

WujiangXu/A-mem Star History (2025-02-17 - 2026-12-04) ALL-TIME STAR HISTORY (2025-02 – 2026-12) +1k in 655d · avg +2/day 1.1k 538 0 2025-02-17: ★ 12025-03-29: ★ 3612025-05-10: ★ 4042025-06-21: ★ 4482025-08-02: ★ 4842025-09-13: ★ 5352025-10-25: ★ 6242025-12-06: ★ 7012026-01-17: ★ 7442026-02-28: ★ 7902026-04-11: ★ 8412026-05-23: ★ 8802026-07-04: ★ 9042026-08-15: ★ 9372026-09-26: ★ 9702026-11-05: ★ 1,0092026-12-04: ★ 1,019 ★ 1k 2025-02 2026-01 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

A-Mem is a Python research memory layer for LLM agents. When new content arrives, it generates a structured note with contextual descriptions and tags, looks for related historical memories, and links them by similarity. Existing notes can also be refined, so the memory state is not simply an append-only collection of conversation chunks.

The tree separates the memory layer (memory_layer.py, memory_layer_robust.py), LLM text parsing (llm_text_parsers.py), and dataset loading (load_dataset.py) from the evaluation entrypoints. The manifest includes Sentence Transformers, PyTorch, scikit-learn, and rank-bm25, but those dependencies alone do not establish how retrieval scores are combined. The visible integration boundary is Python code plus model-backend selection, not a standalone database service or a verified plugin protocol.

Key Capabilities & Differentiators

The original evaluator, test_advanced.py, requires OpenAI JSON schema support. test_advanced_robust.py removes that requirement and provides three backend choices: OpenAI, vLLM, and Ollama. The concrete examples use gpt-4o-mini, Qwen/Qwen2.5-3B-Instruct behind vLLM, and qwen2.5:3b through Ollama, with results written to a specified JSON file.

The LoCoMo run covers multi-hop, temporal, open-domain, single-hop, and adversarial QA. --ratio selects a dataset fraction, while --retrieve_k controls how many memories are retrieved per query and defaults to 10. run_k_sweep.sh reuses memories cached after the first pass and reruns QA, making retrieval depth tunable without rebuilding notes for each setting. That sweep does not measure memory construction cost, and no numerical result table is available for quantifying gains.

Trade-offs & Limitations

Compared with append-only vector memory, A-Mem tests a different design choice: give retrieved items structured context and links, and let later evidence change earlier notes. That may help recover relationships that isolated chunks miss, but it adds generation and update work on ingestion. It also makes the memory state sensitive to model output and ingestion order, so comparisons should hold both constant.

The repository is a fit for evaluating memory policy, not a drop-in replacement for a vector database or managed memory service. The supplied interface does not establish durability guarantees, concurrent writes, tenant isolation, or a versioned service API. Choose simpler vector retrieval for a low-complexity baseline, and evaluate A-mem-sys if the goal is to build an agent around this design. MIT permits commercial reuse of the code subject to its notice requirements; models and datasets need separate review.

Hardware & Deployment Guide

Set up a Python virtual environment or use the Conda example with Python 3.9, then install requirements.txt. For a first run, invoke test_advanced_robust.py with --dataset data/locomo10.json, the chosen --backend and --model, and a JSON --output path. OpenAI requires API access. For self-hosted generation, start the model service separately: the vLLM example uses an OpenAI-compatible server on port 30000, selected by --sglang_port 30000, with float16 and a configured maximum model length of 8192. Ollama requires the selected model to be available locally.

No container recipe, fixed hardware envelope, or tagged release is provided. Local serving capacity depends on the chosen model, context length, and concurrency; hosted generation does not eliminate local embedding and evaluation work. For reproducible runs, record installed package versions, model identifiers, retrieval depth, and cache state: the dependency list is unpinned, and cached runs do not exercise the same path as cold runs.

Memory representation: Generates structured notes with contextual descriptions and tags, links related memories, and supports revision.
Implementation entrypoints: Pairs memory_layer.py and memory_layer_robust.py with separate original and robust evaluation scripts.
Backend boundary: Original evaluation depends on OpenAI JSON schema support; the robust CLI accepts openai, vllm, and ollama.
Retrieval tuning: --retrieve_k defaults to 10, and run_k_sweep.sh reuses cached memories to rerun QA at different retrieval depths.
Evaluation scope: data/locomo10.json covers multi-hop, temporal, open-domain, single-hop, and adversarial QA.
Adoption boundary: MIT-licensed reproduction code; A-mem-sys is the designated implementation for building agents.
Best For

Reproducing A-Mem on LoCoMo and testing how linked, revisable notes affect historical QA across model backends and retrieval depths.

Skip If

You need a production multi-tenant memory API, a durable vector database, or a turnkey offline deployment.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

CLIAPILocal AI
# Create and activate virtual environment
python -m venv a-mem
source a-mem/bin/activate  # Linux/Mac
a-mem\Scripts\activate     # Windows

# Install dependencies
pip install -r requirements.txt

Comparison vs. Top RAG, Data & Memory Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
A-mem ★1k+2PythonMITLinked-note memory for retrieving and updating an LLM agent’s conversation histo
markitdown199.7k+909PythonMITPython library and CLI that turn mixed-format documents into Markdown for RAG in
Scrapling107.9k+1.8kPythonBSD-3-ClausePython HTTP and browser crawlers that turn websites into RAG-ready Markdown
mem070k+498PythonApache-2.0A vector-backed memory layer for AI agents that need to recall past conversation

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/WujiangXu/A-mem.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

WujiangXu/A-mem Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about A-mem

Where should I start if I want to integrate A-Mem into an agent?

Use memory_layer.py and memory_layer_robust.py to inspect memory behavior, then follow the corresponding evaluation entrypoint to see how retrieved notes feed into QA. For application integration, start with A-mem-sys. The API paths shown here connect the evaluator to model backends; they are not a standalone memory-service API.

How much RAM or GPU VRAM should I budget?

No fixed requirement is specified. Local generation depends on the model, serving backend, context length, and concurrency. The OpenAI route moves generation off-host, but the evaluator still has local embedding and scoring dependencies such as Sentence Transformers and BERTScore. Use a small --ratio for an initial sizing run.

Can I use this commercially and keep the workload self-hosted?

The repository uses MIT, which permits commercial use and modification subject to retaining the required copyright and license notices on redistribution. Check dataset, model, and dependency terms separately. For sensitive data, verify where requests go and how local caches and result files are handled before adopting either a hosted or self-hosted configuration.

When is A-Mem preferable to a vector store or append-only memory?

Choose A-Mem when the experiment is about whether structured notes, links, and revision improve historical QA. Choose append-only vector retrieval when you need a simpler baseline whose stored records are easier to trace. Use a dedicated vector database when the main requirement is durable, concurrent serving rather than testing a memory-update policy.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining WujiangXu/A-mem? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature WujiangXu/A-mem on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare