Visual memory manager for AI agents. One source of truth for Claude Code, Cursor, Cline, Continue.
* Hosted preview on Vercel — sign in with email or GitHub to try. Your data stays private to your account via Supabase RLS. For self-hosting or local-only mode, see Quick start below.
Screenshots
Visual memory manager for AI agents. MCP-native. Open core.
ดาว
4
เครื่องมือ
—
อัปไทม์
—
100% free, forever
AgentMemory is open source under MIT. No paywalls, no premium tiers, no limits.
Free for everyone — unlimited memories, unlimited projects
Self-hostable — run locally forever, no telemetry, no lock-in
MCP-native — works as a Model Context Protocol server in Claude Desktop, Cursor, Cline, Continue, Windsurf, Roo Code, Kilo Code, Zed, Aider, Goose, Warp, Codex CLI, Gemini CLI, GitHub Copilot CLI, Qwen Code CLI, Google Antigravity, AWS Kiro, Droid, OpenCode, OpenClaw, and pi-mono. See Connect to your AI tool below.
Visual — graph view of all memories and their semantic relations
Portable — import/export to .cursorrules, CLAUDE.md, MemGPT JSON, Claude Code .jsonl sessions
Optional cloud sync — sign in to sync your memories across devices via Supabase
Support the project
AgentMemory is built and maintained in spare time. If it saves you time, consider supporting development:
AgentMemory exposes the same MCP server in two modes:
Local stdio — runs mcp/index.ts via tsx; the agent process invokes it as a child process. Best for desktop tools that have file-system access to your machine.
Cloud HTTP — Streamable HTTP endpoint at https://<your-host>/mcp (Vercel default). Best for hosted tools, web clients, and sharing the same memory across machines. The user's Supabase JWT goes in Authorization: Bearer <jwt>.
The snippets below assume your clone is at /absolute/path/to/agentmemory. The local stdio command runs the MCP server directly with tsx — no build step needed.
To get a Supabase JWT, sign in to the hosted AgentMemory web UI, then in DevTools run JSON.parse(localStorage.getItem('sb-<project>-auth-token') || 'null') and copy access_token. JWTs last ~1h; refresh by re-running the command after each session.
For cloud mode, swap to "type": "remote", "url": "https://your-app.vercel.app/mcp", "headers": { "Authorization": "Bearer <supabase-jwt>" }. Reference in prompts with use the agentmemory tool.
20. OpenClaw & pi-mono
These are personal AI assistants, not coding IDEs — they accept MCP servers as skills so AgentMemory becomes the assistant's long-term memory.
Restart the gateway with openclaw gateway restart. In Telegram/WhatsApp/Discord, the assistant now has persistent memory across sessions — say "remember that I prefer dark mode" and it sticks.
pi-mono (pi CLI by Mario Zechner) — ~/.pi/config.json:
Run pi and ask the agent to search_memories for prior context.
Troubleshooting
Symptom
Fix
ENOENT on mcp/index.ts
Use an absolute path; ~ doesn't expand inside the JSON
command not found: tsx
npm i -g tsx, or replace npx tsx with node --import tsx
Tools never appear
Restart the client. Some (Cline, Kilo, Roo) need explicit "enable" toggle
401 Unauthorized on cloud
JWT expired; re-copy from the web UI's DevTools localStorage
429 Too Many Requests on cloud
Hit RATE_LIMIT_PER_HOUR; wait or back off via backfill_embeddings
Cannot find module '@modelcontextprotocol/...'
npm install in the agentmemory repo root
Features
Memory decay & access tracking
Memories follow an exponential decay curve (strength = 0.5^(days/30) × importance/5) and get a boost every time they're read. Each memory falls into one of four tiers, displayed as a colored badge on the card:
Tier
Strength
Color
Meaning
hot
≥ 0.70
red
Recently created or frequently accessed
warm
≥ 0.40
amber
Still relevant
cold
≥ 0.15
blue
Fading, but kept for context
dead
< 0.15
grey
Auto-candidate for forgetting
runAutoForget() runs on app boot and removes memories matching any of: TTL expired, OR (strength < 0.05 AND access_count < 3), OR (importance ≤ 2 AND age > 180 days).
MemoryCard calls touchMemory(id) on mount, bumping access_count and refreshing last_accessed_at.
Survives across all backends: local (zustand), Supabase (Postgres strength column + runAutoForget from useAuth).
Hybrid search (BM25 + Vector + Graph via RRF)
Three sources fuse via Reciprocal Rank Fusion (k=60) in src/utils/rrf.ts:
pg_trgm trigram similarity (server) or Porter-stemmed inverted index (local)
Graph
0.3
Both
1-hop expansion through relations table (server) or in-memory edges (local)
Top results from each source are joined with RRF(d) = Σᵢ wᵢ / (k + rankᵢ(d)) and the top-N are returned. The local BM25 index caches by (count, max(updated_at)) and invalidates on every add/update/delete/auto-forget.
Enabling semantic search on the cloud MCP — sign up at huggingface.co (free), grab a read-token at https://huggingface.co/settings/tokens, and set HUGGINGFACE_API_KEY on Vercel. The serverless handler in api/mcp.ts instantiates createHuggingFaceEmbedder(token) and injects it into the SupabaseBackend. On add_memory the content is embedded and stored as vector(384); on search_memories the query is embedded and the semantic_search_memories RPC does cosine search via the HNSW index.
Without the key, the server still works — it just skips the vector source and the RRF becomes 2-way (BM25 + graph).
Backfilling old memories — after enabling the embedder, existing rows have embedding = NULL. Run the backfill_embeddings MCP tool repeatedly until remaining = 0:
Each call costs ⌈N/32⌉ embedding API calls and respects the per-user rate limit. The 60s serverless timeout fits ~3 HF batches = ~96 memories per invocation.
Rate limiting — the Supabase schema adds an api_rate_limits table and a consume_rate_limit(p_user_id, p_cost, p_max) RPC. Every embedding call (search query, memory insert, backfill batch) atomically consumes ceil(texts/32) units from a sliding 1-hour window. Default cap is RATE_LIMIT_PER_HOUR=100, which leaves plenty of headroom in HF's 30k/month free tier for ~30 active users. Set the env to 0 to disable. If you hit the limit, the MCP call returns isError: true with the exact reset timestamp.
JSONL import from Claude Code sessions
Drop a Claude Code session file (~/.claude/projects/-my-project/<uuid>.jsonl) into the import page, or call the MCP import_jsonl tool. The parser:
Reads one JSON object per line
Drops tool_use / tool_result blocks (keeps only user / assistant messages)
Filters user messages: 20–600 chars, drops system-reminders and shell commands (ok, ./run-build.sh, etc.)
Application name: AgentMemory (or anything you like)
Homepage URL: your deployed URL (e.g. https://agentmemory-dusky.vercel.app) or http://localhost:5173 for local dev
Authorization callback URL: copy this from Supabase in the next step — you'll come back to edit it
Click Register application
On the next page, click Generate a new client secret. Copy the Client ID and the Client secret (you won't see the secret again)
Step 2 — Wire it into Supabase
Back in Supabase Dashboard → Authentication → Providers → GitHub
Toggle Enable Sign in with GitHub on
Paste the Client ID and Client Secret from step 1
Click Save
In Authentication → URL Configuration, add your site URLs to Site URL and Additional Redirect URLs:
http://localhost:5173 (dev)
https://your-app.vercel.app (production)
Supabase now shows the canonical Callback URL for your project — it looks like https://<project-ref>.supabase.co/auth/v1/callback. Go back to the GitHub OAuth App and paste that into Authorization callback URL
Step 3 — Test it
Open /auth in your app → click Continue with GitHub → you should bounce to GitHub, approve, and land back signed in. The avatar in the sidebar switches to your GitHub profile picture and a Sign out button appears in the bottom-left.
Self-hosting gotcha: every custom domain you serve from needs to be added to Supabase's Additional Redirect URLs, otherwise OAuth will reject the redirectTo parameter. Supabase returns a redirect_uri not in allowlist error if you skip this.
2. Configure environment
Copy public/.env.example to .env (or set variables on Vercel):
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=eyJhbGc...
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=eyJhbGc...
# Optional: enables pgvector semantic search via HuggingFace Inference API (free tier)
HUGGINGFACE_API_KEY=hf_xxxxxxxxxxxxxxxxxxxxxxxx
# Optional: per-user embedding rate limit (default 100/hr, protects HF free tier)
RATE_LIMIT_PER_HOUR=100
# Service role key NOT used — RLS scopes everything to auth.uid()
3. Deploy to Vercel
npm i -g vercel
vercel
# accept defaults; add the SUPABASE_* env vars when prompted
The web app is a static single-file build (dist/index.html) at the root.
The MCP server is exposed as a serverless function at /mcp and /api/mcp.
4. Use the remote MCP
Clients (Claude Desktop, Cursor, custom) can connect to your hosted MCP server over HTTP. Send the user's Supabase JWT in the Authorization: Bearer <jwt> header:
The function validates the JWT via Supabase, then queries Postgres with RLS so each user only sees their own data. No service-role key is ever needed for user requests — RLS does the work.
Architecture
src/
store/memoryStore.ts # Zustand store + pure logic helpers (hybridSearch, decay)
utils/
bm25.ts # BM25 inverted index
rrf.ts # Reciprocal Rank Fusion
stemmer.ts # Compact Porter stemmer
memoryDecay.ts # calculateStrength, tierOf, touchMemory, runAutoForget
jsonlImport.ts # Claude Code session parser
lib/supabase.ts # Supabase browser client
lib/cloudSync.ts # Pull/push helpers used by memoryStore
hooks/useAuth.ts # Wires Supabase auth state to the store
components/
MemoryCard.tsx # Tier badge + touch-on-mount
Layout.tsx # Sidebar with sign-in / cloud status
pages/
AuthPage.tsx # Magic-link + GitHub OAuth sign-in
ImportPage.tsx # .jsonl + .md/.txt/.cursorrules dropzone
SupportPage.tsx # Donate CTA
mcp/
server.ts # Transport-agnostic MCP server (9 tools + 3 resources)
embeddings.ts # HuggingFace Inference API wrapper (MiniLM-L6-v2, 384-dim)
backends/
local.ts # Reads/writes the zustand store on disk
supabase.ts # RRF search (BM25+vector+graph), embeds on add, RLS-scoped via caller's JWT
index.ts # Stdio entrypoint (uses LocalBackend)
api/
mcp.ts # Vercel serverless handler (Streamable HTTP)
supabase/
schema.sql # Tables, RLS policies, search_memories / find_similar_memories RPCs
Local mode and cloud mode share the same Memory type and the same memoryStore actions. The only difference is whether mutations are mirrored to Supabase.
Development
npm run dev # Vite dev server
npm run build # Production web build
npm run mcp # Run stdio MCP server (tsx, no build step)
npm run typecheck:mcp # tsc --noEmit on the MCP workspace
npx tsc --noEmit # tsc --noEmit on the web workspace