# LangChain

> A free kit of code for making AI apps from chains of steps.

**Field:** Software Development  
**Category:** AI Engineering  
**Also known as:** LangChain Framework, LangChain.js

## Think of it like

Think of it like a toy train set. Each car does one job, and you hook the cars into a line.

## Definition

LangChain is a free, open-source framework for building apps on language models. It works in Python and JavaScript. It came out in 2022 and soon became one of the most used LLM frameworks. It gives one shared way to call many model makers, plus parts for prompts, tools, memory and search. Its main idea is the chain, where what one step puts out is what the next step takes in. The same team makes LangGraph for agents and LangSmith for tracing.

## Example

Emma builds a ticket tagger in LangChain. A prompt template, a model and an output parser are joined in one chain. It gives back a clean label.

## Example code

```python
chain = prompt | model | parser
result = chain.invoke({"ticket": "My card was charged twice."})
```

Three parts joined with the pipe sign into one chain, then run on one input.

## Why it matters

It has a huge set of ready links to models, data stores and tools. So a first version is quick to build.

## Common mistake

Stacking many layers of chains for a simple task. When something breaks, it gets hard to see which layer did it.

## Three principles

- **Chains of steps.** Output feeds input.
- **Many providers.** One common way.
- **Python and JavaScript.** Both supported.

## Related terms

- [LLM Framework](https://learn.benibix.com/term/development/llm-framework)
- [LangGraph](https://learn.benibix.com/term/development/langgraph)
- [LlamaIndex](https://learn.benibix.com/term/development/llamaindex)
- [Prompt Template](https://learn.benibix.com/term/ai/prompt-template)
- [LangSmith](https://learn.benibix.com/term/development/langsmith)

## Told apart from

- [LangChain vs LangGraph](https://learn.benibix.com/compare/langchain-vs-langgraph): People often think LangGraph is just the new name for LangChain, but they are two different tools made by the same team. LangChain gives the parts: links to models, prompts, tools and search, joined in straight chains. LangGraph sets out steps as a graph with loops, saved state and pauses, which is what agents need. Many projects use both.
- [LangChain vs LlamaIndex](https://learn.benibix.com/compare/langchain-vs-llamaindex): People think LangChain and LlamaIndex do the same job, and they do not. LangChain joins steps: a prompt, a model, a tool and a parser, one after another. LlamaIndex gets your own files ready for a model. It loads them, splits them and finds the right parts for each question. Many apps use both.

![Three blocks joined in a chain: a prompt template, a model and an output parser. Text goes in at one end and a clean result comes out the other.](https://learn.benibix.com/diagrams/dev-langchain.svg)

---

Source: https://learn.benibix.com/term/development/langchain
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
