fix: reduce VLM hallucinations and improve enrichment pipeline#52
Merged
antoniomtz merged 1 commit intomainfrom Apr 16, 2026
Merged
fix: reduce VLM hallucinations and improve enrichment pipeline#52antoniomtz merged 1 commit intomainfrom
antoniomtz merged 1 commit intomainfrom
Conversation
- Short VLM prompt + LLM structuring step to reduce hallucinations - Skip LLM enhancement when no product data (prevents fabrication) - User data as merge base — materials trusted over VLM guesses, printed label text overrides user product type claims - Separate /vlm/faqs endpoint for async FAQ loading - Anti-hallucination guardrail in branding step - Locale threaded through VLM structuring for proper localization - Branding prompt respects user-requested format (paragraphs vs bullets) - FAQ locale validation, empty product data check - CLAUDE.md, AGENTS.md prompt rules, hallucination report, docs updates Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/vlm/faqsendpoint for async FAQ loading (details show immediately, FAQs load in background)Changes
Backend (
src/backend/vlm.py):_call_nemotron_structure_vlm()converts VLM free text to catalog JSON with locale support_call_nemotron_enhanceskips Step 1 when no product data has contentBackend (
src/backend/main.py):POST /vlm/faqsendpoint with locale validation/vlm/analyzeresponse (called separately by frontend)extract_vlm_observationfor structuring stepFrontend:
/vlm/analyzecompletesgenerateFaqs()API function calls new endpointDocs:
docs/API.md— new/vlm/faqsendpoint documentedPRD.md— FR-10 (FAQ Generation), FR-11 (Policy Compliance), user storiesREADME.md— FAQ and Policy Compliance in key featuresAGENTS.md— added rule: never hardcode product-specific examples in promptsdocs/hallucination-report.md— full investigation with VLM test evidenceCLAUDE.md— references AGENTS.mdTests (
tests/test_vlm_unit.py):Test results
pytest tests/test_vlm_unit.py— 30/30 passedpytest tests/— 176/176 passedpnpm lint— no new errorsTest plan
🤖 Generated with Claude Code