feat: Introduce wiki_read_source_doc tool for enhanced document retrieval
- Added a new tool, `wiki_read_source_doc`, allowing agents to access specific source documents for detailed information retrieval when wiki page content is insufficient. - Updated the agent system prompt and tool definitions to incorporate the new tool, enhancing the agent's capabilities for in-depth knowledge extraction. - Modified existing tools to support the new functionality, ensuring seamless integration within the agent's workflow. These changes significantly improve the agent's ability to provide accurate and detailed responses by leveraging source documents alongside wiki content.
This commit is contained in:
@@ -173,6 +173,7 @@ builtin_agents:
|
||||
- "todo_write"
|
||||
- "wiki_search"
|
||||
- "wiki_read_page"
|
||||
- "wiki_read_source_doc"
|
||||
web_search_enabled: false
|
||||
web_search_max_results: 0
|
||||
reflection_enabled: false
|
||||
|
||||
@@ -253,7 +253,8 @@ templates:
|
||||
- **Outgoing links (`Links to`):** Use these to dive deeper into specific concepts, people, or items mentioned in the current page's text.
|
||||
- **Incoming links (`Linked from`):** Use these to find broader context, discover what other projects/entities reference this topic, or see where this concept is applied.
|
||||
If the current page doesn't fully answer the question, you MUST call `wiki_read_page` again on these related slugs (1-2 hops).
|
||||
4. **Synthesize:** Once you have gathered sufficient information from reading multiple interconnected pages, synthesize a final answer.
|
||||
4. **Drill-down Fallback (Optional):** Wiki pages summarize information from source documents. If the user asks for highly specific details (e.g. exact quotes, raw data, or specific code snippets) that are not present in the wiki page, check the `<sources>` section of that wiki page. Use the `wiki_read_source_doc` tool with the provided `knowledge_id` to read the original raw document, optionally using a regex query to find the specific detail.
|
||||
5. **Synthesize:** Once you have gathered sufficient information from reading multiple interconnected pages (and optionally source documents), synthesize a final answer. If you encountered images (e.g. `<image url="...">`) in the source documents that are relevant to the user's query, be sure to output them in your final response using Markdown format (``).
|
||||
</workflow>
|
||||
|
||||
<constraints>
|
||||
@@ -267,6 +268,7 @@ templates:
|
||||
<tool_guidelines>
|
||||
* **wiki_search:** Use this to find entry points. STRONGLY PREFER using PostgreSQL POSIX regular expressions (~* operator) to search for multiple concepts at once efficiently. Examples: alternation ("stardust|skyvault|psionic"), multiple terms ("psionic.*engine"), prefix ("^entity/.*"). Do not use simple plain text queries if you are looking for multiple things. You can provide multiple queries at once to search in parallel.
|
||||
* **wiki_read_page:** Your primary tool. Use it to read the full content of pages found via search, linked from other pages, or the special `index` and `log` pages. You can provide multiple slugs at once to read multiple pages in parallel.
|
||||
* **wiki_read_source_doc:** Use this ONLY as a fallback when a wiki page's content is insufficient and you need to dive into the raw source document listed in the page's `<sources>` section. Use the `knowledge_id` and an optional regex `query` to efficiently find specific quotes or details, OR use `start_chunk_index` and `end_chunk_index` to fetch a contiguous range of chunks.
|
||||
</tool_guidelines>
|
||||
|
||||
<system_status>
|
||||
|
||||
Reference in New Issue
Block a user