# Building AI automations with LangChain

> LangChain is an open-source framework in Python and TypeScript for building LLM applications and agents, with a standard interface to many model providers, vector stores and tools. Since version 1.0, its create_agent function runs on LangGraph, the lower-level runtime for durable, stateful agents, and middleware adds human approval, summarization and PII redaction. Pair it with LangSmith for tracing and evaluation. It fits code-first teams building agents and RAG systems that must work across providers.

- Category: Automation & AI Platforms
- Vendor: https://www.langchain.com/
- How to connect: LangChain Python and TypeScript libraries; LangGraph runtime; LangSmith tracing and evaluation; LangSmith Deployment; Provider and vector store integration packages
- Authentication: Each model provider, database and tool uses its own API keys or credentials, configured in your application
- Notes: LangChain 1.0 moved legacy chains and the old AgentExecutor into a separate langchain-classic package. Pin package versions, because provider integrations are released separately from the core library.
- Last updated: 2026-10-14

## What you can automate with LangChain

- **RAG knowledge assistant.** Load, split and embed company documents, retrieve the right passages and answer with citations in Slack or a web app. Guide: https://www.lumeor.studio/guides/build-rag-knowledge-assistant/
- **Connecting an LLM to internal data.** Give an agent read-only tools over your database, CRM and file storage, with permissions enforced in code. Guide: https://www.lumeor.studio/guides/connect-llm-to-internal-data/
- **Natural-language SQL reporting.** Turn plain-English questions into checked, read-only SQL and return the answer with the query used. Guide: https://www.lumeor.studio/guides/ai-natural-language-sql-reporting/
- **SOP assistant.** Answer how-do-I questions from your standard operating procedures, linking to the exact step in the source document. Guide: https://www.lumeor.studio/guides/build-internal-sop-assistant/
- **HR policy assistant.** Answer employee questions from the handbook and benefits documents, and hand off sensitive cases to HR. Guide: https://www.lumeor.studio/guides/ai-hr-policy-assistant/
- **Customer support agent.** Combine help center retrieval with order lookup tools and a human approval step for refunds and credits. Guide: https://www.lumeor.studio/guides/build-ai-customer-support-agent/

## What LangChain is good for

LangChain gives developers one interface over many moving parts: chat models from different providers, embeddings, vector stores, document loaders, retrievers and tools. Swapping OpenAI for Claude, or Pinecone for pgvector, becomes a configuration change instead of a rewrite.

The 1.0 release in late 2025 simplified the framework around a single agent entry point, `create_agent`, built on the LangGraph runtime. Middleware hooks run before and after model calls and around tool calls, which is where guardrails live: human approval before a sensitive tool runs, summarization when the conversation grows long, PII redaction before text reaches the model, and retries or model fallbacks.

When agents need more control, LangGraph exposes the runtime directly. You define nodes and edges over shared state, and get checkpointing, so a run can pause for a human, survive a crash and resume where it stopped. LangSmith adds traces of every step, datasets and evaluations, and a deployment option for long-running agents.

## How Lumeor uses it

We use LangChain and LangGraph for code-first agents and RAG systems that will live for years and may change providers. A typical build has a retrieval layer over Postgres with pgvector or Pinecone, an agent with a small set of well-described tools, middleware for approval and redaction, and LangSmith traces wired into the team's review process. We keep business rules in plain Python functions the agent calls, so they are unit tested like any other code.

For workflow plumbing such as triggers, CRM writes and Slack approvals, we often keep n8n in front and call the LangChain service from it. The [RAG knowledge assistant guide](/guides/build-rag-knowledge-assistant/) and the [n8n AI agents vs code agents comparison](/compare/n8n-ai-agents-vs-code-agents/) explain where that line sits.

## Limits to plan around

- **Abstraction cost.** Layers of abstractions can hide what is sent to the model. Read the traces, and drop to plain SDK calls where the framework gets in the way.
- **Version churn.** Integration packages move quickly and older tutorials use APIs that 1.0 moved into `langchain-classic`. Pin versions and upgrade deliberately.
- **Retrieval quality is on you.** LangChain provides the parts, not the tuning. Chunking, metadata, reranking and evaluation decide whether a RAG system is useful.
- **Hosting.** The libraries run in your application. Long-running or stateful agents need a database for checkpoints and a worker setup, or LangSmith Deployment.
- **Team skills.** It is a developer framework. Non-technical teams cannot maintain it the way they can maintain an n8n workflow.

## When to pick something else

- **n8n** when the agent is mostly integrations with a few AI steps, and operators should be able to read it.
- **LlamaIndex** when the hard part is parsing and retrieving from messy documents. See [LangChain vs LlamaIndex](/compare/langchain-vs-llamaindex/).
- **CrewAI** for role-based multi-agent crews you want to prototype quickly. See the [CrewAI page](/tools/crewai/).
- **A plain provider SDK** for a single-provider agent with a handful of tools.

## Frequently asked questions

### What is the difference between LangChain and LangGraph?

LangGraph is the low-level runtime for stateful agents, where you design the steps as a graph with checkpoints and pauses for human review. LangChain is the higher-level layer on top, with create_agent, middleware and a large set of integrations. Most projects start with LangChain and drop down to LangGraph when they need custom control flow.

### Do we need LangChain to build an AI agent?

No. A single-provider agent with a few tools can be written directly against the OpenAI or Claude SDK in a few hundred lines. LangChain earns its place when you need several providers, many integrations, durable state, or LangSmith's tracing and evaluation.

### Is LangChain free?

The LangChain and LangGraph libraries are open source under the MIT license. LangSmith, the hosted tracing, evaluation and deployment platform, has free and paid tiers. You also pay your model provider for usage.

### Can n8n and LangChain work together?

Yes. n8n's AI nodes are built on LangChain concepts such as chat models, memory, tools and vector stores. A common split is n8n for triggers, integrations and approvals, calling a LangChain service over HTTP for the agent logic that needs code.

---

Source: https://www.lumeor.studio/tools/langchain/
Published by Lumeor Studio, Newtown, PA. hello@lumeor.studio. Get a written scope: https://www.lumeor.studio/start/
