# A-MEM: Self-Evolving Memory for Coding Agents

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/diaaaj-a-mem-mcp
Generated for open source discovery and AI-assisted research.

A-MEM is an innovative self-evolving memory system designed for coding agents, organizing knowledge into a dynamic Zettelkasten-style graph. It allows memories to evolve and connect over time, enhancing an agent's ability to recall and utilize information effectively. This system offers both semantic and structural search capabilities for a richer knowledge base.

GitHub: https://github.com/DiaaAj/a-mem-mcp
OSRepos URL: https://osrepos.com/repo/diaaaj-a-mem-mcp

## Summary

A-MEM is an innovative self-evolving memory system designed for coding agents, organizing knowledge into a dynamic Zettelkasten-style graph. It allows memories to evolve and connect over time, enhancing an agent's ability to recall and utilize information effectively. This system offers both semantic and structural search capabilities for a richer knowledge base.

## Topics

- Python
- AI
- LLM
- Agentic Memory
- Knowledge Graph
- Coding Agents
- ChromaDB

## Repository Information

Last analyzed by OSRepos: Mon Aug 17 2026 12:16:48 GMT+0100 (Western European Summer Time)
Detail views: 0
GitHub clicks: 1

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction
A-MEM is an innovative self-evolving memory system specifically designed for coding agents. Unlike traditional vector stores, A-MEM automatically organizes knowledge into a dynamic Zettelkasten-style graph, where memories don't just get stored, they evolve and connect over time. This system aims to provide agents with a more intelligent and interconnected knowledge base, improving their ability to recall and utilize information effectively.

## Installation
Getting started with A-MEM is straightforward. You can install it via pip and integrate it with MCP-compatible agents like Claude Code.

First, install the `a-mem` package:
bash
pip install a-mem


Then, add it to your Claude Code environment:
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-...

A session-start hook will automatically install, prompting Claude to use the memory system.

## Examples
A-MEM exposes several tools for coding agents and can also be used directly via its Python API.

**Agent Tool Usage (Conceptual)**:
python
# Store a memory (returns task_id immediately)
add_memory_note(content="Auth uses JWT in httpOnly cookies, validated by AuthMiddleware")

# Search later
search_memories(query="authentication flow", k=5)

# Deep search with connections
search_memories_agentic(query="security", k=5)


**Python API Usage**:
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")

# Search
results = memory.search("database patterns", k=5)

# Read full details
note = memory.read(memory_id)
print(note.keywords, note.tags, note.links)


## Why Use A-MEM?
A-MEM offers several compelling features that enhance the capabilities of coding agents:

*   **Self-Evolving Memory**: Memories are not static. When new knowledge is added, A-MEM automatically finds related memories, strengthens connections, updates context, and evolves tags, creating a dynamic knowledge graph.
*   **Semantic + Structural Search**: It combines vector similarity with graph traversal, allowing agents to find memories by meaning and then explore their interconnected relationships for deeper insights.
*   **Peek and Drill**: This feature enables efficient token usage by first capturing relevant memories via lightweight metadata (ID, context, keywords, tags) using breadth-first search. Agents can then drill depth-first into specific memories for full content, maximizing recall while minimizing token costs.

## Links
*   **GitHub Repository**: [https://github.com/DiaaAj/a-mem-mcp](https://github.com/DiaaAj/a-mem-mcp)
*   **PyPI**: [https://pypi.org/project/a-mem/](https://pypi.org/project/a-mem/)