Local-first knowledge graph for developers. Your AI agent's permanent memory.
Project description
โก 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.
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 | brew install colima && colima start or Docker Desktop |
sudo apt install docker.io docker-compose-plugin |
Docker Desktop |
| Ollama | brew install ollama && ollama serve |
curl -fsSL https://ollama.com/install.sh | sh |
Ollama installer |
| Python 3.11+ | brew install python@3.12 |
sudo apt install python3.12 python3.12-venv |
python.org |
Quick Start
# Install (pick one)
pip install knowledge-master # from PyPI
pipx install knowledge-master # isolated install (recommended)
# 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 serve
Requirements: 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 affected
Convention 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) violated
Web UI & Graph Visualization
$ km serve
Knowledge Master UI โ http://127.0.0.1:9999
Interactive 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 |
|---|---|
km start |
Boot Docker + pull embedding model |
km stop |
Stop containers |
km index <path> |
Index a git repo or docs directory |
km search <query> |
Semantic search with re-ranking |
km blast-radius <target> |
Multi-layer dependency analysis |
km safe-to-change <target> |
Risk assessment (safe/risky/dangerous) |
km who-owns <file> |
File ownership (git blame, recency-weighted) |
km check-conventions <path> |
Verify code follows detected patterns |
km connect <source> |
Pull from external MCP (email, Slack) |
km setup <tool> |
Auto-configure MCP for AI tools |
km watch <path> |
File watcher with auto re-index |
km upgrade |
Migrate graph schema |
km prune |
Remove stale/orphaned data |
km changelog |
Generate CHANGELOG.md |
km list |
Show indexed repos, techs, stats |
km remove <name> |
Remove a source |
km serve |
Start web UI at http://127.0.0.1:9999 |
km status |
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 |
safe-to-change risk assessment |
โ 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 |
km watch |
๐งช 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 status
Security
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 serve
See SECURITY.md for full security model, risks, and hardening guide.
Troubleshooting
| Issue | Fix |
|---|---|
km start fails with "Docker not running" |
Start Docker: colima start (macOS) or sudo systemctl start docker (Linux) |
km start fails with "Ollama not found" |
Install Ollama from https://ollama.com and run ollama serve |
km index is slow |
First run downloads the embedding model (~274MB). Subsequent runs are fast. |
| Web UI shows "Connection refused" | Make sure containers are running: km start |
| Search returns poor results | Index more content. Quality improves with more context in the graph. |
| Port 9999 already in use | Use km serve --port 8888 |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file knowledge_master-1.0.2.tar.gz.
File metadata
- Download URL: knowledge_master-1.0.2.tar.gz
- Upload date:
- Size: 54.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b865235f5cedb66939064fbbd3dd8cffcf5fa7d77e94e69cf0eb9616a420183
|
|
| MD5 |
0fcd2edb081163b448b5c65b4e363bfe
|
|
| BLAKE2b-256 |
f81f5f9dc8df7d614f22bd71f4f3f2c3eddf67c80eb04dabb097520a9b03d8ef
|
Provenance
The following attestation bundles were made for knowledge_master-1.0.2.tar.gz:
Publisher:
publish.yml on subzone/knowledge-master
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
knowledge_master-1.0.2.tar.gz -
Subject digest:
3b865235f5cedb66939064fbbd3dd8cffcf5fa7d77e94e69cf0eb9616a420183 - Sigstore transparency entry: 1867477174
- Sigstore integration time:
-
Permalink:
subzone/knowledge-master@54ece9a9cbac6f02391ddf2b4f1d7541a286dabb -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/subzone
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54ece9a9cbac6f02391ddf2b4f1d7541a286dabb -
Trigger Event:
release
-
Statement type:
File details
Details for the file knowledge_master-1.0.2-py3-none-any.whl.
File metadata
- Download URL: knowledge_master-1.0.2-py3-none-any.whl
- Upload date:
- Size: 50.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d06968d0634457964a476478145e0b95780b84683b12798b3ec241b6bd14a7b6
|
|
| MD5 |
06d7039dbbaad8b757e8e054f9a721ba
|
|
| BLAKE2b-256 |
2610ac6683325f4bb2ca06a3775f79109ae1b11d5267ef6a196fab1535f71f2b
|
Provenance
The following attestation bundles were made for knowledge_master-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on subzone/knowledge-master
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
knowledge_master-1.0.2-py3-none-any.whl -
Subject digest:
d06968d0634457964a476478145e0b95780b84683b12798b3ec241b6bd14a7b6 - Sigstore transparency entry: 1867477380
- Sigstore integration time:
-
Permalink:
subzone/knowledge-master@54ece9a9cbac6f02391ddf2b4f1d7541a286dabb -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/subzone
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54ece9a9cbac6f02391ddf2b4f1d7541a286dabb -
Trigger Event:
release
-
Statement type: