Salesforce Decode
Salesforcedecode
Back to questions
AgentforceArchitect (Hardest)raghallucinationgroundingknowledge

Prevent RAG hallucinations in customer-facing agent responses

Real World Scenario

A healthcare payer agent cited a non-existent prior authorization policy, causing members to skip required steps. Legal demands proof that answers are grounded in approved knowledge only.

Expected Answer

• Constrain generation to retrieved chunks with citation requirements—reject answers when retrieval confidence is low • Maintain allowlisted knowledge sources with version tags; block stale or draft articles from retrieval index • Implement answer validation layer checking claims against structured policy tables where possible • Use abstention prompts: agent must say it does not know rather than infer from partial context • Run golden-set regression tests comparing agent answers to authoritative policy documents weekly • Log retrieval IDs, chunk hashes, and final response for every member interaction • Separate informational retrieval from transactional actions—never infer eligibility from prose alone

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Handle it in layers. First: Constrain generation to retrieved chunks with citation requirements—reject answers when retrieval confidence is low. If that fails: Maintain allowlisted knowledge sources with version tags; block stale or draft articles from retrieval index. For edge cases in "How do you handle conflicting knowledge articles a…", Implement answer validation layer checking claims against structured policy tables where possible. Hallucination prevention is architecture, not prompt tweaking. Document the decision in an ADR and align with enterprise standards.

Architect Perspective

Hallucination prevention is architecture, not prompt tweaking. Combine retrieval gates, abstention policies, structured validation, and continuous eval—not one technique alone.