Mimir is a Go-based code intelligence engine that indexes your repository into a knowledge graph and exposes it to AI agents via MCP, HTTP API, and an interactive web UI.
Mimir builds a searchable knowledge graph of your codebase that helps AI agents (and humans) understand it faster.
| Use Case | How Mimir Helps |
|---|---|
| AI Agents (MCP) | 7 tools for semantic search, impact analysis, and blast radius queries |
| Humans (Web UI) | Interactive force-directed graph to explore code structure visually |
| Teams (Refactors) | Impact analysis before editing — see what breaking changes affect |
| Metric | GitNexus (Node.js) | Mimir (Go) |
|---|---|---|
| Cold index (1,000 files) | ~45s | < 8s |
| Incremental re-index | ~45s (full) | < 2s |
| Hybrid search latency | ~300ms | < 80ms |
| Binary size | 350 MB | < 20 MB |
| RAM during index | ~800 MB | < 120 MB |
Key improvements: Pure Go (zero CGO), 8-language support (TS, JS, Go, Python, Rust, Java, C, C++), incremental indexing via git-diff, Louvain community detection, embedded web UI.
# One-line (Linux/macOS)
curl -fsSL https://raw.githubusercontent.com/thuongh2/git-mimir/main/install.sh | sh
# Or via Go
go install github.com/thuongh2/git-mimir/cmd/mimir@latest
# Or download binary from GitHub Releases# Full index with embeddings (requires ollama or OpenAI)
mimir analyze /path/to/your-project
# Faster — graph + BM25 only (no embeddings)
mimir analyze --skip-embeddings /path/to/your-project
# Skip auto-setup for manual control
mimir analyze --skip-daemon --skip-hooks --skip-skills /path/to/your-projectOption A: Web UI (Humans)
mimir serve
# Open http://localhost:7842Option B: MCP (AI Agents)
mimir daemon start # Start background MCP server
mimir setup # Auto-configure Claude Code, VS Code, Cursor, etc.| Method | Command |
|---|---|
| One-line (Linux/macOS) | `curl -fsSL https://raw.githubusercontent.com/thuongh2/git-mimir/main/install.sh |
| Go Install | go install github.com/thuongh2/git-mimir/cmd/mimir@latest |
| Download Binary | GitHub Releases |
| From Source | git clone && cd git-mimir && make build |
For detailed installation guide, see docs/installation.md.
| Command | Description |
|---|---|
mimir analyze <path> |
Index repository with auto-setup |
mimir serve |
Start HTTP server + Web UI (default: port 7842) |
mimir mcp |
Start MCP stdio server |
mimir daemon start/stop/status |
Manage background MCP daemon |
mimir daemon logs [lines] |
View daemon logs (default: 30 lines) |
mimir list |
List indexed repositories |
mimir status [name] |
Show index status |
mimir clean <name> |
Remove index for a repository |
mimir setup |
Configure MCP in all supported editors |
mimir wiki [name] |
Generate wiki from knowledge graph |
mimir analyze --skip-embeddings <path> # Skip embeddings (faster)
mimir analyze --skip-daemon <path> # Don't start MCP daemon
mimir analyze --skip-hooks <path> # Don't install Claude Code hooks
mimir analyze --skip-skills <path> # Don't install agent skills
mimir analyze --force <path> # Force full re-index
mimir analyze --incremental <path> # Force incremental mode
mimir analyze --hint <file> <path> # Hint for faster patch planningAI agents get access to 7 tools via MCP:
| Tool | Description | Example |
|---|---|---|
query |
Hybrid search (BM25 + vector) | "Find all auth-related processes" |
context |
360-degree symbol view | "Show handleRequest definition and callers" |
impact |
Blast radius analysis | "What breaks if I change UserService?" |
detect_changes |
Analyze uncommitted git changes | "What processes did my commit affect?" |
rename |
Plan coordinated multi-file rename | "Rename AuthController to SessionController" |
cypher |
Raw graph queries | "Find unused exported functions" |
list_repos |
List indexed repositories | — |
- Discovery: Use
query()for semantic search - Deep Dive: Use
context()to understand a symbol - Before Editing: Always run
impact()first
For detailed usage, see docs/guide.md.
Running mimir analyze automatically sets up:
- MCP Daemon — Background server for persistent MCP availability
- Editor Config — Auto-configures Claude Code, VS Code, Cursor, Windsurf, Zed, OpenCode
- Claude Code Hooks — Pre-search (graph-augmented search) and post-write (auto re-index)
- Agent Skills — 4 static methodology skills + dynamic module skills per cluster
- Context Files — AGENTS.md and CLAUDE.md with live index statistics
Log location: ~/.mimir/mimir-mcp.log
For complete feature documentation, see docs/features.md.
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Web UI |
| GET | /repos |
List indexed repos |
| GET | /repo/{name}/graph |
Full graph (nodes + edges) |
| GET | /repo/{name}/query?q=... |
Hybrid search |
| GET | /repo/{name}/context/{symbol} |
Symbol detail + edges |
| GET | /repo/{name}/impact/{target} |
Blast radius analysis |
| GET | /repo/{name}/clusters |
Louvain clusters |
| GET | /repo/{name}/processes |
Execution flow traces |
| POST | /repo/{name}/cypher |
Raw SQL query |
| Guide | Description |
|---|---|
| Installation | Detailed installation and setup |
| Usage Guide | Perfect workflow for daily use |
| Features | Complete feature reference |
| Architecture | System design and components |
| Algorithms | Louvain, BM25, HNSW details |
| Component | Technology |
|---|---|
| Language | Go 1.22+ |
| AST Parsing | smacker/go-tree-sitter |
| Storage | modernc.org/sqlite (pure Go) |
| Vector Search | sqlite-vec (HNSW) |
| Text Search | Custom BM25 |
| Clustering | Louvain algorithm |
| CLI | cobra |
| Web UI | Sigma.js v2 + Graphology |
mimir/
├── cmd/mimir/ # CLI entrypoint
├── api/ # HTTP server + embedded Web UI
├── mcp/ # MCP stdio server
├── internal/
│ ├── walker/ # File tree walker
│ ├── parser/ # AST parser (8 languages)
│ ├── resolver/ # Import/call resolver
│ ├── graph/ # Node/edge types
│ ├── store/ # SQLite layer
│ ├── embedder/ # Embedding pipeline
│ ├── cluster/ # Louvain detection
│ ├── process/ # Flow tracer
│ ├── incremental/ # Git-diff indexing
│ └── registry/ # Multi-repo registry
└── testdata/ # Test fixtures
Contributions welcome! See GitHub Issues for open tasks.
License: MIT