Knowledge Master
Knowledge Master provides AI agents with graph-aware access to a knowledge base built from codebases and documentation, enabling semantic search, dependency analysis, convention enforcement, and risk assessment.
search— Perform natural language semantic search across the knowledge base, with optional graph context (authors, repos, related docs) and filtering by source type (code, docs, infra, etc.).index_repo— Index a git repository into the knowledge graph, parsing code, extracting authors, and building relationships.index_directory— Ingest markdown and text files from a directory using customizable glob patterns.get_status— Retrieve knowledge base statistics: number of chunks, documents, and indexed repositories.blast_radius— Discover all entities (services, technologies, files) that depend on a given target, showing the impact of a potential change.check_conventions— Verify whether a repo or directory follows detected coding conventions (naming, structure, design patterns), returning pass/fail per convention.safe_to_change— Assess the risk of modifying a file or module by combining blast radius analysis with test coverage data.who_owns— Identify ownership of a specific file based onOWNSrelationships in the knowledge graph.
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., "@Knowledge Master search how authentication works"
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.
⚡ Knowledge Master
Your codebase's memory. A local knowledge graph that gives AI agents real understanding of your architecture — not just text search.
Why
Every time you start a new AI chat, it forgets everything. You re-explain your architecture, conventions, dependencies. Knowledge Master gives your AI permanent, structured memory about your entire system.
Unlike flat RAG tools that return "chunks about X", Knowledge Master builds a graph — so it can answer "what breaks if I change X?" by traversing actual relationships.
Related MCP server: Mnemograph
What it does
🔍 Semantic search across all your code, docs, and configs
🕸️ Knowledge graph — relationships between services, people, repos, technologies
💥 Blast radius — "what depends on this service/file/technology?"
📏 Convention enforcement — detects and enforces your team's patterns
🤖 MCP server — plugs directly into AI agents (Kiro, Claude, Cursor)
🖥️ Web UI — search, browse, visualize your knowledge graph
🔒 Local-first — nothing leaves your machine
Prerequisites
Dependency | macOS | Ubuntu/Debian | Windows |
Docker |
|
| |
Ollama |
|
| |
Python 3.11+ |
|
|
Quick Start
# Install (pick one)
pipx install knowledge-master # recommended (isolated, clean)
pip install knowledge-master # or with pip
# Or via Homebrew (macOS)
brew install pipx && pipx install knowledge-master
# Or from source
git clone https://github.com/subzone/knowledge-master.git
cd knowledge-master
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
# One command setup
km start
# Index your first repo
km index ~/path/to/your/project
# Search
km search "authentication flow"
# Check blast radius
km blast-radius postgres
# Start web UI with graph visualization
km serveRequirements: Docker, Ollama, Python 3.11+
Features
Semantic Search with Graph Context
$ km search "how does auth work"
┌────────┬──────────────────────┬─────────────────────┬──────────────────────┐
│ Score │ Source │ Context │ Preview │
├────────┼──────────────────────┼─────────────────────┼──────────────────────┤
│ 0.847 │ src/auth/service.py │ repo:myapp, by:Alex │ JWT token validat... │
│ 0.791 │ docs/auth.md │ repo:myapp │ Authentication f... │
└────────┴──────────────────────┴─────────────────────┴──────────────────────┘Blast Radius Analysis
$ km blast-radius auth-service
💥 Blast radius: auth-service
├── ⚙️ user-service (Service, via DEPENDS_ON)
├── ⚙️ payment-service (Service, via DEPENDS_ON)
├── 📦 frontend (Repo, via USES_SERVICE)
└── 👤 Alex (Person, via AUTHORED)
4 entities affectedConvention Enforcement
$ km check-conventions ~/my-project
✓ src/ directory (structure)
✓ separate test directory (testing)
✗ snake_case files (file-naming)
✓ Repository pattern (design-pattern)
1 convention(s) violatedWeb UI & Graph Visualization
$ km serve
Knowledge Master UI → http://127.0.0.1:9999Interactive force-directed graph showing your entire knowledge topology:
📦 Repos (blue) → 🔧 Technologies (red)
⚙️ Services (orange) → Dependencies
👤 People → Authorship
📏 Conventions (purple)
MCP Integration (AI Agents)
Add to your Kiro/Claude agent config:
{
"mcpServers": {
"knowledge": {
"command": "km-server"
}
}
}Your AI agent gets these tools:
search— semantic search with graph contextblast_radius— dependency analysischeck_conventions— verify code follows team patternsindex_repo— add new repos to the knowledge base
Architecture
┌─────────────────────────────────────────────────┐
│ Your AI Agent │
│ (Kiro / Claude / Cursor) │
└────────────────────┬────────────────────────────┘
│ MCP Protocol
┌────────────────────▼────────────────────────────┐
│ Knowledge Master │
│ │
│ ┌──────────┐ ┌────────────┐ ┌────────────┐ │
│ │ Search │ │Blast Radius│ │ Conventions│ │
│ └────┬─────┘ └─────┬──────┘ └─────┬──────┘ │
│ │ │ │ │
│ ┌────▼───────────────▼───────────────▼──────┐ │
│ │ FalkorDB (Graph + Vector) │ │
│ │ │ │
│ │ [Repo]──USES_TECH──▶[Tech] │ │
│ │ │ │ │
│ │ ├──DEFINES_SERVICE──▶[Service] │ │
│ │ │ │ │ │
│ │ ├──FOLLOWS──▶[Convention] │ │
│ │ │ │ │
│ │ [Person]──AUTHORED──▶[Document] │ │
│ │ │ │ │
│ │ [Chunk + Embedding] │ │
│ └───────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────┐ │
│ │ Ollama (nomic-embed-text) │ │
│ └───────────────────────────────────────────┘ │
└──────────────────────────────────────────────────┘Commands
Command | Description |
| Boot Docker + pull embedding model |
| Stop containers |
| Index a git repo or docs directory |
| Semantic search with re-ranking |
| Multi-layer dependency analysis |
| Risk assessment (safe/risky/dangerous) |
| File ownership (git blame, recency-weighted) |
| Verify code follows detected patterns |
| Pull from external MCP (email, Slack) |
| Auto-configure MCP for AI tools |
| File watcher with auto re-index |
| Migrate graph schema |
| Remove stale/orphaned data |
| Generate CHANGELOG.md |
| Show indexed repos, techs, stats |
| Remove a source |
| Start web UI at http://127.0.0.1:9999 |
| Check system health |
What gets extracted automatically
When you index a repo, Knowledge Master detects:
Category | Examples |
Tech stack | Languages, frameworks, packages from dependency files |
Services | From docker-compose.yml and K8s manifests |
Dependencies | Service-to-service relationships |
Conventions | File naming (snake_case/kebab-case), folder structure, design patterns |
People | Git commit authors and file ownership |
Code structure | Functions, classes, chunked by AST-aware boundaries |
Feature Status
Feature | Status | Notes |
Semantic search + re-ranking | ✅ Stable | Two-pass retrieval with confidence scoring |
Knowledge graph (FalkorDB) | ✅ Stable | Nodes, edges, vector index, schema versioning |
CLI (14 commands) | ✅ Stable | start, index, search, blast-radius, safe-to-change, who-owns, etc. |
MCP server (8 tools) | ✅ Stable | search, blast_radius, safe_to_change, who_owns, check_conventions, index, status |
REST API | ✅ Stable | /api/v1/ with OpenAPI docs |
Web UI + graph viz | ✅ Stable | htmx + D3, search, file browser, graph |
Git repo indexing | ✅ Stable | Parses code, extracts authors, detects tech stack |
Multi-language static analysis | ✅ Stable | Python (ast), TypeScript, Go, Rust (tree-sitter) |
Blast radius (multi-layer) | ✅ Stable | Imports → services → people, confidence levels |
| ✅ Stable | Blast radius + test coverage = risk score |
Git blame ownership | ✅ Stable | Recency-weighted (3x/2x/1x) |
Schema migrations | ✅ Stable | Auto-migrate, km upgrade |
Deduplication | ✅ Stable | Content hash, skips unchanged |
Convention detection | ⚡ Basic | Folder structure + file naming patterns |
Email connector (ms-365) | 🧪 Experimental | Works, requires external MCP setup |
| 🧪 Experimental | Polling-based, may change |
Legend: ✅ Stable — ⚡ Basic (works, limited scope) — 🧪 Experimental (may change)
Comparison
Feature | Knowledge Master | Generic RAG | GitHub Copilot | Glean |
Graph relationships | ✅ | ❌ | ❌ | Partial |
Blast radius analysis | ✅ | ❌ | ❌ | ❌ |
Convention enforcement | ✅ | ❌ | ❌ | ❌ |
Local-first (no cloud) | ✅ | ✅ | ❌ | ❌ |
MCP integration | ✅ | ❌ | ❌ | ❌ |
Multi-repo intelligence | ✅ | Partial | ❌ | ✅ |
Cost | Free | Free | $19/mo | $15-30/mo |
Development
# Run tests
pytest
# Lint
ruff check knowledge_master/
# Run MCP server directly
python -m knowledge_master.server
# Run CLI directly
python -m knowledge_master.cli statusSecurity
Knowledge Master runs entirely on your machine. No data leaves localhost.
All ports bound to
127.0.0.1(not accessible from LAN)Ollama runs locally — no cloud API calls
MCP server uses stdio (no network exposure)
Optional API key auth for REST endpoints
# Enable API key auth
export KM_API_KEY=$(openssl rand -hex 32)
km serveSee SECURITY.md for full security model, risks, and hardening guide.
Troubleshooting
Issue | Fix |
| Start Docker: |
| Install Ollama from https://ollama.com and run |
| First run downloads the embedding model (~274MB). Subsequent runs are fast. |
Web UI shows "Connection refused" | Make sure containers are running: |
Search returns poor results | Index more content. Quality improves with more context in the graph. |
Port 9999 already in use | Use |
License
MIT
Available Tools
8 toolsblast_radiusA
Show what depends on a target (service, tech, or file). Returns all entities that would be affected by changing the target.
Inputs: target (required).
check_conventionsB
Check if a repo or path follows the detected coding conventions (naming, structure, patterns). Returns pass/fail for each convention.
Inputs: path (required).
get_statusA
Get knowledge base statistics: number of chunks, documents, repos indexed.
Inputs: no named parameters.
index_directoryB
Index markdown/text files from a directory.
Inputs: path (required), patterns.
index_repoB
Index a git repository into the knowledge graph. Parses code files, extracts authors, builds relationships.
Inputs: path (required), branch.
safe_to_changeC
Assess risk of changing a target. Returns risk level, blast radius, and test coverage.
Inputs: target (required).
searchA
Semantic search across the knowledge base. Returns relevant chunks with source info and graph context (author, repo, related docs).
Inputs: query (required), top_k, source_type, use_graph.
who_ownsB
Find who owns a file based on OWNS relationships in the graph.
Inputs: file (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose: indexing, searching, impact analysis, ownership, conventions checking. Even similar tools like blast_radius and safe_to_change are differentiated by depth of analysis.
Tools use snake_case consistently. Most follow verb_noun pattern (index_directory, check_conventions), but some are noun-based (blast_radius, safe_to_change). Still predictable and readable.
8 tools is well-scoped for a knowledge management server. Each tool covers a core function without redundancy or bloat.
Covers indexing, search, impact analysis, conventions checking, and ownership. Missing delete or update operations for indexed data, but core read-oriented workflows are complete.
Maintenance
Related MCP Connectors
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Repository knowledge graph MCP server for codebase understanding and debugging.
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Persistent, portable memory for AI assistants — your private memory graph, from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA universal MCP server providing persistent, structured memory through a knowledge graph with graph storage, semantic vector search, and multi-hop traversal for AI agents and IDEs.18 PyPI1MIT
- AlicenseAqualityDmaintenanceA persistent, event-sourced knowledge graph MCP server for AI coding agents that enables semantic search, tiered context retrieval, and git-based version control of AI memory.31178 PyPI2MIT
- AlicenseNot gradedqualityBmaintenanceA persistent code-intelligence MCP server that builds a queryable knowledge graph of your codebase, enabling AI assistants to perform cross-file structural reasoning, dependency analysis, and blast radius detection.9MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that indexes codebases into a local knowledge graph, providing 52 AI tools for semantic search, call-graph traversal, git archaeology, and impact analysis to give AI agents deep understanding of code.2-