Skip to content

Bug: Answer grounding validation removed — LLM responses accepted with no quality check #13

Description

@anushagarg6

Description

The old retrieval pipeline had a 3-stage answer quality guard:

  1. answer_is_grounded() — checked that every sentence had a valid citation and overlapped with source text
  2. build_grounding_repair_prompt() — a second LLM call to fix a failing answer
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions