feat(platform): add document_retrieve agent tool#714
Conversation
Add a new agent tool that retrieves document content from the knowledge base by ID with chunk-based pagination. Complements rag_search (which returns relevance-ranked chunks) by providing sequential, structure-preserving document access. - Register document_retrieve in tool names and tool registry - Create tool definition with chunkStart/chunkEnd params (1-indexed) - Create helper with access control, 60s timeout, 50K char safety cap - Differentiated error handling (404 graceful, 5xx with context) - Add to Knowledge category in UI tool selector - 24 tests covering happy path, pagination, truncation, access control, error handling, and schema validation Refs #659
Move document_list to Knowledge category alongside document_retrieve, update tool descriptions to clarify when to use document_retrieve vs file extraction tools, fix totalChars description accuracy, and add tests for fetch timeout and network error handling.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR introduces a new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Summary
document_retrieveagent tool that retrieves document content from the knowledge base by ID with chunk-based pagination, complementingrag_searchby providing sequential, structure-preserving document accessdocument_retrievevs file extraction tools, movedocument_listto Knowledge categoryRefs #659
Test plan
document_retrievereturns correct content for a valid document ID🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation