pinecone-io / pinecone-vercel-starter

Pinecone + Vercel AI SDK Starter
https://pinecone-vercel-example.vercel.app
418 stars 127 forks source link

Is this really RAG? #1

Closed pors closed 1 year ago

pors commented 1 year ago

I had a quick look at the code, but this looks more like a Retrieval-Generator architecture than RAG. In RAG the retriever is included in the model, in this app, the model is a chat model using a vector store for retrieval.

athrael-soju commented 1 year ago

@pors If you look at the video by Roie and Zack they go over this here: https://youtu.be/pPbTzgUV-UA?si=5AGavnBcP5mQi3u6&t=333

This diagram pretty much explains it: image

In this example, RAG is essentially the results from pinecone after enhancing the mesages array with a simple prompt (src/app/api/chat/route.ts). No use langchain, but that's not necessarily bad, because it keeps the code more readable.

RAG can infinitely more complex, but for the sake of the example, it's more than enough.

pors commented 1 year ago

Thanks for the response! I see now that RAG is the term everyone uses for this architecture. In the "past" this term was coined by Meta for something similar but as part of the model itself. Not anymore, though :)