Chapter 2. Optimizing AI

On multiple occasions, I’ve heard feedback from customers that LLM responses are too generic, or obviously AI generated. As humans, we are very sensitive to small discrepancies, and with the numerous options available, a low quality application makes it highly likely that the customer switches to another provider. In order to ensure high quality applications that attract customers, you need to be able to measure performance, and make improvements to performance

That satisfies customers. In this chapter, we will learn how to evaluate and optimize RAG applications. Specifically, we will go through how to evaluate RAG applications, and the levers of choice for improving the performance of our application, based on these evaluations.

RAG based applications in particular, have 6 distinct components to be optimized, based on use-case - including document extraction, chunking mechanism, embedding model, database, ...

Get Retrieval Augmented Generation in Production with Haystack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.