Skip to content

feat(retrieval): compose evidence in Knowhere and keep raw results for debug - #430

Merged
EricNGOntos merged 4 commits into
mainfrom
feat/wuchengke/2026-09-20
Sep 21, 2026
Merged

EricNGOntos merged 4 commits into
mainfrom
feat/wuchengke/2026-09-20

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

  • Compose tables and images once in Knowhere, then emit assembled evidence / evidence_text.
  • Keep results as raw path chunks with placeholders for debug.
  • Align HTTP query and online MCP retrieval.query to the same outgoing package.

Test plan

  • make check
  • pytest packages/shared-python/shared/tests
  • pytest apps/api/tests

Made with Cursor

EricNGOntos and others added 4 commits September 20, 2026 23:08
- Added a new `evidence` field to the `RetrievalQueryResponse` model to include composed evidence parts (text and inline images).
- Updated the MCP response projection to return the new `evidence` field alongside `evidence_text`.
- Refactored evidence rendering logic to flatten composed parts and improve the assembly of retrieval results.
- Adjusted tests to validate the new evidence structure and ensure proper handling of composed evidence in responses.
…handling

- Removed the deprecated `render_evidence_blocks` function and replaced it with a new internal function `_render_evidence_blocks` for improved clarity and functionality.
- Updated the `_try_read_page_image` and `_select_page_asset` functions to return additional warnings for better error handling when page images are unavailable or mismatched.
- Refactored the `flatten_parts` function to utilize the new `page_summary` utility for summarizing page content.
- Enhanced tests to validate the new image handling logic and ensure proper warnings are displayed when images are missing or do not match expected page numbers.
Public results stay raw for debug; composed parts live only on evidence. MCP query now returns the same package.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@EricNGOntos
EricNGOntos merged commit 5aea5a8 into main Sep 21, 2026
6 checks passed
@EricNGOntos
EricNGOntos deleted the feat/wuchengke/2026-09-20 branch September 21, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant