knowledge-master 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- knowledge_master/__init__.py +0 -0
- knowledge_master/__main__.py +4 -0
- knowledge_master/chunking.py +106 -0
- knowledge_master/cli.py +344 -0
- knowledge_master/embeddings.py +21 -0
- knowledge_master/intelligence.py +254 -0
- knowledge_master/parsers/__init__.py +0 -0
- knowledge_master/parsers/git_repo.py +115 -0
- knowledge_master/parsers/markdown.py +58 -0
- knowledge_master/server.py +194 -0
- knowledge_master/store.py +164 -0
- knowledge_master/watcher.py +104 -0
- knowledge_master/web.py +568 -0
- knowledge_master-0.1.0.dist-info/METADATA +275 -0
- knowledge_master-0.1.0.dist-info/RECORD +19 -0
- knowledge_master-0.1.0.dist-info/WHEEL +5 -0
- knowledge_master-0.1.0.dist-info/entry_points.txt +3 -0
- knowledge_master-0.1.0.dist-info/licenses/LICENSE +21 -0
- knowledge_master-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: knowledge-master
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local-first knowledge graph for developers. Your AI agent's permanent memory.
|
|
5
|
+
Author: Milenko Mitrovic
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/subzone/knowledge-master
|
|
8
|
+
Project-URL: Repository, https://github.com/subzone/knowledge-master
|
|
9
|
+
Project-URL: Issues, https://github.com/subzone/knowledge-master/issues
|
|
10
|
+
Keywords: rag,knowledge-graph,mcp,ai,developer-tools,vector-search
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: falkordb<2.0,>=1.6.0
|
|
23
|
+
Requires-Dist: ollama<1.0,>=0.4.0
|
|
24
|
+
Requires-Dist: mcp<2.0,>=1.9.0
|
|
25
|
+
Requires-Dist: typer<1.0,>=0.15.0
|
|
26
|
+
Requires-Dist: gitpython<4.0,>=3.1.0
|
|
27
|
+
Requires-Dist: rich<15.0,>=14.0.0
|
|
28
|
+
Requires-Dist: fastapi<1.0,>=0.115.0
|
|
29
|
+
Requires-Dist: uvicorn<1.0,>=0.34.0
|
|
30
|
+
Provides-Extra: office
|
|
31
|
+
Requires-Dist: python-docx<2.0,>=1.1.0; extra == "office"
|
|
32
|
+
Requires-Dist: openpyxl<4.0,>=3.1.0; extra == "office"
|
|
33
|
+
Requires-Dist: pypdf<6.0,>=5.0; extra == "office"
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
36
|
+
Requires-Dist: ruff>=0.11; extra == "dev"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# β‘ Knowledge Master
|
|
40
|
+
|
|
41
|
+
**Your codebase's memory.** A local knowledge graph that gives AI agents real understanding of your architecture β not just text search.
|
|
42
|
+
|
|
43
|
+
[](LICENSE)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Why
|
|
48
|
+
|
|
49
|
+
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.
|
|
50
|
+
|
|
51
|
+
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.
|
|
52
|
+
|
|
53
|
+
## What it does
|
|
54
|
+
|
|
55
|
+
- π **Semantic search** across all your code, docs, and configs
|
|
56
|
+
- πΈοΈ **Knowledge graph** β relationships between services, people, repos, technologies
|
|
57
|
+
- π₯ **Blast radius** β "what depends on this service/file/technology?"
|
|
58
|
+
- π **Convention enforcement** β detects and enforces your team's patterns
|
|
59
|
+
- π€ **MCP server** β plugs directly into AI agents (Kiro, Claude, Cursor)
|
|
60
|
+
- π₯οΈ **Web UI** β search, browse, visualize your knowledge graph
|
|
61
|
+
- π **Local-first** β nothing leaves your machine
|
|
62
|
+
|
|
63
|
+
## Prerequisites
|
|
64
|
+
|
|
65
|
+
| Dependency | macOS | Ubuntu/Debian | Windows |
|
|
66
|
+
|---|---|---|---|
|
|
67
|
+
| **Docker** | `brew install colima && colima start` or Docker Desktop | `sudo apt install docker.io docker-compose-plugin` | [Docker Desktop](https://docker.com/products/docker-desktop/) |
|
|
68
|
+
| **Ollama** | `brew install ollama && ollama serve` | `curl -fsSL https://ollama.com/install.sh \| sh` | [Ollama installer](https://ollama.com/download) |
|
|
69
|
+
| **Python 3.11+** | `brew install python@3.12` | `sudo apt install python3.12 python3.12-venv` | [python.org](https://python.org/downloads/) |
|
|
70
|
+
|
|
71
|
+
## Quick Start
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Install (pick one)
|
|
75
|
+
pip install knowledge-master # from PyPI
|
|
76
|
+
pipx install knowledge-master # isolated install (recommended)
|
|
77
|
+
|
|
78
|
+
# Or from source
|
|
79
|
+
git clone https://github.com/subzone/knowledge-master.git
|
|
80
|
+
cd knowledge-master
|
|
81
|
+
python3 -m venv .venv && source .venv/bin/activate
|
|
82
|
+
pip install -e .
|
|
83
|
+
|
|
84
|
+
# One command setup
|
|
85
|
+
km start
|
|
86
|
+
|
|
87
|
+
# Index your first repo
|
|
88
|
+
km index ~/path/to/your/project
|
|
89
|
+
|
|
90
|
+
# Search
|
|
91
|
+
km search "authentication flow"
|
|
92
|
+
|
|
93
|
+
# Check blast radius
|
|
94
|
+
km blast-radius postgres
|
|
95
|
+
|
|
96
|
+
# Start web UI with graph visualization
|
|
97
|
+
km serve
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Requirements:** Docker, Ollama, Python 3.11+
|
|
101
|
+
|
|
102
|
+
## Features
|
|
103
|
+
|
|
104
|
+
### Semantic Search with Graph Context
|
|
105
|
+
```bash
|
|
106
|
+
$ km search "how does auth work"
|
|
107
|
+
ββββββββββ¬βββββββββββββββββββββββ¬ββββββββββββββββββββββ¬βββββββββββββββββββββββ
|
|
108
|
+
β Score β Source β Context β Preview β
|
|
109
|
+
ββββββββββΌβββββββββββββββββββββββΌββββββββββββββββββββββΌβββββββββββββββββββββββ€
|
|
110
|
+
β 0.847 β src/auth/service.py β repo:myapp, by:Alex β JWT token validat... β
|
|
111
|
+
β 0.791 β docs/auth.md β repo:myapp β Authentication f... β
|
|
112
|
+
ββββββββββ΄βββββββββββββββββββββββ΄ββββββββββββββββββββββ΄βββββββββββββββββββββββ
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Blast Radius Analysis
|
|
116
|
+
```bash
|
|
117
|
+
$ km blast-radius auth-service
|
|
118
|
+
π₯ Blast radius: auth-service
|
|
119
|
+
βββ βοΈ user-service (Service, via DEPENDS_ON)
|
|
120
|
+
βββ βοΈ payment-service (Service, via DEPENDS_ON)
|
|
121
|
+
βββ π¦ frontend (Repo, via USES_SERVICE)
|
|
122
|
+
βββ π€ Alex (Person, via AUTHORED)
|
|
123
|
+
|
|
124
|
+
4 entities affected
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Convention Enforcement
|
|
128
|
+
```bash
|
|
129
|
+
$ km check-conventions ~/my-project
|
|
130
|
+
β src/ directory (structure)
|
|
131
|
+
β separate test directory (testing)
|
|
132
|
+
β snake_case files (file-naming)
|
|
133
|
+
β Repository pattern (design-pattern)
|
|
134
|
+
|
|
135
|
+
1 convention(s) violated
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Web UI & Graph Visualization
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
$ km serve
|
|
142
|
+
Knowledge Master UI β http://127.0.0.1:9999
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Interactive force-directed graph showing your entire knowledge topology:
|
|
146
|
+
- π¦ Repos (blue) β π§ Technologies (red)
|
|
147
|
+
- βοΈ Services (orange) β Dependencies
|
|
148
|
+
- π€ People β Authorship
|
|
149
|
+
- π Conventions (purple)
|
|
150
|
+
|
|
151
|
+
### MCP Integration (AI Agents)
|
|
152
|
+
|
|
153
|
+
Add to your Kiro/Claude agent config:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"mcpServers": {
|
|
158
|
+
"knowledge": {
|
|
159
|
+
"command": "km-server"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Your AI agent gets these tools:
|
|
166
|
+
- `search` β semantic search with graph context
|
|
167
|
+
- `blast_radius` β dependency analysis
|
|
168
|
+
- `check_conventions` β verify code follows team patterns
|
|
169
|
+
- `index_repo` β add new repos to the knowledge base
|
|
170
|
+
|
|
171
|
+
## Architecture
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
175
|
+
β Your AI Agent β
|
|
176
|
+
β (Kiro / Claude / Cursor) β
|
|
177
|
+
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
|
|
178
|
+
β MCP Protocol
|
|
179
|
+
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββ
|
|
180
|
+
β Knowledge Master β
|
|
181
|
+
β β
|
|
182
|
+
β ββββββββββββ ββββββββββββββ ββββββββββββββ β
|
|
183
|
+
β β Search β βBlast Radiusβ β Conventionsβ β
|
|
184
|
+
β ββββββ¬ββββββ βββββββ¬βββββββ βββββββ¬βββββββ β
|
|
185
|
+
β β β β β
|
|
186
|
+
β ββββββΌββββββββββββββββΌββββββββββββββββΌβββββββ β
|
|
187
|
+
β β FalkorDB (Graph + Vector) β β
|
|
188
|
+
β β β β
|
|
189
|
+
β β [Repo]ββUSES_TECHβββΆ[Tech] β β
|
|
190
|
+
β β β β β
|
|
191
|
+
β β βββDEFINES_SERVICEβββΆ[Service] β β
|
|
192
|
+
β β β β β β
|
|
193
|
+
β β βββFOLLOWSβββΆ[Convention] β β
|
|
194
|
+
β β β β β
|
|
195
|
+
β β [Person]ββAUTHOREDβββΆ[Document] β β
|
|
196
|
+
β β β β β
|
|
197
|
+
β β [Chunk + Embedding] β β
|
|
198
|
+
β βββββββββββββββββββββββββββββββββββββββββββββ β
|
|
199
|
+
β β
|
|
200
|
+
β βββββββββββββββββββββββββββββββββββββββββββββ β
|
|
201
|
+
β β Ollama (nomic-embed-text) β β
|
|
202
|
+
β βββββββββββββββββββββββββββββββββββββββββββββ β
|
|
203
|
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Commands
|
|
207
|
+
|
|
208
|
+
| Command | Description |
|
|
209
|
+
|---|---|
|
|
210
|
+
| `km start` | Boot Docker containers + pull embedding model |
|
|
211
|
+
| `km stop` | Stop containers |
|
|
212
|
+
| `km index <path>` | Index a git repo or docs directory |
|
|
213
|
+
| `km search <query>` | Semantic search with graph context |
|
|
214
|
+
| `km blast-radius <target>` | Show dependencies and affected entities |
|
|
215
|
+
| `km check-conventions <path>` | Verify code follows detected patterns |
|
|
216
|
+
| `km list` | Show indexed repos, techs, stats |
|
|
217
|
+
| `km remove <name>` | Remove a source from the knowledge base |
|
|
218
|
+
| `km serve` | Start web UI at http://127.0.0.1:9999 |
|
|
219
|
+
| `km status` | Check system health |
|
|
220
|
+
|
|
221
|
+
## What gets extracted automatically
|
|
222
|
+
|
|
223
|
+
When you index a repo, Knowledge Master detects:
|
|
224
|
+
|
|
225
|
+
| Category | Examples |
|
|
226
|
+
|---|---|
|
|
227
|
+
| **Tech stack** | Languages, frameworks, packages from dependency files |
|
|
228
|
+
| **Services** | From docker-compose.yml and K8s manifests |
|
|
229
|
+
| **Dependencies** | Service-to-service relationships |
|
|
230
|
+
| **Conventions** | File naming (snake_case/kebab-case), folder structure, design patterns |
|
|
231
|
+
| **People** | Git commit authors and file ownership |
|
|
232
|
+
| **Code structure** | Functions, classes, chunked by AST-aware boundaries |
|
|
233
|
+
|
|
234
|
+
## Comparison
|
|
235
|
+
|
|
236
|
+
| Feature | Knowledge Master | Generic RAG | GitHub Copilot | Glean |
|
|
237
|
+
|---|---|---|---|---|
|
|
238
|
+
| Graph relationships | β
| β | β | Partial |
|
|
239
|
+
| Blast radius analysis | β
| β | β | β |
|
|
240
|
+
| Convention enforcement | β
| β | β | β |
|
|
241
|
+
| Local-first (no cloud) | β
| β
| β | β |
|
|
242
|
+
| MCP integration | β
| β | β | β |
|
|
243
|
+
| Multi-repo intelligence | β
| Partial | β | β
|
|
|
244
|
+
| Cost | Free | Free | $19/mo | $15-30/mo |
|
|
245
|
+
|
|
246
|
+
## Development
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Run tests
|
|
250
|
+
pytest
|
|
251
|
+
|
|
252
|
+
# Lint
|
|
253
|
+
ruff check knowledge_master/
|
|
254
|
+
|
|
255
|
+
# Run MCP server directly
|
|
256
|
+
python -m knowledge_master.server
|
|
257
|
+
|
|
258
|
+
# Run CLI directly
|
|
259
|
+
python -m knowledge_master.cli status
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Troubleshooting
|
|
263
|
+
|
|
264
|
+
| Issue | Fix |
|
|
265
|
+
|---|---|
|
|
266
|
+
| `km start` fails with "Docker not running" | Start Docker: `colima start` (macOS) or `sudo systemctl start docker` (Linux) |
|
|
267
|
+
| `km start` fails with "Ollama not found" | Install Ollama from https://ollama.com and run `ollama serve` |
|
|
268
|
+
| `km index` is slow | First run downloads the embedding model (~274MB). Subsequent runs are fast. |
|
|
269
|
+
| Web UI shows "Connection refused" | Make sure containers are running: `km start` |
|
|
270
|
+
| Search returns poor results | Index more content. Quality improves with more context in the graph. |
|
|
271
|
+
| Port 9999 already in use | Use `km serve --port 8888` |
|
|
272
|
+
|
|
273
|
+
## License
|
|
274
|
+
|
|
275
|
+
MIT
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
knowledge_master/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
knowledge_master/__main__.py,sha256=ascEuJ4Ydlmo-iAW3yo4mVGarLsCiMwIS4cu7TgYNRk,79
|
|
3
|
+
knowledge_master/chunking.py,sha256=BkfmlM5WBfinn91Vsx0seBnpC2d5gT19RRGdQhet2yw,3412
|
|
4
|
+
knowledge_master/cli.py,sha256=kL5Bjp29NlDEix6lnPJovKWjnvTNAE0ToOWFYCZCRII,12680
|
|
5
|
+
knowledge_master/embeddings.py,sha256=mrjSNeh_pHg0V9AkxpHD1_7AQBD_MLVXJE-gpghk5q0,629
|
|
6
|
+
knowledge_master/intelligence.py,sha256=hm4qOQGROOEa1PJ_yRNDzzRmak3n6NCQMdHNnBjYDdU,9987
|
|
7
|
+
knowledge_master/server.py,sha256=A2cR0S9QZ1UriRfk1cWsEtUCXQis5-jLF7DashAJDi0,7692
|
|
8
|
+
knowledge_master/store.py,sha256=GT-CMiXTHppiENzxRlmXLlNsYmiUYga6mcA_6wNUZCQ,5637
|
|
9
|
+
knowledge_master/watcher.py,sha256=9TVOm8O7iAnpdQANryCGTe-FmVlJIIw3AJVInpx7K5c,3354
|
|
10
|
+
knowledge_master/web.py,sha256=B_CpokEW3vFoB12jmjYVzmm8Nh5o0sWV4FlssTSygQg,26461
|
|
11
|
+
knowledge_master/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
knowledge_master/parsers/git_repo.py,sha256=M2E1e4fkNdVqcXYHxbuJu85PwHG1P4K2rQy0scKW6jk,3804
|
|
13
|
+
knowledge_master/parsers/markdown.py,sha256=gtpJHlJt1l4ZM8O8EZgS2svf4RA7mh040P2mBBm4c9s,1813
|
|
14
|
+
knowledge_master-0.1.0.dist-info/licenses/LICENSE,sha256=k8iRlncDZZI9fHjoCQQ7BQoFRrxyrQ4cnKJf_z4nyVY,1073
|
|
15
|
+
knowledge_master-0.1.0.dist-info/METADATA,sha256=9jdKEFo0wanaF5OkFHFm12OfL5iwkABj3mMYmPbQQbo,11504
|
|
16
|
+
knowledge_master-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
17
|
+
knowledge_master-0.1.0.dist-info/entry_points.txt,sha256=QSbaSSsZsKpHD7A9o9XHwbyoy2tshSLsqCfPOBIn3Qk,89
|
|
18
|
+
knowledge_master-0.1.0.dist-info/top_level.txt,sha256=Bj6XTrpApc4mQFqLdLoYLM7tHRthRfnZQ0AxE-eD6VY,17
|
|
19
|
+
knowledge_master-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Milenko Mitrovic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
knowledge_master
|