A basic RAG system ingests data, retrieves relevant material, and uses an LLM to synthesize an answer. Liu says production systems often struggle with low retrieval precision or recall, outdated information, and LLM issues such as hallucinations and irrelevant responses.
Building Production-Ready RAG Applications
Speaker
Jerry Liu, co-founder and CEO of LlamaIndex, explains how to build production-ready RAG applications at an AI Engineer talk.
Liu recommends defining a task-specific benchmark before trying new techniques. Evaluate both the end-to-end answer and individual components: retrieval can use metrics such as hit rate, MRR, and NDCG, while synthesis can be assessed against human feedback, reference answers, or synthetic examples.
Start with better parsing, chunk-size tuning, hybrid search, and metadata filters. Liu notes that more retrieved tokens or reranking do not always improve answers, partly because models can miss relevant information in the middle of a long context. For an SEC 10-K question about 2021 risk factors, combining a year filter with semantic search can avoid results from other years.
Small-to-big retrieval embeds granular text, such as sentences, then expands the retrieved passage for answer generation. This can make relevant details easier to find while giving the LLM more context to synthesize. Liu also describes embedding a summary or questions a chunk answers instead of embedding the full chunk.
For questions requiring multiple reasoning steps, Liu describes treating documents as tools that can summarize or answer questions, then retrieving among those tools before using them. He also discusses fine-tuning embeddings with synthetic queries and distilling capabilities from a larger model such as GPT-4 into a smaller one to improve synthesis and structured outputs.
Takeaways
- Build a task-specific evaluation set before changing a RAG pipeline.
- Measure retrieval separately from end-to-end answer quality to locate the source of errors.
- Tune chunk size and test metadata filters; adding more context does not guarantee better answers.
- Try retrieving small, precise chunks and expanding context for synthesis.
- Use agents or fine-tuning when measured needs justify their added complexity, latency, or cost.
Mentioned in this talk
Search inside this talk
What was claimed 7
- foundedJerry Liu founded LlamaIndexCo-founder
“I'm Jerry, co-founder and CEO of LlamaIndex”
0:13inBuilding the Document Context Layer for AI AgentsYouTube Verified8 sources· Talk, Web· archived
- foundedSimon Suo founded LlamaIndexCTO and co-founder
“Simon, my co-founder”
YouTube Verified3 sources· Talk, Web· archived
- ceo ofJerry Liu CEO of LlamaIndexCEO
“co-founder and CEO of LlamaIndex”
0:13inBuilding the Document Context Layer for AI AgentsYouTube Verified5 sources· Talk
- featureLlamaIndex: Data ingestion and querying, including retrieval and synthesis
“This consists of two main components: data ingestion and data querying, which includes retrieval and synthesis.”
YouTube Unverified1 source· Talk
- metricLlamaIndex: About five lines of code to get started
“you can do this in about five lines of code”
YouTube Unverified1 source· Talk
- feature
Pinecone: Metadata filtering capabilities
“Vector databases like Chroma and Pinecone are all implementing these capabilities”
YouTube Unverified1 source· Talk
- feature
Chroma: Metadata filtering capabilities
“Vector databases like Chroma and Pinecone are all implementing these capabilities”
YouTube Unverified1 source· Talk













