@@ -251,44 +251,53 @@ flowchart TB
251251 subgraph kimi_cli["🖥️ Kimi Code CLI"]
252252 hooks["🔌 Hooks<br/>7 lifecycle events"]
253253 plugin["🔧 Plugin Tools<br/>3 AI-callable tools"]
254- prompts["💬 User Prompts "]
254+ mcp_client["🔌 MCP Clients<br/>Claude • Cursor • Goose "]
255255 end
256256
257- subgraph core["⚙️ kimi-mneme Core"]
258- extractor["📥 Extractor<br/>context • checkpoints • patterns"]
259- compressor["🤖 Compressor<br/>AI semantic summaries"]
260- injector["📤 Injector<br/>session start • patterns"]
257+ subgraph ingestion["📥 Ingestion Layer"]
258+ wire["📡 Wire Watcher<br/>watchdog indexes wire.jsonl"]
259+ extractor["📥 Extractor<br/>sanitize • queue • checkpoints"]
260+ end
261+
262+ subgraph processing["⚙️ Processing Layer"]
263+ worker["🤖 StructuringWorker<br/>AI / heuristic structuring"]
264+ compressor["🗜️ Compressor<br/>session summaries"]
265+ injector["📤 Injector<br/>semantic context injection"]
266+ analyzer["🌳 Codebase Analyzer<br/>Tree-sitter AST"]
261267 end
262268
263269 subgraph storage["💾 Storage Layer"]
264- sqlite[("SQLite<br/>sessions • observations<br/>checkpoints • patterns")]
265- vec["🔍 sqlite-vec<br/>semantic search"]
266- server["🌐 Web Server<br/>localhost:37777"]
270+ sqlite[("SQLite<br/>raw • structured • vectors<br/>collections • wire")]
271+ vec["🔍 sqlite-vec<br/>384-dim embeddings"]
272+ end
273+
274+ subgraph interfaces["🌐 Interfaces"]
275+ server["Web Server<br/>localhost:37777 • SSE"]
276+ mcp_server["MCP Server<br/>15 tools"]
277+ project_md[".kimi/PROJECT.md<br/>.kimi/AGENTS.md"]
267278 end
268279
269280 hooks --> extractor
270- plugin --> extractor
271- extractor --> compressor
272- compressor --> injector
273- injector --> prompts
281+ wire --> extractor
274282 extractor --> sqlite
275- compressor --> sqlite
276- injector --> sqlite
283+ extractor -->|pending queue| worker
284+ worker -->|structured obs| sqlite
277285 sqlite --> vec
286+ sqlite --> compressor
287+ sqlite --> injector
288+ sqlite --> analyzer
278289 sqlite --> server
290+ sqlite --> mcp_server
291+ sqlite --> project_md
292+ plugin --> mcp_server
293+ mcp_client --> mcp_server
294+ injector -->|context| kimi_cli
279295
280296 style kimi_cli fill:#1a1a2e,stroke:#16213e,stroke-width:2px,color:#fff
281- style core fill:#16213e,stroke:#0f3460,stroke-width:2px,color:#fff
282- style storage fill:#0f3460,stroke:#e94560,stroke-width:2px,color:#fff
283- style hooks fill:#533483,color:#fff
284- style plugin fill:#533483,color:#fff
285- style prompts fill:#533483,color:#fff
286- style extractor fill:#e94560,color:#fff
287- style compressor fill:#e94560,color:#fff
288- style injector fill:#e94560,color:#fff
289- style sqlite fill:#1a1a2e,color:#fff
290- style vec fill:#1a1a2e,color:#fff
291- style server fill:#1a1a2e,color:#fff
297+ style ingestion fill:#16213e,stroke:#0f3460,stroke-width:2px,color:#fff
298+ style processing fill:#0f3460,stroke:#e94560,stroke-width:2px,color:#fff
299+ style storage fill:#1a1a2e,stroke:#533483,stroke-width:2px,color:#fff
300+ style interfaces fill:#16213e,stroke:#0f3460,stroke-width:2px,color:#fff
292301```
293302
294303### Components
@@ -297,12 +306,16 @@ flowchart TB
297306| -----------| ---------|
298307| ** Hooks** | 7 lifecycle event handlers (SessionStart, PostToolUse, SessionEnd, PreCompact, PostCompact, etc.) |
299308| ** Plugin** | 3 AI-callable tools: ` mneme_search ` , ` mneme_timeline ` , ` mneme_get ` |
300- | ** Extractor** | Parses observations, detects truncation, creates checkpoints, detects patterns |
301- | ** Compressor** | Generates semantic summaries via configurable LLM (Kimi API, Ollama, OpenAI-compatible) |
302- | ** Injector** | Injects checkpoints, patterns, and relevant past context at session start |
303- | ** SQLite** | Stores sessions, observations, summaries, checkpoints, patterns, compaction events |
304- | ** sqlite-vec** | SQLite extension for semantic similarity search (primary, cross-platform) |
305- | ** Web Server** | FastAPI-based API on port 37777 — real-time SSE event stream |
309+ | ** Wire Watcher** | watchdog-based indexing of Kimi CLI ` wire.jsonl ` + ` state.json ` |
310+ | ** Extractor** | Sanitizes observations, adds to pending queue, creates checkpoints, detects patterns |
311+ | ** StructuringWorker** | Background worker: AI structuring (Kimi/Ollama/OpenAI) → heuristic fallback |
312+ | ** Compressor** | Generates session summaries via configurable LLM |
313+ | ** Injector** | Injects structured context + semantic search results at session start |
314+ | ** Codebase Analyzer** | Tree-sitter AST analysis (Python, JS, TS, Rust, Go) — scan, search, outline |
315+ | ** SQLite** | Raw observations, structured observations, vectors, collections, wire events |
316+ | ** sqlite-vec** | 384-dim embeddings for semantic similarity search (primary, cross-platform) |
317+ | ** Web Server** | FastAPI + vanilla JS on port 37777 — SSE stream, structured cards, search |
318+ | ** MCP Server** | 15 tools for Claude Desktop, Cursor, Goose — search, timeline, collections, codebase |
306319
307320---
308321
0 commit comments