llamaindex langchain

LangChain/LangGraph vs LlamaIndex, my two cents about it

I started working with LangChain as part of a project for my company. While I discover and started to use LlamaIndex as part of a side…

I started working with LangChain as part of a project for my company. While I discover and started to use LlamaIndex as part of a side project.

At that time LangGraph, didn’t exist yet and I rapidly discover that working with graphs was a sine qua non to build complex chatbot experience. (So I did build my own DAG based platform with chatbot capacities to fix this lack.)

They don’t share the same purpose and don’t handle data the same way

While there are plenty of things you can do with either of these framework, their core purpose isn’t the same.

LangChain is to build applications

It provides numerous components that are chained together to build an application taking a query and returning an answer.

LlamaIndex is about information indexing

It focuses on providing indices components that you can then use to query your data.

LangChain always rely on external s olutions to store data while LlamaIndex propose its own by default.

If you have taken a look at tutorials about both framework, you might have notice that LangChain relies on existing vector database solutions to store data while LlamaIndex by default use it’s own format (even if you can opt out to use an external vector database).

To conclude

LangChain (or LangGraph) is the solution to use to build a complex application that works around LLMs, while LlamaIndex is the choice for an application that revolves around indexing and retrieving data to feed it to a LLM.

The good news is that you can mix the two together and use LangChain / LangGraph to build a complex application that will use LlamaIndex for the data indexing and retrieving part.