|
1 | | -# 🦜️🔗 LangChain |
| 1 | +<picture> |
| 2 | + <source media="(prefers-color-scheme: light)" srcset="docs/static/img/logo-dark.svg"> |
| 3 | + <source media="(prefers-color-scheme: dark)" srcset="docs/static/img/logo-light.svg"> |
| 4 | + <img alt="LangChain Logo" src="docs/static/img/logo-dark.svg" width="80%"> |
| 5 | +</picture> |
2 | 6 |
|
3 | | -⚡ Build context-aware reasoning applications ⚡ |
| 7 | +<div> |
| 8 | +<br> |
| 9 | +</div> |
4 | 10 |
|
5 | 11 | [](https://github.com/langchain-ai/langchain/releases) |
6 | 12 | [](https://github.com/langchain-ai/langchain/actions/workflows/check_diffs.yml) |
|
12 | 18 | [](https://codespaces.new/langchain-ai/langchain) |
13 | 19 | [](https://twitter.com/langchainai) |
14 | 20 |
|
15 | | -Looking for the JS/TS library? Check out [LangChain.js](https://github.com/langchain-ai/langchainjs). |
| 21 | +> [!NOTE] |
| 22 | +> Looking for the JS/TS library? Check out [LangChain.js](https://github.com/langchain-ai/langchainjs). |
16 | 23 |
|
17 | | -To help you ship LangChain apps to production faster, check out [LangSmith](https://smith.langchain.com). |
18 | | -[LangSmith](https://smith.langchain.com) is a unified developer platform for building, testing, and monitoring LLM applications. |
19 | | -Fill out [this form](https://www.langchain.com/contact-sales) to speak with our sales team. |
20 | | - |
21 | | -## Quick Install |
22 | | - |
23 | | -With pip: |
24 | | - |
25 | | -```bash |
26 | | -pip install langchain |
27 | | -``` |
28 | | - |
29 | | -With conda: |
| 24 | +LangChain is a framework for building LLM-powered applications. It helps you chain |
| 25 | +together interoperable components and third-party integrations to simplify AI |
| 26 | +application development — all while future-proofing decisions as the underlying |
| 27 | +technology evolves. |
30 | 28 |
|
31 | 29 | ```bash |
32 | | -conda install langchain -c conda-forge |
| 30 | +pip install -U langchain |
33 | 31 | ``` |
34 | 32 |
|
35 | | -## 🤔 What is LangChain? |
36 | | - |
37 | | -**LangChain** is a framework for developing applications powered by large language models (LLMs). |
38 | | - |
39 | | -For these applications, LangChain simplifies the entire application lifecycle: |
40 | | - |
41 | | - |
42 | | -- **Open-source libraries**: Build your applications using LangChain's open-source |
43 | | -[components](https://python.langchain.com/docs/concepts/) and |
44 | | -[third-party integrations](https://python.langchain.com/docs/integrations/providers/). |
45 | | - Use [LangGraph](https://langchain-ai.github.io/langgraph/) to build stateful agents with first-class streaming and human-in-the-loop support. |
46 | | -- **Productionization**: Inspect, monitor, and evaluate your apps with [LangSmith](https://docs.smith.langchain.com/) so that you can constantly optimize and deploy with confidence. |
47 | | -- **Deployment**: Turn your LangGraph applications into production-ready APIs and Assistants with [LangGraph Platform](https://langchain-ai.github.io/langgraph/cloud/). |
48 | | - |
49 | | -### Open-source libraries |
50 | | - |
51 | | -- **`langchain-core`**: Base abstractions. |
52 | | -- **Integration packages** (e.g. **`langchain-openai`**, **`langchain-anthropic`**, etc.): Important integrations have been split into lightweight packages that are co-maintained by the LangChain team and the integration developers. |
53 | | -- **`langchain`**: Chains, agents, and retrieval strategies that make up an application's cognitive architecture. |
54 | | -- **`langchain-community`**: Third-party integrations that are community maintained. |
55 | | -- **[LangGraph](https://langchain-ai.github.io/langgraph)**: LangGraph powers production-grade agents, trusted by Linkedin, Uber, Klarna, GitLab, and many more. Build robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph. Integrates smoothly with LangChain, but can be used without it. To learn more about LangGraph, check out our first LangChain Academy course, *Introduction to LangGraph*, available [here](https://academy.langchain.com/courses/intro-to-langgraph). |
56 | | - |
57 | | -### Productionization: |
58 | | - |
59 | | -- **[LangSmith](https://docs.smith.langchain.com/)**: A developer platform that lets you debug, test, evaluate, and monitor chains built on any LLM framework and seamlessly integrates with LangChain. |
60 | | - |
61 | | -### Deployment: |
62 | | - |
63 | | -- **[LangGraph Platform](https://langchain-ai.github.io/langgraph/cloud/)**: Turn your LangGraph applications into production-ready APIs and Assistants. |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | -## 🧱 What can you build with LangChain? |
69 | | - |
70 | | -**❓ Question answering with RAG** |
71 | | - |
72 | | -- [Documentation](https://python.langchain.com/docs/tutorials/rag/) |
73 | | -- End-to-end Example: [Chat LangChain](https://chat.langchain.com) and [repo](https://github.com/langchain-ai/chat-langchain) |
74 | | - |
75 | | -**🧱 Extracting structured output** |
76 | | - |
77 | | -- [Documentation](https://python.langchain.com/docs/tutorials/extraction/) |
78 | | -- End-to-end Example: [LangChain Extract](https://github.com/langchain-ai/langchain-extract/) |
79 | | - |
80 | | -**🤖 Chatbots** |
81 | | - |
82 | | -- [Documentation](https://python.langchain.com/docs/tutorials/chatbot/) |
83 | | -- End-to-end Example: [Web LangChain (web researcher chatbot)](https://weblangchain.vercel.app) and [repo](https://github.com/langchain-ai/weblangchain) |
84 | | - |
85 | | -And much more! Head to the [Tutorials](https://python.langchain.com/docs/tutorials/) section of the docs for more. |
86 | | - |
87 | | -## 🚀 How does LangChain help? |
88 | | - |
89 | | -The main value props of the LangChain libraries are: |
90 | | - |
91 | | -1. **Components**: composable building blocks, tools and integrations for working with language models. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not. |
92 | | -2. **Easy orchestration with LangGraph**: [LangGraph](https://langchain-ai.github.io/langgraph/), |
93 | | -built on top of `langchain-core`, has built-in support for [messages](https://python.langchain.com/docs/concepts/messages/), [tools](https://python.langchain.com/docs/concepts/tools/), |
94 | | -and other LangChain abstractions. This makes it easy to combine components into |
95 | | -production-ready applications with persistence, streaming, and other key features. |
96 | | -Check out the LangChain [tutorials page](https://python.langchain.com/docs/tutorials/#orchestration) for examples. |
97 | | - |
98 | | -## Components |
99 | | - |
100 | | -Components fall into the following **modules**: |
101 | | - |
102 | | -**📃 Model I/O** |
103 | | - |
104 | | -This includes [prompt management](https://python.langchain.com/docs/concepts/prompt_templates/) |
105 | | -and a generic interface for [chat models](https://python.langchain.com/docs/concepts/chat_models/), including a consistent interface for [tool-calling](https://python.langchain.com/docs/concepts/tool_calling/) and [structured output](https://python.langchain.com/docs/concepts/structured_outputs/) across model providers. |
106 | | - |
107 | | -**📚 Retrieval** |
108 | | - |
109 | | -Retrieval Augmented Generation involves [loading data](https://python.langchain.com/docs/concepts/document_loaders/) from a variety of sources, [preparing it](https://python.langchain.com/docs/concepts/text_splitters/), then [searching over (a.k.a. retrieving from)](https://python.langchain.com/docs/concepts/retrievers/) it for use in the generation step. |
110 | | - |
111 | | -**🤖 Agents** |
112 | | - |
113 | | -Agents allow an LLM autonomy over how a task is accomplished. Agents make decisions about which Actions to take, then take that Action, observe the result, and repeat until the task is complete. [LangGraph](https://langchain-ai.github.io/langgraph/) makes it easy to use |
114 | | -LangChain components to build both [custom](https://langchain-ai.github.io/langgraph/tutorials/) |
115 | | -and [built-in](https://langchain-ai.github.io/langgraph/how-tos/create-react-agent/) |
116 | | -LLM agents. |
117 | | - |
118 | | -## 📖 Documentation |
119 | | - |
120 | | -Please see [here](https://python.langchain.com) for full documentation, which includes: |
121 | | - |
122 | | -- [Introduction](https://python.langchain.com/docs/introduction/): Overview of the framework and the structure of the docs. |
123 | | -- [Tutorials](https://python.langchain.com/docs/tutorials/): If you're looking to build something specific or are more of a hands-on learner, check out our tutorials. This is the best place to get started. |
124 | | -- [How-to guides](https://python.langchain.com/docs/how_to/): Answers to “How do I….?” type questions. These guides are goal-oriented and concrete; they're meant to help you complete a specific task. |
125 | | -- [Conceptual guide](https://python.langchain.com/docs/concepts/): Conceptual explanations of the key parts of the framework. |
126 | | -- [API Reference](https://python.langchain.com/api_reference/): Thorough documentation of every class and method. |
127 | | - |
128 | | -## 🌐 Ecosystem |
129 | | - |
130 | | -- [🦜🛠️ LangSmith](https://docs.smith.langchain.com/): Trace and evaluate your language model applications and intelligent agents to help you move from prototype to production. |
131 | | -- [🦜🕸️ LangGraph](https://langchain-ai.github.io/langgraph/): Create stateful, multi-actor applications with LLMs. Integrates smoothly with LangChain, but can be used without it. |
132 | | -- [🦜🕸️ LangGraph Platform](https://langchain-ai.github.io/langgraph/concepts/#langgraph-platform): Deploy LLM applications built with LangGraph into production. |
133 | | - |
134 | | -## 💁 Contributing |
135 | | - |
136 | | -As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation. |
137 | | - |
138 | | -For detailed information on how to contribute, see [here](https://python.langchain.com/docs/contributing/). |
139 | | - |
140 | | -## 🌟 Contributors |
141 | | - |
142 | | -[](https://github.com/langchain-ai/langchain/graphs/contributors) |
| 33 | +To learn more about LangChain, check out |
| 34 | +[the docs](https://python.langchain.com/docs/introduction/). If you’re looking for more |
| 35 | +advanced customization or agent orchestration, check out |
| 36 | +[LangGraph](https://langchain-ai.github.io/langgraph/), our framework for building |
| 37 | +controllable agent workflows. |
| 38 | + |
| 39 | +## Why use LangChain? |
| 40 | + |
| 41 | +LangChain helps developers build applications powered by LLMs through a standard |
| 42 | +interface for models, embeddings, vector stores, and more. |
| 43 | + |
| 44 | +Use LangChain for: |
| 45 | +- **Real-time data augmentation**. Easily connect LLMs to diverse data sources and |
| 46 | +external / internal systems, drawing from LangChain’s vast library of integrations with |
| 47 | +model providers, tools, vector stores, retrievers, and more. |
| 48 | +- **Model interoperability**. Swap models in and out as your engineering team |
| 49 | +experiments to find the best choice for your application’s needs. As the industry |
| 50 | +frontier evolves, adapt quickly — LangChain’s abstractions keep you moving without |
| 51 | +losing momentum. |
| 52 | + |
| 53 | +## LangChain’s ecosystem |
| 54 | +While the LangChain framework can be used standalone, it also integrates seamlessly |
| 55 | +with any LangChain product, giving developers a full suite of tools when building LLM |
| 56 | +applications. |
| 57 | + |
| 58 | +To improve your LLM application development, pair LangChain with: |
| 59 | + |
| 60 | +- [LangSmith](http://www.langchain.com/langsmith) - Helpful for agent evals and |
| 61 | +observability. Debug poor-performing LLM app runs, evaluate agent trajectories, gain |
| 62 | +visibility in production, and improve performance over time. |
| 63 | +- [LangGraph](https://langchain-ai.github.io/langgraph/) - Build agents that can |
| 64 | +reliably handle complex tasks with LangGraph, our low-level agent orchestration |
| 65 | +framework. LangGraph offers customizable architecture, long-term memory, and |
| 66 | +human-in-the-loop workflows — and is trusted in production by companies like LinkedIn, |
| 67 | +Uber, Klarna, and GitLab. |
| 68 | +- [LangGraph Platform](https://langchain-ai.github.io/langgraph/concepts/#langgraph-platform) - Deploy |
| 69 | +and scale agents effortlessly with a purpose-built deployment platform for long |
| 70 | +running, stateful workflows. Discover, reuse, configure, and share agents across |
| 71 | +teams — and iterate quickly with visual prototyping in |
| 72 | +[LangGraph Studio](https://langchain-ai.github.io/langgraph/concepts/langgraph_studio/). |
| 73 | + |
| 74 | +## Additional resources |
| 75 | +- [Tutorials](https://python.langchain.com/docs/tutorials/): Simple walkthroughs with |
| 76 | +guided examples on getting started with LangChain. |
| 77 | +- [How-to Guides](https://python.langchain.com/docs/how_to/): Quick, actionable code |
| 78 | +snippets for topics such as tool calling, RAG use cases, and more. |
| 79 | +- [Conceptual Guides](https://python.langchain.com/docs/concepts/): Explanations of key |
| 80 | +concepts behind the LangChain framework. |
| 81 | +- [API Reference](https://python.langchain.com/api_reference/): Detailed reference on |
| 82 | +navigating base packages and integrations for LangChain. |
0 commit comments