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:
parent
1d605b05af
commit
155782bd7b
1 changed files with 16 additions and 32 deletions
|
|
@ -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 <references> XML"]
|
||||
BUILD --> LLM["LLM Input"]
|
||||
```
|
||||
|
||||
**LLM References Format:**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue