In context
A vanilla large language model only knows what it learned during training. Ask it about your product catalog and it will either decline or make something up. RAG fixes both failure modes by injecting a retrieval step before generation.
The pipeline has three stages: embed your content into a vector store; on a query, retrieve the most semantically similar chunks; then generate a response that references only those retrieved facts. The model becomes a writer with a research assistant whispering store-specific notes into its ear.
RAG is also cheaper than fine-tuning. You don't retrain a model when your catalog changes — you re-embed the changed rows, and the agent sees the new truth on its very next query.
How Zubby uses this
Every shopper conversation in Zubby runs through a multi-stage RAG pipeline. We embed your products (title + description + collection + variant + metafields) and your policy docs into a pgvector store with a 1536-dimension OpenAI embedding model. On each turn we run hybrid retrieval (vector + keyword), re-rank, and pass the top matches into the prompt context.
The agent is instructed to refuse questions it can't ground in the retrieved context — so it never invents prices, inventory, or shipping rules.