Refactor DESIGN.md to enhance data flow visualization and clarity

- Replaced the previous text-based data flow representation with a flowchart using Mermaid syntax for improved readability and understanding.
- Streamlined the depiction of data sources and their relationships, clarifying the flow from content module to LLM input.
- Updated the documentation to ensure consistency with the new visual format, aiding in the comprehension of the search module's architecture.
This commit is contained in:
Max 2025-12-12 10:34:57 +08:00
parent 1d605b05af
commit 155782bd7b

View file

@ -1193,38 +1193,22 @@ type Reference struct {
**Data Flow:**
```
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Content Module │ │ Hook Search │ │ Auto Search │
│ (db:xxx kb:xxx) │ │ ctx.search.*() │ │ (assistant cfg) │
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
│ source="user" │ source="hook" │ source="auto"
│ weight=1.0 │ weight=0.8 │ weight=0.6
│ │ │
└──────────────────────┼──────────────────────┘
┌───────────────────────┐
│ []Reference │
│ (Unified Structure) │
└───────────┬───────────┘
┌───────────────────────┐
│ Merge & Deduplicate │
│ Rerank by score*wt │
└───────────┬───────────┘
┌─────────────────────────────┐
│ Build <references> XML │
└───────────┬─────────────────┘
┌───────────────────────┐
│ LLM Input │
└───────────────────────┘
```mermaid
flowchart TD
subgraph Sources ["Data Sources"]
CM["Content Module<br/>(db:xxx kb:xxx)"]
HS["Hook Search<br/>ctx.search.*()"]
AS["Auto Search<br/>(assistant config)"]
end
CM -->|"source=user<br/>weight=1.0"| REF
HS -->|"source=hook<br/>weight=0.8"| REF
AS -->|"source=auto<br/>weight=0.6"| REF
REF["[]Reference<br/>(Unified Structure)"]
REF --> MERGE["Merge & Deduplicate<br/>Rerank by score × weight"]
MERGE --> BUILD["Build &lt;references&gt; XML"]
BUILD --> LLM["LLM Input"]
```
**LLM References Format:**