AI Memory MCP
A local MCP server that gives AI agents durable, searchable, cited long-term memory stored as plain Markdown.
Search memory (
memory_recall): one fused, ranked recall over exact, keyword, semantic, and graph signals, returning cited evidence with reasons and scores.Filter and scope recall: narrow by status (
active,needs-review,superseded,archived), project, ticket, repository, root scope (work/personal), source ID, or path prefix; cap results withlimit(1–20).Get proof, not just answers: responses include
citations(memory ID, source ID, path, title),evidence(heading, text, score), and ano_answerstatus when nothing matches — agents are meant to read the source before asserting a fact.Explore relationships:
relationshipsreturn graph edges with distance, relation type, confidence, and source/target labels and paths;intentreports whether the query resolved asexact,relationship, orsearch.Read raw history:
memory_artifact_readreturns ordered raw context behind anartifact://citation (chats, meetings, transcripts) — retrieved but never aged out of ranking.Write and maintain memory:
memory_upsertcreates or updates a schema-validated canonical note atomically;memory_syncrebuilds all derived indexes as one generation and reports added/changed/unchanged/removed counts, snapshot ID, and parse errors.Check health (
memory_status): verifies the canonical Markdown root, retrieval sources, index (documents, chunks, built-at, schema version, semantic dimensions), Graphify graph, logging streams, and runtime Python/MCP versions.Run it from the CLI:
ai-memory-mcp,ai-memory-sync,ai-memory-artifact(ingest/search/read/pending/backup/check/restore),ai-memory-vault,ai-memory-collection,ai-memory-migrate, andai-memory-benchmark.Stay private and safe: embeddings run locally with no external API, recall is read-only and idempotent, and failed index refreshes fall back to the last good generation.
Provides primary and additional Markdown vaults as the authoritative storage for memory records, with indexing and retrieval support.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AI Memory MCP search my memories for the project plan"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AI Memory MCP
Long-term memory for AI agents. Searchable, cited, and stored as plain Markdown.
AI Memory MCP is a local server that gives AI agents a durable memory. Agents save what they learn as Markdown notes. Later, four search methods work together to find the right note again. Every answer cites its source.
Why · How it works · Organization · Quick start · Go deeper
Why AI Memory MCP
Answers with proof. Each result carries a source path or an
artifact://citation. The skill tells agents to read the source before they state a fact.Search that finds the note. Exact, keyword, meaning, and graph search run together. One ranking picks the best result.
Local and private. The embedding model runs on your machine. Search needs no external API. Your notes are plain Markdown files that you own.
Safe by design. Markdown and one SQLite database hold the truth. Search indexes rebuild from them. A failed refresh keeps the last good index. Agents retire old facts with
supersededstatus instead of deletion.One memory for every agent. Setup configures Codex, Claude Code, Claude Desktop, GitHub Copilot CLI, OpenCode, and Visual Studio Code. The server runs on Windows, macOS, and Linux.
Chats and meetings included. The artifact database keeps raw conversations and transcripts. Agents distill them into notes that cite the raw source. Incremental indexing keeps large histories fast.
Related MCP server: Memsolus MCP Server
How it works
Each search method is strong where the others are weak. AI Memory MCP runs them together and merges the results.
Five memory systems, one ranked answer
flowchart LR
Q(["Agent question"])
subgraph Notes["Markdown notes"]
direction TB
E["Exact<br/>IDs, paths, error text"]
K["Keyword<br/>SQLite FTS5"]
S["Meaning<br/>vector embeddings"]
G["Graph<br/>links between notes"]
end
H["Raw history<br/>chats and meetings"]
F["Fuse and rank"]
A(["Cited answer"])
Q --> E & K & S & G & H
E & K & S & G & H --> F
F --> AMethod | Finds | Built with |
Exact | Identifiers, paths, filenames, and error text | SQLite FTS5 with exact-match priority |
Keyword | Notes that share the words of the query | SQLite FTS5 |
Meaning | Paraphrases and related ideas | Local Model2Vec vector embeddings, with a hashed fallback |
Graph | Notes that connect to the best matches | Wikilinks, |
Raw history | Messages, meetings, and transcripts | A full-text index and source-segment vectors |
The first four methods search your notes. The fifth method searches the raw conversations and meetings.
How results are ranked
Reciprocal rank fusion (RRF) merges the ranked list from each method. Small, bounded adjustments then set the final order.
Step | Effect |
Scope filters | Run first, so notes outside the requested scope never compete. |
Fusion | Each method keeps its own rank list, so no method loses weight through list order. |
Exact bonuses | An identifier, an exact phrase, or a title match raises a result. |
Agreement | A result that both keyword and meaning search found gets a bonus. |
Freshness | A recent |
Raw history never receives an age penalty.
Where the truth lives
flowchart LR
Vault["Markdown vault<br/>distilled notes"] -->|build| Index
Raw["Artifact database<br/>raw chats and meetings"] -->|build| Index
Index[("Search indexes<br/>derived and rebuildable")] --> Engine["Retrieval engine"]
Engine --> Tools["5 MCP tools"]
Tools --> Agents["AI agents"]The Markdown vault holds distilled notes. The primary vault is the only write target. Extra vaults are retrieval-only.
The artifact database holds raw conversations and transcripts. Only the
ai-memory-artifactcommand writes to it.The search indexes are derived data.
memory_syncbuilds all of them as one generation, and each recall reads one generation.
If any layer fails validation, recall keeps the previous generation. Read the architecture guide for the complete design.
A vault that organizes itself
Agents file each memory, and the server checks that every note follows one structure. The agent decides where a note goes. The server rejects a write that breaks the rules.
flowchart LR
A["Search<br/>for an existing note"] --> B["Choose<br/>update, supersede, or create"]
B --> C["Write<br/>a validated note"]
C --> D["Link<br/>related notes"]
D --> E["Sync<br/>publish the indexes"]Step | What happens |
Search | The agent looks for a precise existing note before it writes. This prevents duplicates. |
Choose | The agent updates a note, supersedes an old fact, or creates a note. A conflict gets |
Write |
|
Link |
|
Sync |
|
What the vault looks like
AI-Memory/
├── Home.md starter dashboard
├── Notes/ one note for each independent topic
├── Collections/
│ └── Projects/
│ ├── Projects.base Obsidian table view
│ └── Records/ typed notes
├── Views/ Action Dashboard, Review Queue, Memory Health
└── Archive/ inactive notes that stay recoverableA folder appears only when a note needs it.
The folder path never defines the meaning of a note.
The record_type, domain, and scope fields define the meaning.
---
schema_version: 2
memory_id: mem-deployment-process
title: Deployment process
type: memory
record_type: note
domain: work
status: active
created: 2026-10-14
updated: 2026-10-14
review_after: 2027-04-14
aliases:
- release steps
related:
- "[[Production configuration]]"
provenance:
- source: manual
reference: task:example-1
verified: 2026-10-14
---
# Deployment process
The service deploys from the `main` branch through the release pipeline. A deploy needs one reviewer approval.
## Steps
1. Merge the approved pull request.
2. Wait for the pipeline to publish the build.
3. Check the health endpoint at `/healthz`.
See [[Production configuration]] for the settings that the pipeline applies.The vault stays clean for these reasons:
Each note holds one topic, and each note starts with a summary that can stand alone.
The title, the file name, and the H1 heading match.
Obsidian Bases views list open actions, notes that need review, and schema health.
An agent adds missing aliases, exact strings, and links to a note that was hard to find.
Raw meetings and chats become notes with
artifact://citations. Manual text outside the managed region stays unchanged.The
ai-memory-migratecommand moves a legacy vault to this layout. It makes snapshots and supports rollback.
Quick start
Install Git and Python 3.11 or later.
On Windows, the .ps1 scripts also need PowerShell 5.1 or later.
Clone the repository.
git clone <repository-url> ai-memory-mcp && cd ai-memory-mcpRun the setup command for your platform.
macOS and Linux:
./scripts/setup.sh --memory-root ~/AI-Memory --install-clientsWindows (PowerShell):
.\scripts\setup.ps1 -MemoryRoot 'C:\path\to\AI-Memory' -InstallClientsRestart each configured client.
Ask the agent to call
memory_status.Check that every layer is healthy.
Setup creates the .venv environment and installs the project with its local embedding model.
It writes the .env file, creates the internal data under AI_MEMORY_WORK_DIR/.ai-memory/, and publishes the first index generation.
The --install-clients option registers the server and the skill with each supported client.
To add the starter dashboard, run this optional command.
macOS and Linux:
./.venv/bin/ai-memory-vault --root ~/AI-MemoryWindows (PowerShell):
.\.venv\Scripts\ai-memory-vault.exe --root 'C:\path\to\AI-Memory'After setup, agents search and save memory on their own. You can also ask directly:
"Remember that the staging database uses port 5433."
"What did we decide about the retry policy?"
For more detail, read the installation guide and the AI agent setup guide.
Go deeper
MCP tools
Tool | Function |
| Returns cited Markdown and artifact evidence. |
| Returns ordered raw context for one |
| Creates or updates one validated canonical record. |
| Publishes one coordinated generation after a canonical change. |
| Reports strict health for every required layer. |
Command-line tools
Command | Function |
| Runs the MCP server. |
| Publishes one generation: Markdown index, artifact index, and note graph. |
| Manages the canonical artifact database. It supplies |
| Creates the starter vault layout. |
| Creates a typed collection with an Obsidian Base. |
| Moves a legacy vault to the current layout with snapshots and rollback. |
| Runs the frozen retrieval benchmark. |
Quality gates
The frozen benchmark contract requires these results:
A pass rate of
1.0, with recall at 5 of1.0.A no-answer accuracy of
1.0.No scope leakage and no citation failures.
An approximate-search candidate recall at 10 of at least
0.95.
The benchmarks use synthetic data only. Read the retrieval reliability validation for the measured results and the capacity evidence.
Documentation
The documentation index links to every guide.
Operations, including the upgrade from the earlier Graphify-based release
The independent Graphify Codebase skill indexes software repositories. It never supplies data to AI Memory retrieval.
Contributing
This is a public repository.
It contains only neutral examples and synthetic benchmark fixtures.
The user memory directory, generated indexes, logs, and the .env file stay outside Git.
Read AGENTS.md and the writing standard before you change this repository.
Available Tools
3 toolsmemory_recallBRead-onlyIdempotent
Recall cited memory and its applicable relationships.
Inputs: query (required), limit, status, ticket, +5 more. Returns: query, intent, status, evidence, +3 more
memory_statusARead-onlyIdempotent
Report source, index, Graphify, and runtime status.
Inputs: no named parameters. Returns: ok, index, logging, runtime, +4 more
memory_syncA
Update the derived index from canonical Markdown.
Inputs: no named parameters. Returns: ok, index
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a distinct operation: recall for querying memories, sync for updating the index, and status for health checks. There is no overlap or ambiguity between these tools.
All tool names follow the same 'memory_' prefix followed by a verb (recall, sync, status). This consistent pattern makes the tool roles predictable and easy to use.
With 3 tools, the server is well-scoped and covers the core lifecycle of memory management (query, update, monitor). Each tool earns its place without unnecessary bloat.
The set lacks direct creation/deletion of memories and does not offer search or listing capabilities. While sync indirectly handles updates from Markdown, recall is limited to cited memories, creating notable gaps in a full memory lifecycle.
Maintenance
Related MCP Connectors
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Universal persistent memory and knowledge retrieval layer for AI agents and LLMs.
Shared memory for AI agents and teams: store, search and correct dated facts and decisions.
Persistent memory for AI agents. Search, store, and recall across sessions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceCombines bm25, vector and knowledge graphs to create a comprehensive memory solution. https://github.com/lumetra-io/engram-memory-mcp1MIT

Memsolus MCP Serverofficial
AlicenseAqualityDmaintenanceProvides persistent long-term memory for AI agents through semantic search and automated knowledge graph extraction. It enables agents to store, recall, and reason over facts, preferences, and relationships across multiple conversations and sessions.1423 npmMIT- AlicenseAqualityCmaintenanceProvides persistent, searchable memory for AI agents, enabling them to retain, recall, and reflect on information across conversations.191MIT

Memra MCP Serverofficial
AlicenseNot gradedqualityCmaintenanceProvides persistent memory for AI agents with hybrid semantic and lexical recall, including write-time contradiction detection and token-budgeted retrieval.MIT