A Mem Mcp

io.github.DiaaAjPublished by GitHub account DiaaAjv0.2.1Updated Oct 24, 2026

Self-evolving memory system for AI agents

VerifiedSTDIODesktop onlyKnowledge & MemoryDeveloper Tools

Overview

AI-generated overview

A local MCP server that gives coding agents a self-evolving, graph-structured memory store for project knowledge.

What you can do
A-MEM stores notes that an assistant adds, using an LLM to extract keywords, context and tags, then links each new note to semantically similar existing memories and evolves those connections over time. It exposes eight tools: add_memory_note, search_memories, search_memories_agentic, search_memories_by_time, read_memory_note, update_memory_note, delete_memory_note and check_task_status. Search combines vector similarity with graph traversal, and a peek-then-drill pattern returns lightweight metadata first and full note content only on request. Memories persist in ChromaDB.
When to use it
Useful when a coding agent should remember decisions, conventions and context across sessions instead of re-deriving them. Best suited to Claude Code users who want per-project memory that grows and connects over time, rather than a plain vector store.
Requirements
Runs locally as a Python package (pip install a-mem) over stdio; desktop only. Needs an LLM backend, configured with LLM_BACKEND (openai, ollama, sglang or openrouter) and LLM_MODEL. OPENAI_API_KEY is required when LLM_BACKEND=openai; OpenRouter needs its own key. Optional settings include EMBEDDING_MODEL, CHROMA_DB_PATH and EVO_THRESHOLD. A session-start hook installs automatically in Claude Code.
Before you install
OPENAI_API_KEY (or an OpenRouter key) is passed in plain text through the MCP server configuration, so protect that config file. Note content is sent to the configured LLM backend for keyword, tag and context extraction, and embeddings may be computed locally or remotely depending on the embedding model. The server can update and delete stored memories, and memory is stored per project in ./chroma_db unless CHROMA_DB_PATH is changed.

Installation

In SourceWeft

  1. Open A Mem Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

A-MEM: Self-evolving memory for coding agents

[PyPI version] [PyPI downloads] [MCP Registry]

mcp-name: io.github.DiaaAj/a-mem-mcp

A-MEM is a self-evolving memory system for coding agents. Unlike simple vector stores, A-MEM automatically organizes knowledge into a Zettelkasten-style graph with dynamic relationships. Memories don't just get stored—they evolve and connect over time.

Currently tested with Claude Code. Support for other MCP-compatible agents is planned.

[Image]

Quick Start

Install

bash
pip install a-mem

Add to Claude Code

bash
claude mcp add a-mem -s user -- a-mem-mcp \  -e LLM_BACKEND=openai \  -e LLM_MODEL=gpt-4o-mini \  -e OPENAI_API_KEY=sk-...

That's it! A session-start hook installs automatically to remind Claude to use memory.

Note: Memory is stored per-project in ./chroma_db. For global memory across all projects, see Memory Scope.

Uninstall

bash
a-mem-uninstall-hook   # Remove hooks firstpip uninstall a-mem

How It Works

t=0              t=1                t=2
                 ◉───◉             ◉───◉ ◉               │                 ╱ │ ╲                 ◉                ◉──┼──◉                                     │                                     ◉
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━▶            self-evolving memory
  1. Add a memory → A-MEM extracts keywords, context, and tags via LLM
  2. Find neighbors → Searches for semantically similar existing memories
  3. Evolve → Decides whether to link, strengthen connections, or update related memories
  4. Store → Persists to ChromaDB with full metadata and relationships

The result: a knowledge graph that grows smarter over time, not just bigger.

Features

Self-Evolving Memory Memories aren't static. When you add new knowledge, A-MEM automatically finds related memories and strengthens connections, updates context, and evolves tags.

Semantic + Structural Search Combines vector similarity with graph traversal. Find memories by meaning, then explore their connections.

Peek and Drill Start with breadth-first search to capture relevant memories via lightweight metadata (id, context, keywords, tags). Then drill depth-first into specific memories with read_memory_note for full content. This minimizes token usage while maximizing recall.

MCP Tools

A-MEM exposes 8 tools to your coding agent:

ToolDescription
add_memory_noteStore new knowledge (async, returns immediately)
search_memoriesSemantic search across all memories
search_memories_agenticSearch + follow graph connections
search_memories_by_timeSearch within a time range
read_memory_noteGet full details (supports bulk reads)
update_memory_noteModify existing memory
delete_memory_noteRemove a memory
check_task_statusCheck async task completion

Example Usage

python
# The agent calls these automatically, but here's what happens:
# Store a memory (returns task_id immediately)add_memory_note(content="Auth uses JWT in httpOnly cookies, validated by AuthMiddleware")
# Search latersearch_memories(query="authentication flow", k=5)
# Deep search with connectionssearch_memories_agentic(query="security", k=5)

Advanced Configuration

JSON Config

For more control, edit ~/.claude/settings.json (global) or .claude/settings.local.json (project):

json
{  "mcpServers": {    "a-mem": {      "command": "a-mem-mcp",      "env": {        "LLM_BACKEND": "openai",        "LLM_MODEL": "gpt-4o-mini",        "OPENAI_API_KEY": "sk-..."      }    }  }}

Environment Variables

VariableDescriptionDefault
LLM_BACKENDopenai, ollama, sglang, openrouteropenai
LLM_MODELModel namegpt-4o-mini
OPENAI_API_KEYOpenAI API key—
EMBEDDING_MODELSentence transformer modelall-MiniLM-L6-v2
CHROMA_DB_PATHStorage directory./chroma_db
EVO_THRESHOLDEvolution trigger threshold100

Memory Scope

  • Project-specific (default): Each project gets isolated memory in ./chroma_db
  • Global: Share across projects by setting CHROMA_DB_PATH=~/.local/share/a-mem/chroma_db

Alternative Backends

Ollama (local, free)

bash
claude mcp add a-mem -s user -- a-mem-mcp \  -e LLM_BACKEND=ollama \  -e LLM_MODEL=llama2

OpenRouter (100+ models)

bash
claude mcp add a-mem -s user -- a-mem-mcp \  -e LLM_BACKEND=openrouter \  -e LLM_MODEL=anthropic/claude-3.5-sonnet \  -e OPENROUTER_API_KEY=sk-or-...

Hook Management (Claude Code)

The session-start hook reminds Claude to use memory tools. It installs automatically with Claude Code, but you can manage it manually:

bash
a-mem-install-hook     # Install/reinstall hooka-mem-uninstall-hook   # Remove hook completely

Python API

Use A-MEM directly in Python (works with any agent or application):

python
from agentic_memory.memory_system import AgenticMemorySystem
memory = AgenticMemorySystem(    llm_backend="openai",    llm_model="gpt-4o-mini")
# Add (auto-generates keywords, tags, context)memory_id = memory.add_note("FastAPI app uses dependency injection for DB sessions")
# Searchresults = memory.search("database patterns", k=5)
# Read full detailsnote = memory.read(memory_id)print(note.keywords, note.tags, note.links)

Research

A-MEM implements concepts from the paper:

A-MEM: Agentic Memory for LLM Agents Xu et al., 2025 arXiv:2502.12110

Source: README.md at commit dce0ac6

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.2.1LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts