π LangChain
Descriptionβ
< What is it? >β
- Definition: LangChain is a framework for building applications and agents around language models. It provides interfaces and integrations for models, tools, and agent behavior. The application supplies its model, instructions, tools, and data; LangChain is not itself a language model. See the LangChain overview.
- Example: a support assistant can retrieve a return policy, include it in a model request, and produce an answer with a source reference.
Key pointsβ
< LangChain, LangGraph, and LangSmith working together >β
-
Workflow overview: the diagram separates execution control, application components, and tracing. It is redrawn from the supplied ByteMonk image.
-
LangGraph: controls workflow state, node execution, and branches. A node may call a language model, retrieve documents, execute a tool, or run ordinary application code.
-
LangChain: supplies model and tool abstractions and higher-level agent construction. Components such as prompt formatting and retrieval can be used inside workflow nodes. Its high-level agents use LangGraph underneath.
-
LangSmith: records instrumented runs for inspection and supports evaluation. The diagram's βTrace logger,β βOutput recorder,β and βDecision trackerβ labels describe recorded information, not three required standalone services. A trace exposes recorded actions and outputs, not a model's unobservable internal reasoning.
-
Reading the arrows: solid lines represent execution or data flow; dashed lines represent tracing events. The figure illustrates responsibilities rather than a mandatory deployment topology. LangGraph can be used without LangChain, and LangSmith can instrument applications built with other frameworks. See the LangGraph overview and LangSmith observability documentation.
Comparisonβ
< LangChain vs. LangGraph vs. LangSmith >β
-
Choose by responsibility: these tools address complementary application concerns.
Tool Main responsibility Use it when LangChain Model and tool integration; higher-level agent construction The application needs reusable integrations and an agent loop LangGraph Stateful orchestration with explicit transitions and branches The workflow needs custom control flow, persistence, or human review LangSmith Tracing, debugging, datasets, and evaluation Developers need to inspect execution and compare application quality LangSmith also supports prompt management and deployment; this diagram focuses on its observability role. See the official ecosystem overview.
Examplesβ
< A support question through the ecosystem >β
-
Illustrative input and output: the following is a designed workflow, not a recorded model run.
Step Concrete data or action User request βHow long do I have to return headphones?β Retrieval Document D17: βHeadphones may be returned within 30 days.βWorkflow decision Evidence is available, so continue to answer generation Model input The question, document D17, and an instruction to cite evidenceExpected answer βHeadphones can be returned within 30 days. [D17]β Trace Retrieval result, selected route, model request and response, duration, and errors if any
Related ideasβ
- LangGraph explains state, nodes, edges, and workflow control.
- LangSmith explains tracing and evaluation.
- LlamaIndex covers data ingestion and retrieval integration.
- Retrieval-Augmented Generation (RAG) explains grounding answers in retrieved documents.