---
title: "Comment by Ahmet Özel on \"Building a Production RAG API in Go with pgvector and Gemini\" | Hashnode"
description: "validateAnswer checks the structured item IDs, but Message remains unconstrained. The model could return an allowed ID while naming a different dish or inventin"
url: "https://hashnode.com/posts/building-a-production-rag-api-in-go-with-pgvector-and-gemini/6ae2df90e5a0e25712bb1420/comment/6ae42f97e9ef0fbc913c9657"
---

[Discussion](https://hashnode.com/posts/building-a-production-rag-api-in-go-with-pgvector-and-gemini/6ae2df90e5a0e25712bb1420)

Comment [Building a Production RAG API in Go with pgvector and Gemini](https://hashnode.com/posts/building-a-production-rag-api-in-go-with-pgvector-and-gemini/6ae2df90e5a0e25712bb1420)

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Oct 30](https://hashnode.com/posts/building-a-production-rag-api-in-go-with-pgvector-and-gemini/6ae2df90e5a0e25712bb1420/comment/6ae42f97e9ef0fbc913c9657)

validateAnswer checks the structured item IDs, but Message remains unconstrained. The model could return an allowed ID while naming a different dish or inventing a price in the prose, and the current validation would still pass.

I would render names and prices from the selected records, or require structured item-level text that can be checked against each referenced candidate. A fixture with valid ItemIDs and a deliberately inconsistent Message would make that boundary visible. It separates “the reference exists” from “the explanation accurately describes the referenced item.”
