LangChain (2022): Building LLM Applications
LangChain is a framework to build LLM applications, released by Harrison Chase in October 2022.
A framework to build LLM applications
LangChain is a framework to build LLM applications. Created by Harrison Chase and released as open source in October 2022, it arrived just before ChatGPT and gave developers composable primitives for prompts, chains, memory, tools, and retrieval.
RAG provided the retrieval pattern. LangChain made it easy to wire retrieval, model calls, output parsing, and tool use into reusable application code.
Composing RAG with LangChain
from langchain.chains import RetrievalQA
from langchain_openai import ChatOpenAI
from langchain_community.vectorstores import PGVector
# Connect retrieval (RAG) to generation (LLM)
vectorstore = PGVector.from_documents(docs, embeddings, connection_string=DB_URL)
retriever = vectorstore.as_retriever(search_kwargs={"k": 5})
qa_chain = RetrievalQA.from_chain_type(
llm=ChatOpenAI(model="gpt-4o"),
retriever=retriever,
return_source_documents=True,
)
result = qa_chain.invoke({"query": "Best hotels in Kyoto?"})LangChain standardized how teams connect RAG retrievers to LLMs, wrap prompts in templates, and return source documents for citation. It became the default starting point for LLM application development after 2022.
The gap LangChain left open
LangChain chains are linear. Real agents loop, branch, pause for human input, and maintain state across steps. That limitation led directly to LangGraph in 2024. LangChain builds the application. LangGraph orchestrates it.