Skip to main content

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.

License: MIT


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 context
  • blast_radius โ€” dependency analysis
  • check_conventions โ€” verify code follows team patterns
  • index_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 containers + pull embedding model
km stop Stop containers
km index <path> Index a git repo or docs directory
km search <query> Semantic search with graph context
km blast-radius <target> Show dependencies and affected entities
km check-conventions <path> Verify code follows detected patterns
km list Show indexed repos, techs, stats
km remove <name> Remove a source from the knowledge base
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

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

knowledge_master-0.1.0.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

knowledge_master-0.1.0-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

Details for the file knowledge_master-0.1.0.tar.gz.

File metadata

  • Download URL: knowledge_master-0.1.0.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for knowledge_master-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4a2064ad77b8d43895e7f4abe566c319bf58821667d71dde735afd950d74b620
MD5 8e20ab5822ed3247608d662c7604986f
BLAKE2b-256 fcd15e1515f6025a6d039cc62582c56f32c975b0b2a9b81e54aefb764120864b

See more details on using hashes here.

Provenance

The following attestation bundles were made for knowledge_master-0.1.0.tar.gz:

Publisher: publish.yml on subzone/knowledge-master

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file knowledge_master-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for knowledge_master-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8838dcf241cd340285c96c72a6f27a905d582b8e924cc37d702e409871fbd2a
MD5 17341d5e7fbc1134f7b25d1a79737293
BLAKE2b-256 f0ece5aface77651d774c5a666eb06b14402e9f43a7c1d294887ce217b2c4b87

See more details on using hashes here.

Provenance

The following attestation bundles were made for knowledge_master-0.1.0-py3-none-any.whl:

Publisher: publish.yml on subzone/knowledge-master

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page