Skip to content

RAG: keep chunking-excluded types out of keyword retrieval and sources - #125

Merged
reekitconcept merged 1 commit into
mainfrom
kid/124/rag-keyword-exclusions
Sep 8, 2026
Merged

RAG: keep chunking-excluded types out of keyword retrieval and sources#125
reekitconcept merged 1 commit into
mainfrom
kid/124/rag-keyword-exclusions

Conversation

@reekitconcept

Copy link
Copy Markdown
Member

Fixes #124. Found by @danalvrz during acceptance testing (kitconcept.intranet ticket 570, finding 2).

Image content is excluded from chunking, but the exclusion only existed on the indexing side: the BM25 keyword leg still ranked Images by title, so they were cited as sources with an empty snippet while the answer could not know anything about them — the exact pollution the exclusion was meant to prevent.

  • search_keyword: mirrors EXCLUDED_PORTAL_TYPES in the filter queries, so both retrieval legs agree with the chunking policy.
  • build_sources: a parent without any context chunk contributed nothing to the answer and is no longer cited.
  • Drive-by: SolrExtraConditions.from_encoded("") treats a bare extra_conditions= URL parameter (the results page URL rewrite produces those) as no conditions instead of logging an invalid-base64 warning on every request.

Verified live on the intranet corpus with "Was ist der Strategieprozess DFNT 2030?" (each workspace has a matching "Vorschaubild" preview image — the exact reported pattern): before, the Image was cited with an empty snippet and the answer claimed the topic was undocumented; after, no Image/empty-snippet sources, and the answer improved because the freed context slot went to a real document.

Backend suite: 733 passed, 3 skipped.

#124)

Image content is excluded from chunking, but the exclusion only
existed on the indexing side: the BM25 keyword leg still ranked
Images by title, so they were cited as sources with an empty snippet
while the answer could not know anything about them (the exact
pollution the exclusion was meant to prevent).

- search_keyword: mirror EXCLUDED_PORTAL_TYPES in the filter queries.
- build_sources: a parent without any context chunk contributed
  nothing to the answer and is no longer cited.
- SolrExtraConditions.from_encoded: an empty string (a bare
  extra_conditions= URL parameter from the results page URL rewrite)
  means no conditions, instead of logging an invalid-base64 warning
  on every request.
@reekitconcept
reekitconcept merged commit cf665d3 into main Sep 8, 2026
19 checks passed
@reekitconcept
reekitconcept deleted the kid/124/rag-keyword-exclusions branch September 8, 2026 14:08
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.

RAG: keyword retrieval leg cites chunking-excluded types (Image) as context-less sources

2 participants