A free, self-paced textbook in 8 chapters. Read a chapter, then drill it with the 166 companion flashcards using spaced repetition.
LangChain is an open-source Python framework for composing applications powered by large language models. Rather than wrapping a single model call, it provides modular building blo...
Prompts are how you talk to the model, and LangChain offers a small family of templates that interpolate variables, hold few-shot examples, or inject dynamic message lists. The sim...
LCEL's real power lies in its composition primitives, which let you express branching, fan-out, and routing as dataflow. RunnableSequence chains runnables sequentially, while Runna...
Conversational applications need to remember what the user has already said, and LangChain offers a layered set of tools, ranging from legacy Memory classes to the modern RunnableW...
The retrieval stack begins with the Document class, a tiny data wrapper with two fields: page_content as a string and metadata as a dict. Every loader, splitter, retriever, and vec...
A retrieval-augmented generation pipeline combines a retriever, a prompt, and an LLM so the model answers questions grounded in your own data. The canonical LCEL pattern is to buil...
Tools are how an LLM takes real action in the world. The tool decorator turns any Python function into a LangChain tool — the function's name becomes the tool's name, and its docst...
LangChain's observability story centers on callbacks and LangSmith. A BaseCallbackHandler subclass implements lifecycle hooks — on_llm_start, on_chat_model_start, on_llm_new_token,...