Agent Memory / Superfast Personal Agent Memory
open source Active GitHub
Python SQLite
Agent Memory

What it does

Agent Memory is persistent memory for coding agents -- a lightweight, offline-first solution that keeps context between sessions. Every time you start a new session with an AI coding agent, it normally starts from scratch. That architectural decision you explained last week? Gone. The deployment rule about not pushing on Fridays? Forgotten. The auth flow that took 20 minutes to describe? You will describe it again.

Agent Memory fixes this. It gives your AI agent persistent, searchable memory that survives between sessions. Save a decision once, and the agent finds it when relevant. It is a single Go binary that stores everything in one SQLite file. No Docker, no Python, no external database, no API keys. Install it, and it works.

The agent saves context as it works: architecture decisions, coding conventions, project-specific rules, deployment notes. Next session, the agent loads relevant context automatically. You stop repeating yourself. The agent stops making the same mistakes.

Built specifically for AI coding agents with a 14-tool MCP server and pre-built hooks for Claude Code. One command to set up. Auto-captures tool outputs and user prompts with sensitive data scrubbed before storage.

Why this exists

Agent Memory was born from running Mesh in production. Mesh is a powerful semantic memory server with workspaces, auto-tagging, embeddings, and a web UI. It is the right tool for a team or a server infrastructure. But it requires PostgreSQL, Docker, and a machine that stays on. For a developer working on a laptop, jumping between projects, that is overhead.

The question was simple: what if memory required zero infrastructure? What if you could install it with one command and it just worked, on any machine, offline, with no configuration?

Go was the natural choice. It compiles to a single binary with no runtime dependencies. No Python virtual environments, no Node.js, no Docker. Download one file, it works. This is the entire philosophy: if setting up memory takes longer than the task you need memory for, something is wrong.

Results & Impact

Single binary, zero dependencies. Install with go install and start using immediately. No infrastructure to set up, no services to run, no accounts to create.

Works offline by default. FTS5 full-text search runs entirely locally. Optional hybrid search (30% keyword + 70% semantic) available with OpenAI embeddings for when wording varies. Both modes return results in milliseconds.

Compared to alternatives (mem0, Zep, ChromaDB), Agent Memory requires no Python, no Docker, no external database, and no API key for basic operation. It is designed for one thing: giving AI coding agents memory on a developer's machine.

