Fernandes breaks the stack into orchestration, embeddings, vector storage, language models, monitoring, reranking, and evaluation. He prototypes in Google Colab and often uses Docker for production, where financial institutions may require data and processing to stay on premises. His choices include LlamaIndex, Qdrant, Arize Phoenix, and Ragas, with open models favored for production embeddings and reranking.
The RAG Stack We Landed On After 37 Fails
Speaker
Independent AI engineer Jonathan Fernandes shares the RAG stack he settled on after 37 failed attempts, including how he prototypes in Google Colab and deploys production systems, often on premises for financial institutions.
Using a railway company’s HTML knowledge base, Fernandes frames a question: where to get help in London. Basic RAG embeds the query, retrieves relevant documents from a vector database, then sends the documents and question to a language model. With LlamaIndex and an in-memory database, the first answer points to accessible black cabs, which misses the more useful station assistance information.
Fernandes describes query processing and post-retrieval as ways to improve a RAG pipeline. A bi-encoder embeds queries and documents separately, making similarity search fast enough to compare a query against many documents. A cross-encoder compares a query with individual documents more accurately but is slower, so he places it after retrieval as a reranker.
He replaces the in-memory vector store with Qdrant and swaps the default embedding model for BAAI BGE-small. Changing the language model and embeddings improves the response, but it still misses the best source. Reranking the top five retrieved results with Cohere produces a more relevant answer: help is available at booth five near the Eurostar gates at London St Pancras International.
Fernandes recommends tracing tools such as Arize Phoenix or LangSmith to see where pipeline time is spent, and Ragas to evaluate answers across more than one query. For production, he outlines Docker Compose containers for data ingestion, Qdrant, a front end, model serving through Ollama or Hugging Face Text Generation Inference, Phoenix, and Ragas. He expects to use open models from BAAI or NVIDIA for embeddings and reranking.
Takeaways
- Inspect retrieved source documents when an answer seems wrong; the model may be using irrelevant context.
- Use bi-encoders for broad, scalable retrieval and cross-encoders to rerank a smaller set of results.
- Test embedding and language model choices against your actual knowledge base and questions.
- Trace component timings and evaluate across many questions before relying on a RAG system in production.
- Choose deployment tools around operational needs: Fernandes uses Docker for on-premises environments and favors open models there.
Mentioned in this talk
Search inside this talk
What was claimed 16
- metricJonathan Fernandes: 37 failed attempts
“the RAG stack we landed on after 37 fails”
YouTube Unverified1 source· Talk
- usesfor prototyping
“a prototyping piece, which I normally do in Google Colab”
YouTube Unverified1 source· Talk
- usesJonathan Fernandes uses Dockerfor production deployments
“I'll often use Docker because I can run it either on-premises or ... in the cloud”
YouTube Unverified2 sources· Talk
- usesfor prototyping orchestration
“For prototyping, I'd use LlamaIndex or LangGraph”
YouTube Unverified1 source· Talk
- usesfor production orchestration
“in production, I'll use LlamaIndex”
YouTube Unverified1 source· Talk
- usesJonathan Fernandes uses
BAAIopen embedding models in production“such as one from BAAI or NVIDIA”
YouTube Unverified1 source· Talk
- usesJonathan Fernandes uses
Nvidia
open embedding models in production“When I move over to production, I'll use an open model, such as one from BAAI or NVIDIA”
YouTube Unverified1 source· Talk
- usesJonathan Fernandes uses
Qdrant
as his vector database“Qdrant is my choice for a vector database”
YouTube Unverified1 source· Talk
- feature
Qdrant: Scales from a few documents to hundreds of thousands of documents
“it scales really well”
YouTube Unverified1 source· Talk
- usesJonathan Fernandes uses
Ollama
to serve language models“I normally use Ollama ... to serve the Llama 3.2 models”
YouTube Unverified1 source· Talk
- usesfor prototype tracing and production monitoring
“Arize Phoenix for my prototype, and in production I'll often use Arize Phoenix”
YouTube Unverified1 source· Talk
- featurePhoenix: Docker container deployment
“I can easily run it in a Docker container”
YouTube Unverified1 source· Talk
- usesJonathan Fernandes uses
Ragas
to evaluate RAG quality“I'll use the Ragas framework for that”
YouTube Unverified1 source· Talk
- usesas the embedding model in the example
“What we're going to use here is the BAAI BGE-small model”
YouTube Unverified1 source· Talk
- usesJonathan Fernandes uses GPT-4
“Let's swap out that large language model and use another model from OpenAI, the GPT-4 model”
YouTube Unverified1 source· Talk
- usesJonathan Fernandes uses
Cohereto rerank the top results during prototyping“we're going to use a closed model, the one from Cohere”
YouTube Unverified1 source· Talk











