Key takeaway
- How LangChain, LangGraph and LangSmith fit together for generative AI agents: create_agent, state, memory, evaluation and the governance agents need.
LangChain is an open-source framework for building applications and agents on large language models. Since version 1.0, released with LangGraph 1.0 on 22 October 2025, the standard way to build an agent is LangChain's create_agent, which runs on the LangGraph runtime, while LangSmith traces and evaluates what the agent does. Together they cover the build, run and observe stages of a generative AI agent.
This guide explains where generative agents came from, how the three LangChain products divide the work, how an agent loop runs, and what enterprises must add before an agent touches real systems.
What are generative agents?
The term comes from the Stanford and Google research paper Generative Agents: Interactive Simulacra of Human Behavior (Park et al., 2023). It described software agents that remember experiences, reflect on them and plan, so their behaviour stays believable over time. The architecture had three parts: a memory stream that records observations, a reflection step that turns memories into higher-level conclusions, and a planner that decides what to do next.
LangChain shipped an early implementation of the idea. Today the same building blocks, memory, reflection and planning, appear in most enterprise agents, whether they write code, handle service tickets or investigate fraud alerts. Our overview of how large language models power AI agents covers the wider picture.
How do LangChain, LangGraph and LangSmith fit together?
| Product | Role | Use it when |
|---|---|---|
| LangChain | Building blocks and the high-level create_agent API, with middleware hooks to customise each step of the agent loop | You want a working agent quickly with any model provider |
| LangGraph | Low-level orchestration runtime: graphs of nodes and edges, durable state, interrupts for human approval, resumable execution | You need custom control flow, long-running work or multi-agent designs |
| LangSmith | Tracing, evaluation and monitoring; framework-agnostic and supports OpenTelemetry | You need to debug, test and prove agent quality in production |
The 1.0 release announcement also deprecated LangGraph's create_react_agent in favour of create_agent and moved older features into a separate legacy package. Code that still uses LLMChain or initialize_agent predates this change and should be migrated.
How does a LangChain agent work?
An agent is a loop: the model decides whether to answer or call a tool, the tool runs, and the result goes back to the model until the task is done.

- Request: a user or system event starts the run, with a system prompt that defines the agent's job.
- Reason: the model reads the request, the state and the available tools, and chooses the next step.
- Act: the agent calls a tool, such as a database query, an API or a search over documents.
- Observe: the tool result is added to the conversation state.
- Remember: LangGraph persists state, so a long task can pause for human approval and resume later.
- Respond: once the model has enough, it returns a structured answer or completes the action.
What can enterprises build with LangChain agents?
- Knowledge assistants that answer questions from policies, contracts and manuals with citations.
- Service and IT operations agents that triage tickets, gather diagnostics and propose fixes.
- Analyst agents that query data, build a first draft of a report and explain the drivers.
- Software delivery agents that write tests, review changes and summarise pull requests.
- Simulation agents in the original generative-agents sense, used to test plans, training scenarios or customer journeys.
For build-versus-buy choices, see our guide to custom AI agents.
What are the risks of LangChain agents in production?
| Risk | What goes wrong | Control |
|---|---|---|
| Prompt injection | Text in a document or web page tells the agent to ignore its instructions | Treat tool output as data, restrict tools, validate actions |
| Excess permissions | An agent with broad API keys can change records it should only read | Least-privilege tools, per-action policy checks |
| Silent quality drift | A model or prompt change degrades answers without anyone noticing | Evaluation data sets and tracing in LangSmith or similar |
| Runaway cost | Loops and long contexts multiply token spend | Step limits, caching, model routing, budgets |
| No audit trail | Nobody can show why the agent made a decision | Decision traces that link input, context, policy and outcome |
Our guides to agentic AI security and LLM observability in production go deeper on these controls.
Where does governance sit around a LangChain agent?
A framework builds the agent; it does not decide what the agent is allowed to do in your business. That needs a layer that knows the decision context, the policy and the approvals, whichever framework the agent is written in.

This is where XenonStack fits. ElixirClaw is our AI agents computing platform for running enterprise agents with policy, approvals and monitoring. ElixirData Context OS supplies the decision context each agent needs and records a decision trace for audit. Teams can keep the frameworks their engineers prefer while the business keeps control of what agents decide. See also composable skills for agentic AI.
How should a team start with LangChain agents?
- Pick one bounded task with a clear owner and a measurable outcome.
- Start with create_agent and two or three read-only tools; add write actions only behind approval.
- Turn on tracing from day one and build a small evaluation set of real cases.
- Move to custom LangGraph graphs only when the task needs branching, long-running state or several agents.
- Define the policy and audit requirements before production, not after the first incident.
For the wider landscape, read our guide to what AI agents are.
To map one decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
Frequently asked questions
What is the difference between LangChain and LangGraph?
LangChain provides building blocks and the high-level create_agent API for a fast start. LangGraph is the lower-level runtime underneath, used for custom control flow, durable state, human-in-the-loop interrupts and multi-agent designs. Since version 1.0, create_agent runs on LangGraph.
Is LangChain still used in 2026?
Yes. LangChain and LangGraph reached version 1.0 in October 2025 with a commitment to stability, and LangSmith is widely used for tracing and evaluation. Older tutorials that use LLMChain or initialize_agent are out of date, though the concepts still apply.
What are generative agents?
Generative agents are AI agents that store memories, reflect on them and plan their behaviour. The concept comes from a 2023 Stanford and Google paper that simulated a small town of agents with believable daily routines.
Do I need LangSmith to use LangChain?
No. LangSmith is optional, and it also works with agents built on other frameworks or custom code. Most production teams use some form of tracing and evaluation, because agents fail in ways that ordinary logs do not reveal.
How do you govern a LangChain agent in an enterprise?
Limit each agent to least-privilege tools, require human approval for high-risk actions, evaluate quality continuously and record a decision trace that links the input, context, policy and outcome of every action.
Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE