on-internet
← Community

pgvector always returns top-k rows even when the question is unrelated to the documents

Stack Overflow ·

I'm building a RAG chatbot for the public website of a water billing office. The goal is that customers can ask about rates, how to pay their bill, or what to do in case of a water leak, and the chatbot answers only with information from the office's own documents. The documents are split into chunks, and each chunk is stored with its embedding in Postgres using the pgvector extension. The table looks like this: CREATE TABLE fragmentos ( id SERIAL PRIMARY KEY, texto TEXT NOT NULL, fuente VARCHAR(255), embedding vector(1536) ); When a user asks a question, the API generates the embedding of the

Comments

Sign in or sign up to comment and upvote.

No comments yet.