AWS Builder Center
Your AI Chatbot Is Making Things Up. Fix It with RAG

Your AI Chatbot Is Making Things Up. Fix It with RAG

My support chatbot kept inventing auto part compatibilities. Here’s how I fixed it with RAG, n8n and Amazon Bedrock, with no backend code.

I work in customer support for an auto parts store on Mercado Livre, Latin America's biggest marketplace. Every day, customers ask the same thing: "Does this steering rack fit my car?"

Ask a generic AI chatbot that question and it will answer with total confidence. Sometimes it's right. Sometimes it invents a compatibility that doesn't exist, and that becomes a return, a bad review and a lost customer.

The problem isn't the model. It simply doesn't know your catalog. In this post I'll show how I gave it that knowledge with RAG, using n8n and Amazon Bedrock, without writing a backend.

RAG in 30 seconds

RAG (Retrieval-Augmented Generation) means: search first, answer second.
  1. Your documents are split into small chunks and turned into vectors (embeddings).
  1. When a question arrives, the system finds the chunks most similar to it.
  1. Those chunks go into the prompt, and the model answers based on them, not on what it "thinks" it knows.
No fine-tuning, no retraining. Update the documents and the chatbot is updated.

The stack

  • n8n: the visual workflow tool that glues everything together.
  • Amazon Bedrock: one model for embeddings (Amazon Titan Text Embeddings V2) and one chat model to write the answers.
  • Vector store: n8n's Simple Vector Store, which runs in memory. Good for learning; for production, switch to PGVector, Pinecone or Qdrant.
The whole project is two workflows: one to feed the knowledge base and one to chat with it.


Building it

Before you start: in the Bedrock console, enable access to an embedding model and a chat model, then create an IAM user with Bedrock permissions and add its keys as an AWS credential in n8n.

Workflow 1: feed the knowledge base

  1. On form submission (Form Trigger) with a file upload field. This is where you send your PDFs or spreadsheets.
  1. Simple Vector Store in Insert Documents mode, with a memory key such as  parts_catalog .
  1. Attach a Default Data Loader (binary data) and a Recursive Character Text Splitter (around 500 characters, 50 of overlap).
  1. Attach Embeddings AWS Bedrock with Titan Text Embeddings V2.
Upload your catalog once and the chunks are indexed.

Workflow 2: the chatbot

  1. When chat message received (Chat Trigger).
  1. AI Agent, connected to:
  • AWS Bedrock Chat Model (the brain);
  • Simple Memory, so it remembers the conversation;
  • Simple Vector Store in Retrieve Documents (as Tool) mode, with the same memory key and the same embeddings model.
That's it. The agent decides when to search the catalog, gets the relevant chunks and answers with them.

Making it yours: the system prompt

This is where "generic chatbot" becomes "your chatbot". In the AI Agent's system message:
You are a support assistant for an auto parts store.
Always search the parts catalog before answering.
Only confirm compatibility if it is in the catalog.
If the information is not there, say you are not sure
and offer to forward the question to a human.
Be short, friendly and reply in the customer's language.
The most important line is the one that allows it to say "I don't know". Without it, the model will still try to please the customer.

Test it the right way

Ask two questions:
  • One that is in the catalog. The answer should match the document.
  • One that isn't. This is the real test: a good RAG chatbot admits it doesn't know.
If the second answer is invented, tighten the system prompt or retrieve fewer, more relevant chunks.
Watch out for: the Simple Vector Store is lost when n8n restarts, and Bedrock charges per token. Use a small chat model while testing and set a billing alert in AWS.

The takeaway

A chatbot that knows your business isn't a big AI project. It's two workflows, one well-written prompt and your own documents. The same recipe works for a beauty salon's price list, a company's internal docs or your college notes.
Next step for me: connecting this to WhatsApp, so customers get answers outside business hours.
What would you feed your chatbot first? Tell me in the comments.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article