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:**
|
**Data Flow:**
|
||||||
|
|
||||||
```
|
```mermaid
|
||||||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
flowchart TD
|
||||||
│ Content Module │ │ Hook Search │ │ Auto Search │
|
subgraph Sources ["Data Sources"]
|
||||||
│ (db:xxx kb:xxx) │ │ ctx.search.*() │ │ (assistant cfg) │
|
CM["Content Module<br/>(db:xxx kb:xxx)"]
|
||||||
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
|
HS["Hook Search<br/>ctx.search.*()"]
|
||||||
│ │ │
|
AS["Auto Search<br/>(assistant config)"]
|
||||||
│ source="user" │ source="hook" │ source="auto"
|
end
|
||||||
│ weight=1.0 │ weight=0.8 │ weight=0.6
|
|
||||||
│ │ │
|
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)"]
|
||||||
│ []Reference │
|
REF --> MERGE["Merge & Deduplicate<br/>Rerank by score × weight"]
|
||||||
│ (Unified Structure) │
|
MERGE --> BUILD["Build <references> XML"]
|
||||||
└───────────┬───────────┘
|
BUILD --> LLM["LLM Input"]
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌───────────────────────┐
|
|
||||||
│ Merge & Deduplicate │
|
|
||||||
│ Rerank by score*wt │
|
|
||||||
└───────────┬───────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌─────────────────────────────┐
|
|
||||||
│ Build <references> XML │
|
|
||||||
└───────────┬─────────────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌───────────────────────┐
|
|
||||||
│ LLM Input │
|
|
||||||
└───────────────────────┘
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**LLM References Format:**
|
**LLM References Format:**
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue