|
2 | 2 |
|
3 | 3 | ## High-level diagram |
4 | 4 |
|
5 | | -``` |
6 | | -┌──────────────────────────────────────────────────────────────────────┐ |
7 | | -│ CLI │ |
8 | | -│ src/cli/index.ts (Commander) │ |
9 | | -│ │ |
10 | | -│ index ──── scan + embed + save + exit │ |
11 | | -│ serve ──── HTTP server + MCP + REST API + UI + WebSocket │ |
12 | | -│ users ──── user management (add users to config) │ |
13 | | -└──────────────────────────┬───────────────────────────────────────────┘ |
14 | | - │ |
15 | | - ┌──────────────┴──────────────┐ |
16 | | - ▼ ▼ |
17 | | - ┌─────────────┐ ┌──────────────────┐ |
18 | | - │ YAML Config │ │ ProjectManager │ |
19 | | - │ (Zod valid) │ │ (multi-project) │ |
20 | | - └──────┬──────┘ └────────┬─────────┘ |
21 | | - │ │ |
22 | | - ▼ ▼ |
23 | | - ┌──────────────────────────────────────────┐ |
24 | | - │ ProjectIndexer │ |
25 | | - │ 3 serial queues: docs / code / files │ |
26 | | - │ chokidar watcher for live updates │ |
27 | | - └──────────────────┬───────────────────────┘ |
28 | | - │ |
29 | | - ▼ |
30 | | - ┌──────────────────────────────────────────┐ |
31 | | - │ Embedding (transformers.js) │ |
32 | | - │ embed() / embedBatch() / loadModel() │ |
33 | | - │ named registry + model deduplication │ |
34 | | - └──────────────────┬───────────────────────┘ |
35 | | - │ |
36 | | - ▼ |
37 | | - ┌──────────────────────────────────────────┐ |
38 | | - │ Graphs (Graphology) │ |
39 | | - │ │ |
40 | | - │ DocGraph ────── markdown chunks │ |
41 | | - │ CodeGraph ───── AST symbols │ |
42 | | - │ KnowledgeGraph user notes + facts │ |
43 | | - │ FileIndexGraph all project files │ |
44 | | - │ TaskGraph ───── tasks + kanban │ |
45 | | - │ SkillGraph ──── reusable recipes │ |
46 | | - └──────────────────┬───────────────────────┘ |
47 | | - │ |
48 | | - ┌──────────────────┴───────────────────────┐ |
49 | | - │ Graph Managers (unified API) │ |
50 | | - │ │ |
51 | | - │ embed + CRUD + dirty + events │ |
52 | | - │ + cross-graph cleanup │ |
53 | | - └──────────────────┬───────────────────────┘ |
54 | | - │ |
55 | | - ┌──────────────┼──────────────┐ |
56 | | - ▼ ▼ ▼ |
57 | | - ┌────────┐ ┌──────────┐ ┌──────────┐ |
58 | | - │ MCP │ │ REST API │ │ UI │ |
59 | | - │ Tools │ │ Express │ │ React │ |
60 | | - │ (70) │ │ + WS │ │ + Vite │ |
61 | | - └────────┘ └──────────┘ └──────────┘ |
| 5 | +```mermaid |
| 6 | +graph TD |
| 7 | + CLI["CLI (commander)"] |
| 8 | + Config["YAML Config"] |
| 9 | + PM["ProjectManager"] |
| 10 | +
|
| 11 | + CLI --> Config |
| 12 | + CLI --> PM |
| 13 | +
|
| 14 | + subgraph Indexer["ProjectIndexer"] |
| 15 | + DQ["docs queue"] |
| 16 | + CQ["code queue"] |
| 17 | + FQ["files queue"] |
| 18 | + end |
| 19 | +
|
| 20 | + PM --> Indexer |
| 21 | +
|
| 22 | + subgraph Embed["Embedding Layer"] |
| 23 | + ONNX["ONNX Runtime"] |
| 24 | + Models["bge-m3 / jina-code"] |
| 25 | + end |
| 26 | +
|
| 27 | + Indexer --> Embed |
| 28 | +
|
| 29 | + subgraph Graphs |
| 30 | + DocG["DocGraph"] |
| 31 | + CodeG["CodeGraph"] |
| 32 | + KG["KnowledgeGraph"] |
| 33 | + TG["TaskGraph"] |
| 34 | + SG["SkillGraph"] |
| 35 | + FIG["FileIndexGraph"] |
| 36 | + end |
| 37 | +
|
| 38 | + Embed --> Graphs |
| 39 | +
|
| 40 | + subgraph Managers["Graph Managers"] |
| 41 | + DM["DocGraphManager"] |
| 42 | + CM["CodeGraphManager"] |
| 43 | + KM["KnowledgeGraphManager"] |
| 44 | + TM["TaskGraphManager"] |
| 45 | + SM["SkillGraphManager"] |
| 46 | + FM["FileIndexGraphManager"] |
| 47 | + end |
| 48 | +
|
| 49 | + Graphs --> Managers |
| 50 | +
|
| 51 | + subgraph API["API Layer"] |
| 52 | + MCP["MCP Tools (70)"] |
| 53 | + REST["REST Routes"] |
| 54 | + WS["WebSocket"] |
| 55 | + UI["Web UI"] |
| 56 | + end |
| 57 | +
|
| 58 | + Managers --> API |
62 | 59 | ``` |
63 | 60 |
|
64 | 61 | ## Layers |
|
0 commit comments