Unlike built-in agent memory (like Claude Code's auto-memory), Agent Memory is not tied to one tool. It works with any MCP client: Claude, Cursor, Copilot, or a custom agent. Switch tools, your memories come with you. The data is yours, in a SQLite file you can read, backup, or move to another machine.

Numbers

  • ~11MB binary size
  • 0 external dependencies
  • 14 MCP tools
  • MIT license

Key features

  • Single binary, zero setup. one Go binary (~11MB). No Docker, no Python, no external database, no configuration files. go install and it works. Everything in one SQLite file.
  • 14 MCP tools. built-in MCP server for Claude Code, Cursor, or any MCP-compatible agent. Add, search, context, focus, delete, update, stats, timeline, prompts, tagging. One command setup.
  • Hybrid search. FTS5 full-text search with BM25 ranking by default (works offline). Optional 30/70 keyword/semantic hybrid with OpenAI embeddings for fuzzy matching.
  • Auto-capture hooks. pre-built Claude Code hooks automatically save tool outputs and user prompts. Sensitive data (passwords, API keys, tokens) scrubbed before storage. Set up in one JSON block.
  • Smart context. progressive disclosure at session start: pinned memories first, then recent, then search results. All assembled within a token budget. The agent gets the right context without overloading.
  • Workspaces. isolate memories per project. agent-memory focus backend-api and everything stays separate. Switch between projects without cross-contamination.
  • Security built in. restricted file permissions, sensitive data scrubbing (12 regex rules), prompt injection protection (17-pattern deny-list), FTS5 injection sanitization, 1MB content limit.
  • Works offline. FTS5 mode requires zero network calls. Everything runs locally. Embeddings are optional, not required. Your memories never leave your machine unless you choose to use an embedding API.

How it works

Agent Memory is a Go CLI that stores memories in SQLite with FTS5 full-text search indexes. Each memory has content, tags, timestamps, and an optional embedding vector.

When the agent (or you) adds a memory, it is indexed for full-text search immediately. Tags are extracted or auto-suggested. If embeddings are enabled, the content is vectorized via OpenAI and stored alongside the text.

At session start, the context command assembles relevant memories: pinned items first (always-present context), then recent memories, then search results matching the current project. All within a configurable token budget so the agent's context window is not wasted.

The MCP server exposes all operations as tools. The agent calls memory_add to save, memory_search to find, memory_context at session start. Hooks auto-capture significant events from Claude Code sessions.

Stack: Go, SQLite with FTS5, optional OpenAI embeddings. Single binary, single file database. No build dependencies beyond Go 1.21+.

Quick Start

# Install
go install github.com/dklymentiev/agent-memory@latest

# Add a memory
agent-memory add "Auth uses JWT refresh tokens, 15min access / 7d refresh" \
  -t type:decision -t topic:auth

# Search
agent-memory search "authentication tokens"

# Get smart context for session start
agent-memory context

# Set up MCP for Claude Code
claude mcp add agent-memory. agent-memory mcp

Use Cases

For developers using AI coding agents. Stop repeating yourself every session. Save architecture decisions, coding conventions, deployment rules once. The agent finds them when relevant. "We use PostgreSQL for this project" is said once, remembered forever.

For teams with shared context. Onboard the agent to your project instantly. Pipe your ARCHITECTURE.md into memory with --pin. Every agent session starts with the right context. New team member's agent knows the codebase conventions from day one.

For privacy-conscious developers. Keep memories on your machine. Everything is a local SQLite file. FTS5 search works offline. No data leaves your machine unless you opt into embedding APIs. Sensitive data scrubbed automatically from hook captures.

Lessons Learned

Mesh taught me what memory needs to do. Agent Memory taught me how little infrastructure it actually requires. The feature set is similar: save, search, tag, organize by workspace. But stripping away PostgreSQL, Docker, and HTTP left something that starts in milliseconds and runs anywhere. Most of the complexity in Mesh exists to serve multiple agents on a server. A single developer on a laptop needs none of it.

FTS5 is underrated. Full-text search with BM25 ranking handles 90% of memory queries without embeddings. "Find my notes about authentication" works perfectly with keyword search. Semantic search (embeddings) is better for fuzzy queries where wording varies, but making it optional instead of required meant the tool works offline, costs nothing per query, and has zero external dependencies.

The MCP protocol is the right abstraction for agent tools. Instead of building integrations for Claude, then Cursor, then the next tool, you build one MCP server and every compatible client gets access. 14 tools, one implementation, works everywhere. When the next AI coding tool appears, Agent Memory will work with it on day one.

FAQ

What problem does Agent Memory solve? AI coding agents forget everything between sessions. You repeat context, re-explain decisions, re-describe architecture. Agent Memory gives your agent persistent, searchable memory. Save a decision once, the agent finds it when relevant.

How is this different from ChromaDB or Pinecone? Single Go binary with zero dependencies. No Docker, no Python, no external database, no API keys required. Designed for personal use with AI coding agents, not for millions of documents. Works in 10 seconds with zero infrastructure.

Does it work with Claude Code? Yes. Built-in MCP server with 14 tools and pre-built hooks. One command to set up: claude mcp add agent-memory. agent-memory mcp.

Where is data stored? Single SQLite file. Default: ~/.agent-memory/memory.db. Per-project databases supported via agent-memory init. One file to back up, one file to move.

Does it work offline? Yes. FTS5 mode runs entirely locally with zero network calls. Semantic search with embeddings requires an OpenAI API key, but it is optional.

View on GitHub

See Also