Easy RAG implementation for testing?

Hello! I’d like to implement Retrieval Augmented Generation to test out it’s performance on a system I’ve built. Does anyone have advice on the simplest way to do this (or the best guide to assist and learn)? I’m looking for ease of use to start getting results, and complexity / customisation can come later. I was hoping it’s as simple as importing a library… I’m using Python if that’s useful at all. Thank you community!

When you say “system”, what do you mean by that? What’s the nature of the knowledge base you’d like to retrieve information from (e.g. is it in the form of embeddings in a vector DB)?

RAG can have a lot of different implementations in practice, so to be able to share potentially helpful resources, it would be helpful to get a few more details.

The injection of the knowledge itself is pretty straightforward as you would just include it alongside your prompt as you would with any other context. The retrieval step, on the other hand, depends on how the knowledge is stored.

Separating the two, RAG can be used as KN, but KN cannot be used as RAG. You must, at least, embed.

Thanks, yes for clarity. My system uses a large body of text as context, which I currently pass in the API. Id like to see the performance difference using a RAG system where the context has been embedded in a vector database. So in summary, I’m looking to test and compare the different outputs, one from prompt injection, the other from a vector embedded database (which I presume I need to use RAG to get the data from, but RAG is new to me). Thanks again!

Thanks for clarifying.

I’d recommend two resources.

For the very basic testing - prior to even get started with a vector database - I find this OpenAI cookbook resource is a useful starter. It walks you through the logical steps involved in using embeddings-based Q&A, i.e. RAG.

As for vector database, Pinecone is in my view quite intuitive and comes with lots of well organized resources, including for OpenAI use cases. I believe they still offer a free trial - so it’s a good way to do some testing without making a commitment.

Thank you jr.2509, much appreciated.

1 Like