Skip to content

feat: display retrieval citation highlights - #3654

Draft
EDDIWARD wants to merge 8 commits into
developfrom
edward/feature-retrieval-citations-clean
Draft

feat: display retrieval citation highlights#3654
EDDIWARD wants to merge 8 commits into
developfrom
edward/feature-retrieval-citations-clean

Conversation

@EDDIWARD

Copy link
Copy Markdown
Contributor

Summary

Add interactive retrieval citations to both chat experiences.

  • Render citation markers by the full source key, preventing collisions between different retrieval tools.
  • Open the matching source card and show the retrieved Chunk when a marker is selected.
  • Highlight exact lexical retrieval matches in blue and answer–Chunk overlaps in yellow.
  • Preserve the citation metadata for streaming responses and restored conversation history.

Why

Users can now see which retrieved Chunk supports a statement, instead of only seeing a long source preview. The same visual behavior is available in both /newchat and the legacy /chat page.

Validation

  • Frontend type check passed.
  • Frontend production build passed.
  • Backend unit tests for the affected conversation and retrieval paths passed.
  • Verified locally in both chat pages with knowledge-base retrieval.

UI screenshots are attached in a follow-up comment.

@EDDIWARD

Copy link
Copy Markdown
Contributor Author

UI verification

New chat (/newchat) — source 4 is selected; blue marks exact lexical retrieval hits and yellow marks answer–Chunk overlaps.

clipboard

Legacy chat (/chat) — the same selected source and highlight rules are rendered in the original chat page.

clipboard

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.01887% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...dk/nexent/core/tools/knowledge_base_search_tool.py 53.84% 4 Missing and 2 partials ⚠️
backend/services/agent_service.py 33.33% 1 Missing and 1 partial ⚠️
sdk/nexent/vector_database/elasticsearch_core.py 93.33% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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