LangChain
LangChain is the most popular LLM application development framework, covering the full pipeline from prototype to production. Core modules: langchain-core (abstractions) / langchain (integrations) / langgraph (graph orchestration) / langsmith (observability).
Core concepts
- Model I/O: unified wrappers for LLMs, chat models, embeddings.
- Prompt Templates: templated prompts with variables, few-shot support.
- Output Parsers: parse LLM output into structured data.
- Chains: compose multiple steps into a pipeline.
- Agents: LLM-driven decision loops + tool use.
- Retrievers: retrieval abstraction layer, unified across vector stores.
LangGraph: state-machine agents
LangGraph models an Agent as a state graph (StateGraph):
- Nodes: each step (LLM call, tool execution, human input).
- Edges: transition conditions (routing, loops, conditionals).
- State: shared state object across nodes (TypedDict).
Good for complex flows: multi-agent, human-in-the-loop, recoverable execution.
LangSmith: observability
- Trace every LLM call, tool execution, token usage, latency.
- Online evaluation datasets.
- Prompt version management + A/B testing.
- Production monitoring and alerts.
Good for
- Agent / multi-step tool use: LangGraph first.
- Complex RAG / retrieval augmentation: LangChain + LlamaIndex mix.
- Production observability: LangSmith essential.
Caveats
- Frequent API iteration: many breaking changes between versions.
- Sometimes over-abstracted: simple needs take longer paths.
- Steep learning curve: Chain / Agent / Graph / Expression Language are many concepts.