All Tools
LangChain logo

LangChain

LangChain is an open-source framework for building AI agents and LLM applications, with 1000+ integrations for any model or tool.

What is LangChain?

LangChain is an open-source Python and JavaScript framework for building AI agents and LLM (large language model) applications. It gives developers pre-built agent architectures, a unified interface for connecting to any model or tool, and over 1000 ready-made integrations covering vector databases, APIs, SaaS tools, and file systems. The framework runs on LangGraph’s durable runtime, so agents get persistence, checkpointing, and rewind capability out of the box. You can swap models, swap tools, and add custom middleware without touching your core application logic. For any developer building production AI systems, LangChain removes the repetitive wiring work so you can focus on what your agent actually does.

How LangChain works

LangChain structures AI applications as sequences of modular components. Each component handles one job, and you connect them together into a working system. The framework runs on top of LangGraph’s durable runtime, giving every agent built-in state management.

  • Models: LangChain connects to any LLM, including OpenAI, Anthropic, Mistral, Groq, and local models via Ollama, through a single consistent interface. Swapping the underlying model takes one line of code.
  • Integrations: Over 1000 connectors link your agent to vector databases, SQL databases, APIs, file systems, and SaaS tools. You pull in only what your application needs.
  • Chains: A chain is a sequence of steps your application runs in order. For example: retrieve relevant documents, summarize them, then pass the summary to a model. LangChain Expression Language (LCEL) makes these pipelines composable and readable.
  • Agents: An agent uses an LLM to decide which tools to call and in what order, based on user input. LangChain provides a create_agent function built around a proven ReAct (Reasoning and Acting) pattern, so you get a working decision loop without building one from scratch.
  • Memory: Memory components let agents recall previous turns in a conversation or information from earlier in a workflow, so responses stay context-aware across multiple steps.
  • Middleware hooks: You can intercept and modify agent behavior at key points without rewriting core logic. Common uses include adding human-in-the-loop approval before an action, compressing long conversation histories, and stripping sensitive data from prompts before they reach a model.

What you can build with LangChain

  • RAG-powered document assistant: Connect LangChain to a vector database like Pinecone or Qdrant, index your company’s internal documents, and build an assistant that retrieves the most relevant passages and answers questions with source citations. RAG, or Retrieval-Augmented Generation, means the model pulls in real content rather than guessing from memory.
  • Customer support chatbot: Build a multi-turn support bot that uses memory to track conversation context, calls tools to look up order status or account data, and escalates to a human when confidence is low. LangChain’s middleware hooks handle the handoff logic cleanly.
  • Automated research pipeline: Chain web search tools, PDF readers, and an LLM to build a pipeline that takes a research question, pulls relevant sources, summarizes each one, and produces a structured report. It cuts hours of manual research into minutes.
  • Code review agent: Give the agent access to your codebase via file tools, then have it read a pull request, check it against defined standards, flag issues, and suggest fixes. Useful for engineering teams that want automated first-pass reviews.
  • Adaptive tutoring system: Combine LangChain’s memory modules with a knowledge base of course material to build a tutor that personalizes explanations based on what a student has already asked, tracks misconceptions, and surfaces relevant examples on demand.
  • Data extraction pipeline: Feed unstructured documents, emails, or web pages into LangChain and use structured output tools to extract specific fields into a database or spreadsheet. Useful for operations teams pulling data from inconsistent sources at scale.

Key Features

  • Pre-built ReAct agent architecture to get started in minutes
  • 1000+ integrations with models, tools, and databases with no vendor lock-in
  • Composable middleware hooks for human-in-the-loop approvals and data filtering
  • Durable runtime via LangGraph with checkpointing, rewind, and persistence
  • Available in Python and JavaScript

FAQ

Is LangChain free to use? +

LangChain is free and MIT-licensed. The core framework has no cost or usage limits since you run it in your own environment. The LangSmith platform, which adds tracing, evaluation, and deployment, is separate and has a free tier plus paid plans. You can use LangChain without LangSmith entirely.

What is the difference between LangChain and LangGraph? +

LangChain is the high-level framework that provides pre-built agent architectures and integrations to get you building quickly. LangGraph is a lower-level orchestration library for building stateful, graph-based agent flows with fine-grained control. LangChain actually runs on LangGraph's durable runtime under the hood.

What languages does LangChain support? +

LangChain is available in both Python and JavaScript (TypeScript). The Python library is the most widely used and has the most complete integration coverage. The JavaScript version supports the same core patterns and works with Node.js, making it suitable for full-stack web applications and serverless functions.

Explore Similar AI Tools

Newsletter

The Twice-Monthly AI Briefing

Updates from the AI world — what shipped, what we’re using in production, and what’s worth your attention. Two emails a month, no spam.