From the course: Introduction to AI Orchestration with LangChain and LlamaIndex

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

RAG with LangChain

RAG with LangChain

When it started out, LlamaIndex was considered the framework for doing RAG, but LangChain is rapidly catching up. How will it compare? As we go through the LangChain version of our app, pay attention to the similarities and the differences. One thing I discovered is that there's a lot of ways to accomplish this use case with LangChain. Part of the Zen of Python says there should be one and preferably only one obvious way to do it, but LangChain gives us options. We'll go with one of the simpler ones here. Naturally, we'll use a chain, in this case a prebuilt one, instead of constructing it from LCEL. Here's the directory structure we're using. The data is in the handbook directory as before. And this time, we'll create a directory called handbook_faiss to store the index on disk. The structure of our app looks a lot like the LlamaIndex one we previously built. One difference is that we're using sentence transformer embeddings. And we're specifying an explicit vector store using FAISS…

Contents