# Best open-source AI repos for long-term memory for AI agents (2026)

Source: https://dedupedai.com/best-ai-repos-for/agent-memory/ (Deduped, updated 2026-10-27). Markdown twin of the page; JSON: https://dedupedai.com/best-ai-repos-for/agent-memory/index.json

## What is the best open-source memory system for AI agents?

The best open-source AI repos for long-term memory for AI agents right now are Claude Mem, Hindsight and TencentDB Agent Memory. Claude-Mem is the most starred plug-in memory for coding agents; Hindsight is a general agent memory you call from code; ai-memory and Obsidian Mind keep memory as markdown files you can read and edit.

## Comparison

| Repo | What it does | Best for | Stars | Language |
|---|---|---|---|---|
| [Claude Mem](https://dedupedai.com/use-cases/thedotmack-claude-mem/) (thedotmack/claude-mem) | Claude-Mem is a persistent memory system that captures what coding agents do in a session, compresses it with AI, and injects relevant context back into later sessions. | Developers who run Claude Code, Codex, OpenCode, or OpenClaw on the same projects over many sessions and lose context between them. | 101,511 | TypeScript |
| [Hindsight](https://dedupedai.com/use-cases/vectorize-io-hindsight/) (vectorize-io/hindsight) | Hindsight is an open-source agent memory system focused on agents that learn, not just recall chat history. | Developers building assistants or agents that should remember users and past work across sessions. | 53,493 | Python |
| [TencentDB Agent Memory](https://dedupedai.com/use-cases/tencentcloud-tencentdb-agent-memory/) (TencentCloud/TencentDB-Agent-Memory) | A team-level memory server for AI agents that stores chat memory, skills, wiki pages, and code graphs, and shares them across agents and frameworks. | Developers and small teams who run several AI coding agents and want them to share project context, skills, and code knowledge. | 29,677 | TypeScript |
| [AI Memory](https://dedupedai.com/use-cases/akitaonrails-ai-memory/) (akitaonrails/ai-memory) | ai-memory is a Rust tool that gives AI coding agents a shared long-term memory, stored as a git-backed markdown wiki, so work can be handed off between agent CLIs and machines. | Developers who switch between AI coding agents or machines and want the next agent to resume without re-explaining the project. | 12,634 | Rust |
| [Obsidian Mind](https://dedupedai.com/use-cases/breferrari-obsidian-mind/) (breferrari/obsidian-mind) | Obsidian Mind is an Obsidian vault template that gives AI coding agents persistent memory through hooks, slash commands and optional local QMD semantic search, built for Claude Code with hooks for Codex CLI and Gemini CLI. | Developers and engineering managers who want their coding agent to remember goals, people, decisions and wins across sessions. | 5,373 | TypeScript |
| [Agent Memory](https://dedupedai.com/use-cases/tigerless-labs-agent-memory/) (tigerless-labs/agent-memory) | agent-memory is a Python runtime that gives AI agents long-term memory stored as plain Markdown files, with local ranked retrieval and a sleep-time consolidation layer, and Claude Code and Codex share one store. | Developers who use Claude Code or Codex across many sessions and want decisions and context to carry over without an API key. | 4,732 | Python |
| [Context Mode](https://dedupedai.com/use-cases/mksglu-context-mode/) (mksglu/context-mode) | Context Mode is an MCP server and hook set for AI coding agents that keeps raw tool output out of the context window, persists session memory in SQLite, and routes work across many clients. | Developers who use AI coding agents on large codebases and notice their context window filling up during long sessions. | 31,762 | TypeScript |
| [Lemmalog](https://dedupedai.com/use-cases/jordyzomer-lemmalog/) (JordyZomer/lemmalog) | Lemmalog is a Rust Datalog engine that gives LLM agents a deductive memory, exposed as an MCP server, a headless CLI, a REPL and an agent skill. | Developers who run Claude Code or another MCP-capable agent on long tasks and want its facts and derived conclusions kept in a queryable, provenance-tracked store. | 341 | Rust |

## When to pick which

### Claude Mem (thedotmack/claude-mem)

Claude-Mem is a persistent memory system that captures what coding agents do in a session, compresses it with AI, and injects relevant context back into later sessions.

Best for: Developers who run Claude Code, Codex, OpenCode, or OpenClaw on the same projects over many sessions and lose context between them.

Needs: Node.js 20.0.0 or higher; Claude Code with plugin support, or a supported agent host such as OpenCode or T3 Code; A claude-mem sign-in or your own memory provider key, if you do not use the installer's local option; Bun and uv, which the README says are auto-installed if missing.

Start here: [Carry Claude Code project context into new sessions](https://dedupedai.com/use-cases/thedotmack-claude-mem/resume-claude-code-project-context/) (Intermediate, 15 minutes)

1. In Claude Code, run /plugin marketplace add thedotmack/claude-mem
2. Run /plugin install claude-mem
3. Restart Claude Code
4. Start a new session in the same project and check that context from the previous session appears

All 4 use cases: https://dedupedai.com/use-cases/thedotmack-claude-mem/ | GitHub: https://github.com/thedotmack/claude-mem

### Hindsight (vectorize-io/hindsight)

Hindsight is an open-source agent memory system focused on agents that learn, not just recall chat history. You store facts with retain, fetch them with recall, and get a reasoned answer over memory with reflect, organized in memory banks. It runs as a Docker container, with Docker Compose, from pip or on Kubernetes with Helm, has Python, Node.js and Go clients, and an LLM wrapper that adds memory to an existing OpenAI or Anthropic client in two lines.

Best for: Developers building assistants or agents that should remember users and past work across sessions.

Needs: Docker, pip or Kubernetes; An LLM API key (OpenAI in the quick start); Python, Node.js or Go for the client.

Start here: [Add long-term memory to an existing chatbot in two lines](https://dedupedai.com/use-cases/vectorize-io-hindsight/add-long-term-memory-to-your-agent-in-two-lines/) (Beginner, 20 minutes)

1. Start a Hindsight server, for example with the Docker command from the README on ports 8888 and 9999
2. Install the wrapper: pip install hindsight-litellm
3. Import it with from hindsight_litellm import wrap_openai and wrap your OpenAI client, passing a bank_id per user and hindsight_api_url for a self-hosted server (http://localhost:8888)
4. Call client.chat.completions.create as before; use wrap_anthropic() for the Anthropic SDK

All 3 use cases: https://dedupedai.com/use-cases/vectorize-io-hindsight/ | GitHub: https://github.com/vectorize-io/hindsight

### TencentDB Agent Memory (TencentCloud/TencentDB-Agent-Memory)

A team-level memory server for AI agents that stores chat memory, skills, wiki pages, and code graphs, and shares them across agents and frameworks.

Best for: Developers and small teams who run several AI coding agents and want them to share project context, skills, and code knowledge.

Needs: Git and a bash-compatible shell; Two sets of LLM API parameters for the memory group and the proxy group, filled into .env; A local machine that can run the three services (memory-core, memory-hub, proxy); An agent client that accepts a custom base URL, such as Claude Code or Codex.

Start here: [Give Claude Code and Codex one shared memory server](https://dedupedai.com/use-cases/tencentcloud-tencentdb-agent-memory/shared-memory-for-claude-code-and-codex/) (Intermediate, 30 minutes)

1. Run git clone https://github.com/TencentCloud/TencentDB-Agent-Memory.git and then cd TencentDB-Agent-Memory/deploy/global-images
2. Run cp .env.example .env, then open .env and fill in the two sets of LLM parameters (memory group and proxy group)
3. Run ./start-all.sh and wait for it to finish; it prints a one-liner to paste into Claude
4. Open http://localhost:8125 to confirm the panel loads

All 5 use cases: https://dedupedai.com/use-cases/tencentcloud-tencentdb-agent-memory/ | GitHub: https://github.com/TencentCloud/TencentDB-Agent-Memory

### AI Memory (akitaonrails/ai-memory)

ai-memory is a Rust tool that gives AI coding agents a shared long-term memory, stored as a git-backed markdown wiki, so work can be handed off between agent CLIs and machines.

Best for: Developers who switch between AI coding agents or machines and want the next agent to resume without re-explaining the project.

Needs: A Linux or macOS machine (native Windows is experimental; WSL2 is supported); At least one supported coding agent CLI installed, such as Claude Code or Codex; A terminal with curl and sh available.

Start here: [Hand off a half-finished task from Claude Code to Codex](https://dedupedai.com/use-cases/akitaonrails-ai-memory/hand-off-task-between-claude-code-and-codex/) (Intermediate, 15 minutes)

1. Run curl -fsSL https://github.com/akitaonrails/ai-memory/releases/latest/download/install.sh | sh
2. Run ai-memory setup
3. Quit Claude Code in the project directory
4. Run ai-memory run codex from the same directory

All 4 use cases: https://dedupedai.com/use-cases/akitaonrails-ai-memory/ | GitHub: https://github.com/akitaonrails/ai-memory

### Obsidian Mind (breferrari/obsidian-mind)

Obsidian Mind is an Obsidian vault template that gives AI coding agents persistent memory through hooks, slash commands and optional local QMD semantic search, built for Claude Code with hooks for Codex CLI and Gemini CLI.

Best for: Developers and engineering managers who want their coding agent to remember goals, people, decisions and wins across sessions.

Needs: Obsidian; Node.js for ShardMind and QMD; Claude Code, Codex CLI or Gemini CLI.

Start here: [Give your coding agent a memory that compounds](https://dedupedai.com/use-cases/breferrari-obsidian-mind/give-agent-persistent-memory-vault/) (Intermediate, 30 minutes)

1. Install the vault manager: npm install -g shardmind
2. Create a fresh folder and enter it: mkdir my-vault && cd my-vault
3. Run shardmind install github:breferrari/obsidian-mind and answer the wizard (name, organization, agents, QMD)
4. Open the folder as a vault in Obsidian so you can read what the agent writes

All 3 use cases: https://dedupedai.com/use-cases/breferrari-obsidian-mind/ | GitHub: https://github.com/breferrari/obsidian-mind

### Agent Memory (tigerless-labs/agent-memory)

agent-memory is a Python runtime that gives AI agents long-term memory stored as plain Markdown files, with local ranked retrieval and a sleep-time consolidation layer, and Claude Code and Codex share one store.

Best for: Developers who use Claude Code or Codex across many sessions and want decisions and context to carry over without an API key.

Needs: Python environment able to install the agent-memory package, as described in the README; Claude Code or Codex CLI installed on the machine; A store directory set as AGENT_MEMORY_STORE; Shell access to run the mem commands.

Start here: [Share one memory of decisions across Claude Code and Codex](https://dedupedai.com/use-cases/tigerless-labs-agent-memory/share-decisions-between-claude-code-and-codex/) (Intermediate, 60 minutes)

1. Run the setup step described in the README so the host agents use the shared store at AGENT_MEMORY_STORE.
2. Run mem recall "why files instead of a database" to see the ranked L0 list of matching memories.
3. Run mem context "why files instead of a database" to get the top hits expanded in one call.
4. Open the same question in Codex and check that it returns the same memory paths.

All 5 use cases: https://dedupedai.com/use-cases/tigerless-labs-agent-memory/ | GitHub: https://github.com/tigerless-labs/agent-memory

### Context Mode (mksglu/context-mode)

Context Mode is an MCP server and hook set for AI coding agents that keeps raw tool output out of the context window, persists session memory in SQLite, and routes work across many clients.

Best for: Developers who use AI coding agents on large codebases and notice their context window filling up during long sessions.

Needs: Claude Code v1.0.33+ for the plugin install, or Node.js >= 22.5 (or Bun) for the Gemini CLI setup; An existing AI coding agent session in a project you want to work on.

Start here: [Keep large tool output out of Claude Code's context](https://dedupedai.com/use-cases/mksglu-context-mode/cut-claude-code-context-bloat/) (Beginner, 15 minutes)

1. Run /plugin marketplace add mksglu/context-mode in Claude Code.
2. Run /plugin install context-mode@context-mode.
3. Restart Claude Code or run /reload-plugins.
4. Run /context-mode:ctx-doctor and confirm all checks show [x].

All 5 use cases: https://dedupedai.com/use-cases/mksglu-context-mode/ | GitHub: https://github.com/mksglu/context-mode

### Lemmalog (JordyZomer/lemmalog)

Lemmalog is a Rust Datalog engine that gives LLM agents a deductive memory, exposed as an MCP server, a headless CLI, a REPL and an agent skill.

Best for: Developers who run Claude Code or another MCP-capable agent on long tasks and want its facts and derived conclusions kept in a queryable, provenance-tracked store.

Needs: Rust toolchain with cargo, and a clone of the lemmalog repo; Claude Code (or Kimi CLI) installed if you want MCP tools; A writable path for the memory snapshot, for example /tmp/lemmalog.snapshot or the default ~/.lemmalog/memory.snap.

Start here: [Give Claude Code a persistent, queryable memory](https://dedupedai.com/use-cases/jordyzomer-lemmalog/persistent-memory-for-claude-code/) (Intermediate, 45 minutes)

1. Run cargo build --release in the repo to produce the lemmalog-cli binary used by later steps.
2. Run cargo build --release --features mcp.
3. Run claude mcp add lemmalog -- $(pwd)/target/release/lemmalog-mcp.
4. Optionally register with persistence: claude mcp add lemmalog --env LEMMALOG_MCP_PATH=/tmp/lemmalog.snapshot -- $(pwd)/target/release/lemmalog-mcp.

All 4 use cases: https://dedupedai.com/use-cases/jordyzomer-lemmalog/ | GitHub: https://github.com/JordyZomer/lemmalog

## Questions

### What is the best open-source memory system for AI agents?

The best open-source AI repos for long-term memory for AI agents right now are Claude Mem, Hindsight and TencentDB Agent Memory. Claude-Mem is the most starred plug-in memory for coding agents; Hindsight is a general agent memory you call from code; ai-memory and Obsidian Mind keep memory as markdown files you can read and edit.

### Which repo for long-term memory for AI agents is easiest to start with?

Hindsight: its starter use case "Add long-term memory to an existing chatbot in two lines" is rated Beginner and takes about 20 minutes.

### How do I get started with Claude Mem?

In Claude Code, run /plugin marketplace add thedotmack/claude-mem; Run /plugin install claude-mem; Restart Claude Code. Full steps and a copy-paste agent prompt: https://dedupedai.com/use-cases/thedotmack-claude-mem/resume-claude-code-project-context/

### Are these long-term memory for AI agents repos free?

They are open-source projects on GitHub (check each license; some, like fair-code projects, limit commercial use). Some also sell a hosted version or need a paid model API key; the requirements for each repo are listed on this page.

### How is this list of long-term memory for AI agents repos chosen?

Deduped tracks the hottest AI repos on GitHub and writes step-by-step use cases from each README. For this page we picked the repos that do this job, ordered by fit and then GitHub stars. Repos we only inferred from a short README, or that we do not index, are left out. The page is rebuilt with the site; stars are as of the last build in 2026.

Third-party repos we don't own or vouch for. AI-written use cases can be wrong: review everything and run at your own risk.
