Skip to content

feat: add Generic RAG tool #491#537

Merged
Fedir-Yatsenko merged 8 commits into
developmentfrom
feat/491-add-generic-rag
Jul 22, 2026
Merged

feat: add Generic RAG tool #491#537
Fedir-Yatsenko merged 8 commits into
developmentfrom
feat/491-add-generic-rag

Conversation

@Fedir-Yatsenko

@Fedir-Yatsenko Fedir-Yatsenko commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

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 via version: GENERIC on the existing file_rag tool config — pointing deployment_id at the generic-rag application and metadata_endpoint at its /channel/metadata route.

The legacy DIAL RAG backend (version: DIAL) is now deprecated in favor of Generic RAG: it is annotated as deprecated in the RAGVersion enum and FileRagDetails docstrings, and both the admin backend and the CLI log a warning when a channel is created or updated with version: DIAL. Removal is tracked as a follow-up in #536, blocked until all clients migrate.

Implementation details

Only two contract differences are handled:

  • Metadata shapeDialRagMetadataResponse now accepts both the DIAL RAG dimensions list [{name, values}] and the Generic RAG map {name: [values]}.
  • Request configuration — the prefilter's RagFilterDial is translated into Generic RAG's custom_fields.configuration, where filters are nested under retriever.document_selector (explicit selector). Only that field is sent; the retriever type, answer generation, and top_k fall back to the application's server-side defaults.

GenericRagAgentFactory subclasses DialRagAgentFactory and overrides only the config-building hook (_build_extra_body) and the stored state version. DialRagAgentFactory gains one behavior-preserving extracted hook; the DIAL path is unchanged. Also removes now-unused COMMAND/list_commands from BaseRAGFactory.

Unit tests cover the metadata validator (both shapes) and the RagFilterDial → Generic RAG config translation.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Fedir-Yatsenko and others added 3 commits July 21, 2026 11:02
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>
@Fedir-Yatsenko Fedir-Yatsenko self-assigned this Jul 21, 2026
@Fedir-Yatsenko
Fedir-Yatsenko requested a review from kryachkow July 21, 2026 11:09
@Fedir-Yatsenko Fedir-Yatsenko added enhancement New feature or request python Pull requests that update python code labels Jul 21, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Fedir-Yatsenko

Fedir-Yatsenko commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

/deploy-review

GitHub actions run: 29826437968

Stage Status
deploy-review Success ✅
matrix.application Skipped ➖

Fedir-Yatsenko and others added 3 commits July 21, 2026 14:49
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>
Comment thread statgpt/app/chains/file_rags/generic_rag/generic_rag.py
@Fedir-Yatsenko
Fedir-Yatsenko merged commit 40a1c59 into development Jul 22, 2026
9 checks passed
@Fedir-Yatsenko
Fedir-Yatsenko deleted the feat/491-add-generic-rag branch July 22, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Generic RAG tool

3 participants