Description
The old retrieval pipeline had a 3-stage answer quality guard:
answer_is_grounded() — checked that every sentence had a valid citation and overlapped with source text
build_grounding_repair_prompt() — a second LLM call to fix a failing answer
build_extractive_fallback() — pulled verbatim sentences from sources if the repair also failed
All three were removed during the FastAPI migration in backend/retrieval/pipeline.py. The LLM's first response is now accepted with no quality check, meaning hallucinated or uncited answers reach the user.
Impact
- Users may receive answers that are not backed by the retrieved sources
- Citation chips may be missing or wrong
- Confidence in the chatbot's reliability is reduced
Location
backend/retrieval/pipeline.py — answer_question() function
Fix Needed
Re-introduce the grounding loop. All three functions (answer_is_grounded, build_grounding_repair_prompt, build_extractive_fallback) still exist in backend/retrieval/citation_parser.py — they just need to be called again in the pipeline.
Description
The old retrieval pipeline had a 3-stage answer quality guard:
answer_is_grounded()— checked that every sentence had a valid citation and overlapped with source textbuild_grounding_repair_prompt()— a second LLM call to fix a failing answerbuild_extractive_fallback()— pulled verbatim sentences from sources if the repair also failedAll three were removed during the FastAPI migration in
backend/retrieval/pipeline.py. The LLM's first response is now accepted with no quality check, meaning hallucinated or uncited answers reach the user.Impact
Location
backend/retrieval/pipeline.py—answer_question()functionFix Needed
Re-introduce the grounding loop. All three functions (
answer_is_grounded,build_grounding_repair_prompt,build_extractive_fallback) still exist inbackend/retrieval/citation_parser.py— they just need to be called again in the pipeline.