Enhance DESIGN.md with user data source handling details

- Updated the section on user message processing to clarify that users only specify data source IDs, with filters generated by the Search module from natural language input.
- Added a detailed example illustrating the extraction of queries and the generation of QueryDSL for data sources, improving understanding of the Search module's functionality.
This commit is contained in:
Max 2025-12-12 09:30:19 +08:00
parent 3a181354ff
commit 53bc662f3e

View file

@ -938,6 +938,8 @@ const (
### Message with Data Reference ### Message with Data Reference
User only specifies data source IDs. Filters are generated by Search module from natural language.
```json ```json
{ {
"role": "user", "role": "user",
@ -947,11 +949,7 @@ const (
"type": "data", "type": "data",
"data": { "data": {
"sources": [ "sources": [
{ { "type": "model", "name": "product" },
"type": "model",
"name": "product",
"filters": { "price": { "<": 100 } }
},
{ "type": "kb_collection", "name": "product-docs" } { "type": "kb_collection", "name": "product-docs" }
] ]
} }
@ -960,6 +958,12 @@ const (
} }
``` ```
The Search module will:
1. Extract query from text: "products under $100"
2. For `model:product` → Generate QueryDSL: `{ "wheres": [{ "field": "price", "op": "<", "value": 100 }] }`
3. For `kb_collection:product-docs` → Vector search with query embedding
### Processing Flow in content.Vision() ### Processing Flow in content.Vision()
``` ```