Manthan
Uses Git as the single source of truth for agent memory, storing every memory state update, architectural decision, and session handoff as an atomic Git commit with author-agent and trace metadata. Provides commit SHA provenance for recall operations and supports lineage auditing and time-travel via Git commit history.
Maintains an embedded SQLite FTS5 sidecar index (via node:sqlite with BM25 ranking) to provide sub-5ms deterministic lexical retrieval across stored memory artifacts, with support for full index rebuilds and synchronization with the current Git HEAD.
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., "@Manthan Recall the payment API idempotency rule and show its Git commit provenance."
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.
ποΈ Manthan (@manthan/mcp-server)
Commercial-Grade, Git-Native, Deterministic Memory Engine for AI Agents via Model Context Protocol (MCP)
Unlike probabilistic vector-only memory layers that suffer from black-box semantic drift and silent hallucinations, Manthan treats agent memory as version-controlled state ("Memory-as-Code").
Git is the Single Source of Truth: Every state update, architectural decision, and session handoff is an atomic Git commit with full author-agent and observability trace metadata.
Embedded SQLite FTS5 Sidecar Index: Uses Node's built-in
node:sqlite(DatabaseSyncwith BM25 ranking) for sub-5ms deterministic lexical retrieval with zero native C++ compilation dependencies on Windows, Linux, and macOS.Git Commit SHA Provenance: Every memory recall operation returns cryptographic commit SHA provenance, providing reproducible time-travel and compliance auditing.
ποΈ Architecture & Multi-Scope Memory
Manthan is completely self-contained and operates out-of-the-box in any repository via a declarative .manthan.yaml manifest:
workspace/
βββ .manthan.yaml # Declarative engine configuration
βββ .manthan/
βββ index.db # Ephemeral SQLite FTS5 BM25 search sidecar (gitignored)
βββ memory/
βββ working/ # Active mutable memory (Read/Write)
β βββ backend/
β βββ mem_01j9x8.md
βββ constitution/ # Architectural guardrails & ADRs (Read-only)
βββ core/
βββ ADR-001.md1. Active Memory Store (working Layer β Default)
Stores live project state, episodic session decisions, task handoffs, and evolving specifications as structured Markdown files with strict YAML frontmatter.
Access Policy: Read/Write via MCP tools. Every mutation validates against a strict Zod schema and generates an atomic Git commit with metadata (
author_agent,trace_id,supersedes).
2. Constitutional Memory (constitution Layer β Guardrail Tier)
Stores non-negotiable architectural rules, ADRs, and project conventions inside
.manthan/memory/constitution/.Access Policy: Read-only during standard agent task execution so models cannot accidentally overwrite or drift core project laws. Always prioritized in
recall_memoryresponses. Agents propose additions usingpropose_constitution_rule(staged asdraftfor human review).
Related MCP server: openmemkit
π Standardized Memory Artifact Schema
Every memory artifact is stored as a standard .md file with strict YAML frontmatter:
---
id: "mem_01j9x8k2m"
title: "API Idempotency Key Header Standard"
layer: "working" # "working" | "constitution"
namespace: "backend/payments" # Logical topic or directory slug
status: "active" # "active" | "superseded" | "draft" | "archived"
author_agent: "claude-code"
trace_id: "tr_98234792"
supersedes: null # Optional ID of previous memory artifact
tags: ["idempotency", "api", "payments"]
updated_at: "2026-11-09T10:00:00.000Z"
---
## Context & Decision
All payment mutation endpoints must accept and validate a unique `Idempotency-Key` header.π οΈ MCP Tools Specification
Manthan exposes 5 deterministic tools to any MCP-compliant client:
Tool | Purpose | Key Inputs | Key Outputs |
| Lexical BM25 search across state & guardrails |
| JSON bundle of |
| Atomic state write with Git commit & FTS indexing |
| Commit SHA, artifact path, and confirmation |
| Propose architectural law or ADR for review |
| Draft artifact path and human review guidance |
| Provenance audit and time-travel history |
| Chronological commit history, agent author, and diff summary |
| Sidecar index maintenance & cache refresh |
| Indexed counts, duration, and synchronized Git HEAD SHA |
βοΈ Declarative Configuration (.manthan.yaml)
version: "1.0"
project: "my-project"
storage:
root_dir: ".manthan/memory"
working_dir: ".manthan/memory/working"
constitution_dir: ".manthan/memory/constitution"
index_db_path: ".manthan/index.db"
git:
auto_commit: true
branch_strategy: "direct" # "direct" | "session-branch"
commit_prefix: "chore(manthan):"
governance:
prioritize_constitution_on_recall: true
allow_direct_constitution_writes: falseπ Quickstart
1. Initialize Manthan in your repository
npx @manthan/mcp-server initThis automatically:
Creates
.manthan.yamlwith default settings.Creates directory structures for
workingandconstitutionmemories.Adds
.manthan/index.db*to.gitignore.Initializes Git (if not already initialized).
Seeds initial constitutional rules (
ADR-001) and working memories.Builds the local SQLite FTS5 search index.
2. Inspect status
npx @manthan/mcp-server statusπ Client Integration
1. Claude Desktop & Claude Code
Add to your claude_desktop_config.json:
{
"mcpServers": {
"manthan": {
"command": "npx",
"args": ["-y", "@manthan/mcp-server", "serve"]
}
}
}Or for local development:
{
"mcpServers": {
"manthan": {
"command": "node",
"args": ["<your-path>/manthan-mcp/dist/index.js", "serve"]
}
}
}2. Cursor
In .cursor/mcp.json (or Cursor Settings > Features > MCP):
{
"mcpServers": {
"manthan": {
"command": "npx",
"args": ["-y", "@manthan/mcp-server", "serve"]
}
}
}3. Google Antigravity
Add to your Antigravity MCP configuration (~/.gemini/antigravity/mcp/manthan.json or config.json):
{
"name": "manthan",
"command": "npx",
"args": ["-y", "@manthan/mcp-server", "serve"]
}π» CLI Commands Reference
manthan init [--dir <path>]: Initialize memory storage and seed artifacts.manthan serve [--dir <path>]: Start the MCP server over stdio.manthan status [--dir <path>]: View memory counts, Git HEAD, and index health.manthan reindex [--dir <path>]: Force a complete rebuild of the SQLite FTS5 index.
π§ͺ Testing
Run the automated end-to-end integration test suite:
npm testThe test verifies:
Workspace initialization and Git repository detection.
Atomic
commit_memoryexecution and Git SHA stamping.Sub-5ms BM25 lexical recall with
recall_memory.State supersession (marking v1 as
superseded, creating v2 asactive, excluding superseded items from recall).Constitutional rule proposal and staging with
status: draft.Audit lineage retrieval via Git commit logs.
Full FTS5 sidecar index rebuilding and HEAD SHA synchronization.
π€ Contributing
We welcome contributions! Please read our Contributing Guide for details on our code of conduct, development setup, architecture guidelines, and pull request submission process.
π Sponsorship & Support
If Manthan helps eliminate hallucination and state drift in your AI agents, consider supporting ongoing open-source maintenance via GitHub Sponsors.
π License
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this software except in compliance with the License.
Copyright Β© 2026 Prasad Ajinkya and Manthan Contributors.
Available Tools
6 toolsaudit_memory_lineageB
Provenance & Time-Travel: retrieves chronological Git commit history, agent author metadata, and diff audit trail for a memory artifact.
Inputs: file_path, memory_id, max_commits.
commit_memoryB
Deterministic state write: validates Markdown frontmatter, atomically commits to Git with agent provenance, and updates local FTS5 index.
Inputs: title (required), content (required), namespace (required), author_agent (required), +3 more.
fetch_by_tags_and_keywordsC
Specialized harness to fetch, filter, and rank memories via multi-tag combinations (AND/OR) and BM25 lexical keywords with snippet context extraction.
Inputs: tags, limit, doc_type, keywords, +3 more.
propose_constitution_ruleB
Guardrail Promotion: proposes a new architectural law or ADR inside constitution memory with status: "draft" for human developer review.
Inputs: title (required), content (required), namespace (required), rationale (required), +3 more.
recall_memoryB
Lexical BM25 search across agent working memory and constitutional guardrails with Git commit SHA provenance.
Inputs: tags, limit, query, namespace, +1 more.
sync_memory_indexB
Sidecar Maintenance: scans .manthan/memory/, parses Markdown frontmatter, synchronizes the SQLite FTS5 index, and stamps the current Git commit SHA.
Inputs: force_rebuild.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 6 tools
The tools are mostly distinct: sync, commit, recall, propose, audit, and tag-based fetch each map to different memory lifecycle stages. There is some overlap between recall_memory and fetch_by_tags_and_keywords for search, and between sync_memory_index and commit_memory for index updates, but the descriptions mostly clarify when each should be used.
All tool names use snake_case and begin with a verb, producing a generally predictable verb-first convention. Minor deviations exist in noun phrasing, such as fetch_by_tags_and_keywords and three-token names like sync_memory_index, but the pattern remains readable.
Six tools is well-scoped for a memory-management server with Git provenance and constitution guardrails. Each tool covers a distinct maintenance, read, write, audit, proposal, or retrieval role without obvious padding.
The surface covers indexing, search, commit, audit, tag filtering, and constitution-rule proposal, but it lacks explicit update/delete or retraction operations for memories. Constitution rules can be proposed but not listed or advanced beyond draft status by the agent, creating notable lifecycle gaps.
Maintenance
Related MCP Connectors
Project memory, documentation and controlled secret access for AI coding agents.
Portable AI memory shared across models and harnesses - plain markdown you own.
One memory for every AI you work with: your rules, notes and decisions in your own Git repo.
Shared Markdown memory for your agents: docs, typed collections, files, skills and Dispatch.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides long-lived, cross-project technical memory for AI agents via markdown cards stored in git and indexed by SQLite, enabling search, retrieval, and human-reviewed knowledge management.ISC
- AlicenseAqualityCmaintenanceEnables AI agents to maintain a persistent, queryable memory stored as user-owned Markdown files, with dual-channel retrieval (FTS5 and optional semantic search) and an audited write pipeline.11MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents like Codex, Grok Build, and Antigravity to share persistent local memory, preferences, project context, tasks, and handoffs using Markdown and SQLite.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to maintain lossless, queryable long-term project memory through local SQLite storage, bi-temporal history, hybrid retrieval, and Git-backed Markdown mirrors, exposed via MCP tools and resources.2,371 npm1Apache 2.0