feat: add Generic RAG tool #491#537
Merged
Merged
Conversation
Reuse the DIAL RAG chat-completions transport for a Generic RAG DIAL application, selected via RAGVersion.GENERIC. Only the metadata shape (accept map or list dimensions) and the request configuration payload (nested retriever.document_selector) differ. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mark RAGVersion.DIAL deprecated in the enum and FileRagDetails docstrings, and log a warning when a channel is created or updated with version: DIAL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
/deploy-review
|
Return no configuration when the prefilter carries no constraint so the generic-rag app uses its server-side defaults instead of an empty explicit selector, and type sort_by as list[Literal["publication_date"]]. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kryachkow
approved these changes
Jul 22, 2026
navalnica
reviewed
Jul 22, 2026
navalnica
approved these changes
Jul 22, 2026
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.
Applicable issues
Description of changes
Adds support for the Generic RAG service as an alternative publications RAG backend alongside the existing DIAL RAG integration.
Generic RAG is a DIAL application reached over the same streaming chat-completions transport as DIAL RAG, so
DialRagAgentFactory(client, LLM prefilter, streaming, attachments) is reused almost entirely. A new backend is selected viaversion: GENERICon the existingfile_ragtool config — pointingdeployment_idat the generic-rag application andmetadata_endpointat its/channel/metadataroute.The legacy DIAL RAG backend (
version: DIAL) is now deprecated in favor of Generic RAG: it is annotated as deprecated in theRAGVersionenum andFileRagDetailsdocstrings, and both the admin backend and the CLI log a warning when a channel is created or updated withversion: DIAL. Removal is tracked as a follow-up in #536, blocked until all clients migrate.Implementation details
Only two contract differences are handled:
DialRagMetadataResponsenow accepts both the DIAL RAGdimensionslist[{name, values}]and the Generic RAG map{name: [values]}.RagFilterDialis translated into Generic RAG'scustom_fields.configuration, where filters are nested underretriever.document_selector(explicit selector). Only that field is sent; the retriever type, answer generation, andtop_kfall back to the application's server-side defaults.GenericRagAgentFactorysubclassesDialRagAgentFactoryand overrides only the config-building hook (_build_extra_body) and the stored state version.DialRagAgentFactorygains one behavior-preserving extracted hook; the DIAL path is unchanged. Also removes now-unusedCOMMAND/list_commandsfromBaseRAGFactory.Unit tests cover the metadata validator (both shapes) and the
RagFilterDial→ Generic RAG config translation.Checklist
Reviewenvironment.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.