agy-brain-memory MCP server
Commit Nov 3, 2026Indexes conversation transcripts and artifacts using SQLite to enable cross-session search and subagent lineage tracking.
Also known as orakulzero/agy-brain-memory
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 3, 2026
- License
- MIT
What is agy-brain-memory MCP?
agy-brain-memory indexes conversation transcripts and artifacts using SQLite to enable cross-session search and subagent lineage tracking.
Summary generated from the project's README
About agy-brain-memory MCP server
Indexing conversation transcripts and Markdown artifacts from Google Antigravity allows developers to perform cross-session searches and track subagent lineage. This MCP server uses a local SQLite database with FTS5 and WAL to manage data stored in the ~/.gemini/antigravity/brain directory. It avoids brute-force scans by tracking file sizes and modification times to skip unchanged sessions during the indexing process.
Users interact with the system through five specific MCP tools including agy_brain_search for querying and agy_brain_subagent_lineage for reconstructing parent-to-child invoke_subagent trees. The server also provides agy_brain_session_digest to create token-budgeted Markdown handoffs and agy_brain_health_report to find orphaned directories or stalled sessions. It runs as a stdio MCP server and requires Python 3.10 or higher to function without third-party runtime dependencies.
What you can do with it
- 1Search across past sessionsFind specific technical terms or project details hidden within hundreds of megabytes of JSONL conversation files.
- 2Perform storage maintenanceIdentify stalled sessions or empty directories within the brain storage to maintain system health.
Written from the project's README. Every use case is checked against a quote from it.
README
View on GitHubagy-brain-memory
Antigravity Brain Cross-Conversation FTS5 Memory, Subagent Lineage & Context Compaction Engine (v1.0.0).
Overview
Google Antigravity stores session transcripts (transcript.jsonl) and Markdown artifacts across UUID directories in ~/.gemini/antigravity/brain/<conv-id>. Without an index, searching past sessions or reconstructing parent-to-child invoke_subagent trees requires brute-force linear scans across hundreds of megabytes of JSONL files.
agy-brain-memory solves this with zero third-party runtime dependencies (100% Python 3.10+ standard library sqlite3 WAL + FTS5):
- Incremental SQLite WAL + FTS5 Brain Indexer (
agy_brain_memory.indexer):- Tracks
mtime_nsandfile_sizeper conversation transcript so unchanged sessions are skipped in sub-millisecond time. - Tolerates malformed or mid-write truncated JSONL lines without crashing.
- Indexes conversation steps, reasoning summaries, tool calls, and top-level Markdown artifacts (
task.md,implementation_plan.md,walkthrough.md).
- Tracks
- FTS5 BM25 Cross-Conversation Search & Subagent Lineage (
agy_brain_memory.search):- Sanitizes arbitrary punctuation/operator queries (
:,-,(),[],*) into safe FTS5 token queries. - Reconstructs parent-to-child
invoke_subagenttrees (parent_conv_id -> child_conv_id), subagent roles, prompts, and child final outcomes.
- Sanitizes arbitrary punctuation/operator queries (
- Brain Health Analyzer & Compact Session Digest (
agy_brain_memory.compactor):- Identifies empty/orphaned directories,
BigIntserialization failures, and stalledIN_PROGRESSsessions. - Exports token-budgeted Markdown handoff digests (
export_session_digest) withconversation://<conv-id>links.
- Identifies empty/orphaned directories,
- Turnkey Level-2 (L2) Antigravity Plugin & Stdio MCP Server (
agy_brain_memory.plugin_installer,agy_brain_memory.mcp_server):- Exposes 5 MCP tools (
agy_brain_sync,agy_brain_search,agy_brain_subagent_lineage,agy_brain_session_digest,agy_brain_health_report) with composite tool names guaranteed<= 64characters.
- Exposes 5 MCP tools (
Quickstart
# 1. Sync ~/.gemini/antigravity/brain into SQLite WAL + FTS5
python -m agy_brain_memory.cli sync
# 2. Search across all conversations and artifacts
python -m agy_brain_memory.cli search --query "HookMultiplexer CRIT-01"
# 3. Inspect subagent parent-child call graph
python -m agy_brain_memory.cli lineage --conv-id <conversation-uuid>
# 4. Export a compact session handoff digest (<= 2000 chars)
python -m agy_brain_memory.cli digest --conv-id <conversation-uuid> --max-chars 2000
# 5. Run brain storage health diagnostics
python -m agy_brain_memory.cli health
# 6. Install turnkey Level-2 native Antigravity plugin
python -m agy_brain_memory.cli install-plugin
# 7. Run the 4-sandbox benchmark suite
python -m agy_brain_memory.cli benchmark
License
MIT License — Copyright (c) 2026 orakulzero.
agy-brain-memory MCP questions
How does the indexer handle large amounts of data?
It uses incremental SQLite WAL and FTS5, tracking file modification times and sizes to skip unchanged sessions in sub-millisecond time.
Can I search for specific terms across all my conversations?
Yes, the FTS5 BM25 search allows you to query across all conversations and artifacts, even with complex punctuation.
What can I do with the session digest feature?
You can export token-budgeted Markdown handoff digests that include links to the original conversation.
Does it support tracking subagent relationships?
Yes, it reconstructs parent-to-child call graphs for subagents, including their roles, prompts, and outcomes.