Skip to content
Middle+0 views

How did you deal with the agent’s hallucinations?

Practice

Asked at

AI answer

Hallucinations are best reduced at several levels:

  • Provide verifiable context: use RAG or search authoritative sources, constrain answers to the retrieved information, and include source citations.
  • Connect tools for facts that need to be calculated or retrieved from systems, and verify the results of tool calls.
  • Set rules explicitly: ask the model to distinguish facts from assumptions and acknowledge when there is insufficient data. For critical scenarios, provide for refusal to answer or escalation to a human.
  • Check the output: validate the format and business rules, compare it with the source, or run a separate check for high-risk answers.
  • Measure quality: use a test set of real queries, assess factual accuracy, and regularly review errors after changes.

Lowering the temperature may make responses less varied, but it does not, by itself, guarantee their accuracy.