Update DeepResearcherAgent report handling and citation verification#128
Merged
AjayThorve merged 7 commits intoNVIDIA-AI-Blueprints:developfrom Mar 7, 2026
Merged
Conversation
- Introduced a new method `_extract_report_content` to streamline report content extraction from messages, accommodating cases where the last message is an AIMessage with a write_file tool call. - Updated `_is_report_complete` to utilize the new extraction method for improved report completeness checks. - Enhanced citation verification in `SourceRegistry` to handle ambiguous URL matches more robustly, including new strategies for resolving URLs based on query parameters and child-path matches. - Added unit tests to validate the new report extraction logic and citation resolution strategies, ensuring reliability in various scenarios. These changes improve the agent's ability to generate and verify reports accurately, enhancing overall functionality.
Contributor
Greptile SummaryThis PR improves the Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Last Message] --> B{content length\n>= 1500?}
B -- Yes --> C[Return text content]
B -- No --> D{Is AIMessage\nwith tool_calls?}
D -- No --> E[Return short content]
D -- Yes --> F[Iterate write_file calls]
F --> G{file_content longer\nthan current?}
G -- Yes --> H[Update content\n⚠️ no file_path check]
G -- No --> F
H --> F
F -- done --> I[Return content]
subgraph resolve_url [SourceRegistry.resolve_url]
S1{1. Exact match\nraw or normalized?}
S1 -- hit --> R1[Return entry URL]
S1 -- miss --> S2{2. Truncation:\nregistry URL\nstarts with report URL?}
S2 -- 1 match --> R2[Return entry URL]
S2 -- ambiguous/none --> S3{3. Prefix:\nnorm registry\nstarts with norm report?}
S3 -- 1 match --> R3[Return entry URL]
S3 -- ambiguous/none --> S4{4. Child-path:\nreport path under\nregistry path?}
S4 -- 1 match --> R4[Return entry URL]
S4 -- ambiguous/none --> S5{5. Query-subset:\nsame host+path,\nreport params ⊆ registry?}
S5 -- 1 match --> R5[Return entry URL]
S5 -- ambiguous/none --> RN[Return None]
end
Last reviewed commit: 6254507 |
- Streamlined the WebSocket URL construction by removing unnecessary variable assignments and conditional checks for the authentication token. - Improved code readability and maintainability in the `NATWebSocketClient` class.
Collaborator
Author
|
re-review @greptile-bot |
cf178c6 to
6254507
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_extract_report_contentto streamline report content extraction from messages, accommodating cases where the last message is an AIMessage with a write_file tool call._is_report_completeto utilize the new extraction method for improved report completeness checks.SourceRegistryto handle ambiguous URL matches more robustly, including new strategies for resolving URLs based on query parameters and child-path matches.These changes improve the agent's ability to generate and verify reports accurately, enhancing overall functionality.