In plain terms
LangChain is a Python library that makes it easy to build applications on top of AI models. Instead of writing low-level code to call the model, manage prompts, and handle documents, LangChain gives you ready-made building blocks โ loaders, splitters, chains, retrievers โ that you assemble into a workflow.
Typical use cases
- RAG pipelines โ load documents, search ChromaDB, answer questions
- Automated summarisation of reports or emails
- Document classification and routing
- Multi-step AI reasoning (chain of thought)
- Extracting structured data (tables, entities) from unstructured text
Load your documents
LangChain has loaders for PDFs, Word files, web pages, CSV files, and more. One line of code loads a folder of documents.
Split into chunks
Documents are split into overlapping text chunks. LangChain handles the splitting logic โ you just set the chunk size.
Store in ChromaDB
The chunks are embedded and stored in ChromaDB. LangChain handles the connection and embedding automatically.
Query and answer
When a user asks a question, LangChain retrieves relevant chunks from ChromaDB and sends them to Ollama with the question. The answer comes back and is returned to the user.
Use Jupyter Notebook
The best place to write and test LangChain code is Jupyter Notebook. Open it at http://ai.local:8888, create a new notebook, and import LangChain. You can run each step individually and see the output immediately โ no need to write a full application.