{"id":51616714,"url":"https://github.com/shdra06/ai-mind-map","last_synced_at":"2026-07-12T14:02:07.277Z","repository":{"id":366817762,"uuid":"1277976336","full_name":"shdra06/ai-mind-map","owner":"shdra06","description":"🧠 MCP Server that reduces AI coding agent token usage by 80-99%. Knowledge graph + persistent memory + smart compression for Claude, Cursor, Copilot, and any MCP-compatible agent.","archived":false,"fork":false,"pushed_at":"2026-07-09T16:11:06.000Z","size":2658,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-09T16:13:30.012Z","etag":null,"topics":["ai","claude","coding-assistant","context-management","copilot","cursor","knowledge-graph","llm","mcp","mcp-server","pagerank","persistent-memory","sqlite","token-optimization","tree-sitter"],"latest_commit_sha":null,"homepage":"https://github.com/shdra06/ai-mind-map#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shdra06.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-23T10:57:34.000Z","updated_at":"2026-07-09T16:11:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/shdra06/ai-mind-map","commit_stats":null,"previous_names":["shdra06/ai-mind-map"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/shdra06/ai-mind-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shdra06%2Fai-mind-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shdra06%2Fai-mind-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shdra06%2Fai-mind-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shdra06%2Fai-mind-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shdra06","download_url":"https://codeload.github.com/shdra06/ai-mind-map/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shdra06%2Fai-mind-map/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35393398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","claude","coding-assistant","context-management","copilot","cursor","knowledge-graph","llm","mcp","mcp-server","pagerank","persistent-memory","sqlite","token-optimization","tree-sitter"],"created_at":"2026-07-12T14:02:06.097Z","updated_at":"2026-07-12T14:02:07.276Z","avatar_url":"https://github.com/shdra06.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003e🧠 AI Mind Map\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cstrong\u003eMCP Server that reduces AI coding agent token usage by 80-99%\u003c/strong\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/shdra06/ai-mind-map/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/shdra06/ai-mind-map/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/shdra06/ai-mind-map/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/shdra06/ai-mind-map?label=release\" alt=\"Release\"\u003e\u003c/a\u003e\n    \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/shdra06/ai-mind-map\" alt=\"License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/ai-mind-map\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/ai-mind-map\" alt=\"npm\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/ai-mind-map\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/ai-mind-map\" alt=\"npm downloads\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    Stop wasting tokens re-reading your codebase. Give your AI agent a persistent memory.\n  \u003c/p\u003e\n\u003c/p\u003e\n\n---\n\n## 🌐 Live Website\n\n**[ai-mind-map-website.vercel.app](https://ai-mind-map-website.vercel.app)** — Interactive landing page with a live D3.js knowledge graph of the real codebase (120 nodes, 300 edges), token savings calculator, tools explorer, and one-command install wizard.\n\n---\n\n## 🧪 TestSprite Hackathon — Season 3\n\nThis project is a submission for the **TestSprite Season 3 Hackathon**. The TestSprite verification loop ran against the live website across 2 rounds, finding and fixing **4 real product bugs**.\n\n| Test | Priority | Status |\n|------|----------|--------|\n| Live brain graph renders real codebase data | P0 | ✅ passed |\n| Homepage hero + comparison cards | P0 | ⚠️ inconclusive (agent: PASS, D3 render overhead) |\n| Tools explorer search filtering | P1 | ✅ passed |\n| Token savings calculator sliders | P1 | ✅ passed |\n| Install wizard agent switching | P1 | ✅ passed |\n| Full site navigation | P2 | ✅ passed |\n\n**Bugs found by TestSprite:**\n- 🐛 Brain graph search input had no ARIA — invisible to accessibility tree\n- 🐛 Install page: 3 identical `Copy` buttons with no unique identifiers\n- 🐛 D3 drag handler fired on every mousedown — hover selected nodes incorrectly\n- 🐛 Homepage hero + CTA both had identical `Copy` buttons — agent blocked\n\nSee [`LOOP.md`](./LOOP.md) for the full iteration log, root cause analysis, and fixes.\n\n**CI/CD:** TestSprite runs automatically on every push via [GitHub Actions](./.github/workflows/testsprite.yml).\n\n---\n\n## ⚡ Install in One Command\n\n```bash\nnpx ai-mind-map install\n```\n\n\u003e Auto-detects Claude, Cursor, VS Code, Windsurf, Antigravity, Zed, Continue.dev — configures all of them instantly. **No config files. No manual setup. Just run and restart your agent.**\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#-quick-start\"\u003eQuick Start\u003c/a\u003e •\n  \u003ca href=\"#-how-it-works\"\u003eHow It Works\u003c/a\u003e •\n  \u003ca href=\"#-50-mcp-tools\"\u003eAll 50+ Tools\u003c/a\u003e •\n  \u003ca href=\"#-connect-to-your-ai-agent\"\u003eConnect\u003c/a\u003e •\n  \u003ca href=\"#-cli-commands\"\u003eCLI\u003c/a\u003e •\n  \u003ca href=\"#-configuration\"\u003eConfig\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n\n## ❓ The Problem\n\nEvery time an AI coding agent (Claude Code, Cursor, Copilot, Windsurf, Antigravity) processes a request, it **re-reads your entire codebase from scratch**. This wastes massive amounts of tokens:\n\n```\nWithout AI Mind Map:\n  ❌ Agent reads auth.ts        → 5,000 tokens\n  ❌ Agent reads auth.ts AGAIN  → 5,000 tokens (same file!)\n  ❌ Agent reads auth.ts AGAIN  → 5,000 tokens (still the same file!)\n  Total: 15,000 tokens for 3 questions about ONE file\n\nWith AI Mind Map:\n  ✅ mindmap_get_signature(\"authenticate\")        → 50 tokens\n  ✅ mindmap_get_signature(\"validateToken\")        → 40 tokens  \n  ✅ mindmap_trace_dependencies(\"authenticate\")    → 100 tokens\n  Total: 190 tokens — that's a 99% reduction\n```\n\n\u003e **Industry research shows ~42% of all tokens consumed by AI coding agents are avoidable waste** — repeated file reads, re-discovering architecture, re-debating settled decisions.\n\n---\n\n## ✨ What AI Mind Map Does\n\nAI Mind Map is an **MCP (Model Context Protocol) server** that gives your AI agent:\n\n| Feature | What It Does | Token Savings |\n|---------|-------------|---------------|\n| 🗺️ **Knowledge Graph** | Parses your entire codebase into a queryable graph of functions, classes, and relationships | **99%** |\n| 📝 **Change Tracker** | Knows exactly what changed since the AI's last session | **80%** |\n| 🧠 **Persistent Memory** | Remembers architecture decisions, conventions, and context across sessions | **90%** |\n| 🗜️ **Smart Compression** | Compresses build logs, test output, stack traces intelligently | **50-98%** |\n| 📊 **Progressive Loading** | Loads only what's needed — signatures first, full code only when asked | **90%** |\n| ⚡ **Real-time Sync** | File watcher keeps the graph updated as you code | Always fresh |\n\n### Inspired By The Best\n\nThis project combines proven techniques from:\n\n| Source | Technique | Their Result |\n|--------|-----------|-------------|\n| [codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) | Knowledge Graph + SQLite | 99% reduction (120x fewer tokens) |\n| [Aider](https://github.com/Aider-AI/aider) | PageRank-based Repo Map | 90%+ reduction |\n| [Mem0](https://github.com/mem0ai/mem0) | Persistent Memory with Decay | 3-4x cost reduction |\n| [context-mode](https://github.com/mksglu/context-mode) | Context Sandboxing + BM25 | 98% context reduction |\n| [context-mem](https://github.com/context-mem/context-mem) | Progressive Disclosure | 90%+ savings |\n\n---\n\n## 🚀 Quick Start\n\n### Method 1: Global Install (Recommended — Most Reliable)\n\n```bash\nnpm install -g ai-mind-map\n\n# Auto-detect and configure all your AI agents\nai-mind-map install\n\n# Check everything is working\nai-mind-map doctor\n```\n\n### Method 2: npx (Quick — No Install)\n\n```bash\n# Run directly without installing anything\nnpx ai-mind-map install\n\n# ⚠️ If you get \"bindings.js\" errors, use Method 1 instead (npx cache can corrupt native modules)\n```\n\n### Method 3: Clone (For Development)\n\n```bash\ngit clone https://github.com/shdra06/ai-mind-map.git\ncd ai-mind-map\nnpm install --legacy-peer-deps\nnpm run build\nnode dist/cli.js install\n```\n\n### What `install` Does\n\n1. ✅ Scans your system for AI coding agents (Claude, Cursor, VS Code, Windsurf, Antigravity, Zed, Continue.dev)\n2. ✅ Writes MCP config to each agent's config file  \n3. ✅ Deploys rules files so agents know about our 41 tools\n4. ✅ Runs diagnostics to verify everything works\n\n### Verify It Works\n\n```bash\nai-mind-map doctor\n```\n\nOutput:\n```\n🩺 AI Mind Map — Diagnostics\n────────────────────────────────────────────────────────\n  ✔ Node.js           v24.x (\u003e= 18 required)\n  ✔ SQLite             In-memory test passed\n  ✔ TypeScript Build   dist/index.js exists\n  ✔ Agents             3 detected, 3 configured\n```\n\n---\n\n## 🔌 Connect To Your AI Agent\n\n### Automatic (Recommended)\n\n```bash\nnpm install -g ai-mind-map\nai-mind-map install\n```\n\nThis auto-detects **all 7 agents** and writes the config for you. Done.\n\n### What Gets Written\n\nAfter running `install`, each agent's config file contains:\n\n```json\n{\n  \"mcpServers\": {\n    \"ai-mind-map\": {\n      \"command\": \"ai-mind-map\",\n      \"args\": []\n    }\n  }\n}\n```\n\n\u003e **💡 Note:** If you installed globally, the command is `ai-mind-map`. If using npx, it writes `\"command\": \"npx\", \"args\": [\"-y\", \"ai-mind-map\"]`. Both work, but global is more reliable for native dependencies.\n\n### Manual Setup (If You Prefer)\n\nIf you want to configure manually, add this to your agent's config:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude Code\u003c/b\u003e — \u003ccode\u003e~/.claude/claude_desktop_config.json\u003c/code\u003e\u003c/summary\u003e\n\n```json\n{\n  \"mcpServers\": {\n    \"ai-mind-map\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ai-mind-map\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCursor\u003c/b\u003e — \u003ccode\u003e~/.cursor/mcp.json\u003c/code\u003e\u003c/summary\u003e\n\n```json\n{\n  \"mcpServers\": {\n    \"ai-mind-map\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ai-mind-map\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eVS Code\u003c/b\u003e — Settings JSON (\u003ccode\u003eCtrl+Shift+P\u003c/code\u003e → \"Open User Settings JSON\")\u003c/summary\u003e\n\n```json\n{\n  \"mcp.servers\": {\n    \"ai-mind-map\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ai-mind-map\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAntigravity (Gemini)\u003c/b\u003e — \u003ccode\u003e~/.gemini/config/mcp.json\u003c/code\u003e\u003c/summary\u003e\n\n```json\n{\n  \"mcpServers\": {\n    \"ai-mind-map\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ai-mind-map\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eWindsurf\u003c/b\u003e — Settings JSON\u003c/summary\u003e\n\n```json\n{\n  \"mcp.servers\": {\n    \"ai-mind-map\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ai-mind-map\"]\n    }\n  }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAny MCP-Compatible Agent\u003c/b\u003e\u003c/summary\u003e\n\n```\nCommand:   npx\nArgs:      -y ai-mind-map\nTransport: stdio\n```\n\u003c/details\u003e\n\n\u003e **💡 After configuring, restart your AI agent so it picks up the new MCP server.**\n\n---\n\n## 🔧 50+ MCP Tools\n\nOnce connected, your AI agent automatically gets all tools + a built-in guide telling it **which tool to call first and when to use each one**.\n\n### How AI Agents Discover Our Tools\n\n```\nAI Agent connects → Server sends 3 things:\n\n1. ✅ instructions    → \"Call mindmap_session_resume FIRST\" (auto-loaded)\n2. ✅ tools/list      → All 50 tools with descriptions + schemas (auto-loaded)\n3. ✅ prompts/list    → Interactive guides (on request)\n```\n\n### 🌐 Client Compatibility\n\n| Client | Works? | How AI Learns Our Tools |\n|--------|:------:|------------------------|\n| **Claude Code / Desktop** | ✅ | `instructions` + `tools/list` + prompts + rules file (CLAUDE.md) |\n| **Cursor** | ✅ | `tools/list` + rules file (.cursorrules) |\n| **VS Code Copilot** | ✅ | `tools/list` + rules file (.github/copilot-instructions.md) |\n| **Windsurf** | ✅ | `tools/list` + rules file (.windsurfrules) |\n| **Antigravity (Gemini)** | ✅ | `tools/list` + rules file (.agents/AGENTS.md) |\n| **Zed** | ✅ | `tools/list` + MCP config |\n| **Continue.dev** | ✅ | `tools/list` + MCP config |\n| **Any MCP client** | ✅ | `tools/list` (universal MCP spec) |\n| **Ollama / LM Studio** | ⚠️ | Not MCP clients natively — use via Continue.dev or Open WebUI |\n| **Codex (OpenAI)** | ⚠️ | Not MCP natively — requires MCP bridge |\n\n\u003e **Key**: `tools/list` works with **every** MCP client. Rules files (`CLAUDE.md`, `.cursorrules`, etc.) are deployed by `npx ai-mind-map install` as a fallback for clients that don't honor the `instructions` field.\n\n---\n\n### ⚡ Code Memory Engine (v1.4.0) — **NEW**\n\n| Tool | What It Does | Token Savings |\n|------|-------------|:---:|\n| `mindmap_session_resume` ⭐⭐ | **Resume from last session** — returns what was worked on, what changed, project stats | 15-30K/session |\n| `mindmap_session_start` | Start tracking a new AI coding task | — |\n| `mindmap_session_end` | End session with summary for next agent | — |\n| `mindmap_changelog` ⭐ | **Symbol-level diffs** — added/modified/deleted functions since a time | 20-50K/session |\n| `mindmap_hotspots` | Most frequently changed files + symbols | 5-10K |\n| `mindmap_digest` ⭐ | **Full project summary in \u003c2000 tokens** | 10-25K/session |\n| `mindmap_file_digest` ⭐ | Understand a file WITHOUT reading it | 3-10K/file |\n| `mindmap_verify` | Hash-based content verification — check if cached code is still valid | 3-10K/file |\n\n### 🗺️ Knowledge Graph (6)\n\n| Tool | What It Does |\n|------|-------------|\n| `mindmap_search` | Search codebase by function/class name or free text |\n| `mindmap_get_structure` | Project architecture overview in ~100 tokens |\n| `mindmap_trace_dependencies` | Trace call chains — who calls what |\n| `mindmap_get_signature` | Function signature without reading the file |\n| `mindmap_find_references` | Find everywhere a symbol is used |\n| `mindmap_get_file_map` | All symbols in a file with line ranges |\n\n### ⭐ Smart Tools (3) — **99% Token Savings**\n\n| Tool | What It Does |\n|------|-------------|\n| `mindmap_explain` | **Everything about a symbol in 1 call** — signature, callers, callees, layer, blast radius, git history |\n| `mindmap_git_changes` | **Git-aware symbol-level diffs** — which functions changed, who's impacted |\n| `mindmap_smart_search` | **Rich search** — returns full context so AI never reads files |\n\n### 🔍 Semantic Search (3)\n\n| Tool | What It Does |\n|------|-------------|\n| `mindmap_semantic_search` | Search by **meaning** — \"authentication\", \"error handling\", \"data validation\" |\n| `mindmap_semantic_stats` | Vocabulary size, index coverage |\n| `mindmap_synonyms` | Programming synonym lookup |\n\n### 📝 Change Tracking (3)\n\n| Tool | What It Does |\n|------|-------------|\n| `mindmap_what_changed` | Summary of recent code changes |\n| `mindmap_session_diff` | What changed since last AI session |\n| `mindmap_impact_analysis` | Blast radius of a change |\n\n### 🧠 Memory (5)\n\n| Tool | What It Does |\n|------|-------------|\n| `mindmap_recall` | Retrieve relevant memories |\n| `mindmap_remember` | Store a fact or convention |\n| `mindmap_get_decisions` | Past architectural decisions |\n| `mindmap_decide` | Record a new decision |\n| `mindmap_session_summary` | Previous session summaries |\n\n### 🔬 Advanced Analysis (7)\n\n| Tool | What It Does |\n|------|-------------|\n| `mindmap_query_graph` | Cypher-like graph queries |\n| `mindmap_dead_code` | Detect unused functions |\n| `mindmap_architecture` | Full architecture overview |\n| `mindmap_get_code_snippet` | Read source by symbol name |\n| `mindmap_search_code` | Grep-like text search |\n| `mindmap_list_projects` | List indexed projects |\n| `mindmap_health` | System diagnostics |\n\n### 🏗️ Flow Analysis (4)\n\n| Tool | What It Does |\n|------|-------------|\n| `mindmap_trace_flow` | Trace behavioral flows through layers |\n| `mindmap_interaction_map` | Full interaction map of the codebase |\n| `mindmap_classify_file` | Classify a file's architectural layer |\n| `mindmap_layer_overview` | Layer distribution overview |\n\n### 🔍 Debug (3)\n\n| Tool | What It Does |\n|------|-------------|\n| `mindmap_debug_changes` | Detailed change analysis |\n| `mindmap_file_before` | File content before changes |\n| `mindmap_file_history` | Full file change history |\n\n### 🧬 Self-Evolving (3)\n\n| Tool | What It Does |\n|------|-------------|\n| `mindmap_teach` | **AI teaches new patterns** — persists per-project |\n| `mindmap_get_learned` | View all rules the system has learned |\n| `mindmap_forget` | Remove a learned rule |\n\n---\n\n## 💻 CLI Commands\n\nAll commands work with `npx` (no install) or after global install (`npm install -g ai-mind-map`):\n\n```bash\n# Setup \u0026 Diagnostics\nnpx ai-mind-map install              # Auto-configure all AI agents\nnpx ai-mind-map doctor               # Check everything is working\nnpx ai-mind-map install --uninstall  # Remove configs from all agents\n\n# Index \u0026 Search\nnpx ai-mind-map index /path/to/project  # Index a codebase\nnpx ai-mind-map search \"authenticate\"   # Search the knowledge graph\nnpx ai-mind-map trace \"processOrder\"    # Trace call chains\n\n# Memory\nnpx ai-mind-map recall \"authentication\"  # Recall past knowledge\nnpx ai-mind-map remember \"We use JWT\"    # Store a convention\n\n# Status\nnpx ai-mind-map status               # Show index stats\nnpx ai-mind-map changes              # Show recent changes\n```\n\n---\n\n## ⚙️ Configuration\n\n### Project-Level Config (Optional)\n\nCreate a `.mindmap.json` file in your project root to customize behavior:\n\n```json\n{\n  \"languages\": [\"typescript\", \"python\", \"javascript\"],\n  \"ignore\": [\"node_modules\", \"dist\", \"*.test.*\", \"coverage\"],\n  \"tokenBudgets\": {\n    \"graphResults\": 2000,\n    \"changeSummary\": 1000,\n    \"memoryRetrieval\": 1500,\n    \"fileContent\": 3000,\n    \"totalContext\": 10000\n  },\n  \"memory\": {\n    \"maxMemories\": 500,\n    \"decayRate\": 0.95,\n    \"importanceThreshold\": 0.1,\n    \"maxDecisions\": 200\n  },\n  \"compression\": \"moderate\",\n  \"watchEnabled\": true\n}\n```\n\n### CLI Options\n\n```\nnode dist/index.js [options]\n\nOptions:\n  --project-root \u003cpath\u003e   Root of the project to index (default: auto-detect from git)\n  --db-path \u003cpath\u003e        SQLite database location (default: .mindmap/mindmap.db)\n  --log-level \u003clevel\u003e     debug | info | warn | error (default: info)\n```\n\n---\n\n## 🌐 Language Support\n\nTree-sitter AST parsing with automatic regex fallback:\n\n| Language | AST Parsing | Regex Fallback | Extracts |\n|----------|:-----------:|:--------------:|----------|\n| JavaScript | ✅ | ✅ | Functions, classes, imports, exports |\n| TypeScript | ✅ | ✅ | + Interfaces, types, enums, decorators |\n| Python | ✅ | ✅ | Functions, classes, decorators, docstrings |\n| Java | ✅ | ✅ | Classes, methods, interfaces, annotations |\n| Go | ✅ | ✅ | Functions, structs, interfaces, methods |\n| Rust | ✅ | ✅ | Functions, structs, traits, impls, enums |\n| C/C++ | ✅ | ✅ | Functions, classes, structs, macros |\n| C# | ✅ | ✅ | Classes, methods, interfaces, properties |\n| Ruby | ✅ | ✅ | Classes, modules, methods, blocks |\n| PHP | ✅ | ✅ | Classes, functions, traits, namespaces |\n| Bash | ✅ | ✅ | Functions, variables, aliases |\n| CSS/HTML | ✅ | ✅ | Selectors, classes, IDs |\n\n---\n\n## 🏗️ Architecture\n\n```\n┌─────────────────────────────────────────────────────┐\n│              AI Mind Map MCP Server                  │\n│                                                       │\n│  ┌─────────────────┐  ┌────────────────┐  ┌────────┐ │\n│  │ Knowledge Graph  │  │ Change Tracker │  │ Memory │ │\n│  │ ─────────────── │  │ ────────────── │  │ ────── │ │\n│  │ Tree-sitter AST │  │ Chokidar Watch │  │  Mem0  │ │\n│  │ SQLite + FTS5   │  │ Git Diff       │  │  Style │ │\n│  │ PageRank        │  │ BM25 Search    │  │ Decay  │ │\n│  └────────┬────────┘  └───────┬────────┘  └───┬────┘ │\n│           │                   │                │      │\n│  ┌────────┴───────────────────┴────────────────┴────┐ │\n│  │              Context Engine                       │ │\n│  │  Content-Aware Compression (9 types)              │ │\n│  │  Progressive Disclosure (3 tiers)                 │ │\n│  │  Token Budget Manager                             │ │\n│  └──────────────────────┬────────────────────────────┘ │\n│                         │                               │\n│                  41 MCP Tools                           │\n└─────────────────────────┼───────────────────────────────┘\n                          │ stdio\n                ┌─────────┴──────────┐\n                │   Your AI Agent    │\n                │  Claude / Cursor / │\n                │ Copilot / Windsurf │\n                └────────────────────┘\n```\n\n### How the Memory System Works\n\nAI Mind Map uses a **three-tier memory architecture** (inspired by cognitive science):\n\n| Layer | What | Token Cost | Lifespan |\n|-------|------|-----------|----------|\n| **Working Memory** | Current task context | Full price | This conversation |\n| **Episodic Memory** | Session summaries, recent decisions | On-demand retrieval | Days to weeks |\n| **Semantic Memory** | Codebase graph, architecture, conventions | Queried, never dumped | Permanent (with decay) |\n\nMemories have **importance scores** that:\n- 📈 **Increase** when accessed (+0.1 per access, capped at 1.0)\n- 📉 **Decay** over time (configurable, default 5% per day)\n- 🗑️ **Get pruned** when importance drops below threshold\n\nThis means frequently-useful memories stick around, while stale ones naturally fade.\n\n---\n\n## 📊 Expected Token Savings\n\n| Scenario | Without Mind Map | With Mind Map | Savings |\n|----------|:----------------:|:-------------:|:-------:|\n| Find a function signature | ~5,000 tokens | ~50 tokens | **99%** |\n| Understand project structure | ~50,000 tokens | ~500 tokens | **99%** |\n| Resume after session break | ~20,000 tokens | ~2,000 tokens | **90%** |\n| Trace dependency chain | ~30,000 tokens | ~200 tokens | **99%** |\n| Check what changed | ~10,000 tokens | ~500 tokens | **95%** |\n| Compress build log | ~8,000 tokens | ~400 tokens | **95%** |\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Here's how:\n\n1. Fork the repo\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Make your changes\n4. Run the build: `npm run build`\n5. Commit: `git commit -m \"Add amazing feature\"`\n6. Push: `git push origin feature/amazing-feature`\n7. Open a Pull Request\n\n### Development\n\n```powershell\n# Watch mode (auto-recompile on changes)\nnpm run dev\n\n# Type check without building\nnpx tsc --noEmit\n\n# Run the server locally\nnode dist/index.js --project-root . --log-level debug\n```\n\n---\n\n## 📄 License\n\nMIT — use it however you want. See [LICENSE](LICENSE).\n\n---\n\n## 🙏 Acknowledgments\n\nBuilt on the shoulders of giants:\n\n- [codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) — Knowledge graph architecture (99% token reduction)\n- [Aider](https://github.com/Aider-AI/aider) — Repository map with PageRank ranking\n- [Mem0](https://github.com/mem0ai/mem0) — Persistent memory with importance decay\n- [context-mode](https://github.com/mksglu/context-mode) — Context sandboxing with BM25\n- [context-mem](https://github.com/context-mem/context-mem) — Progressive disclosure patterns\n- [CocoIndex](https://github.com/cocoindex-io/cocoindex-code) — Incremental AST indexing\n- [Repomix](https://github.com/yamadashy/repomix) — Codebase compression techniques\n- [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) — Multi-language AST parsing\n- [MCP Protocol](https://modelcontextprotocol.io) — The standard that makes this possible\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003e⭐ Star this repo if it saves you tokens!\u003c/strong\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshdra06%2Fai-mind-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshdra06%2Fai-mind-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshdra06%2Fai-mind-map/lists"}