LangChain.dart is a Dart port of Python's LangChain framework.
Attribution note: most of the docs are just an adaptation of the original Python LangChain docs.
LangChain is a framework for developing applications powered by language models. It enables applications that are:
- Context-aware: connect a language model to sources of context (prompt instructions, few shot examples, content to ground its response in, etc.).
- Reason: rely on a language model to reason (about how to answer based on provided context, what actions to take, etc.)
The main value prop of LangChain are:
- Components: composable tools and integrations for working with language models. Components are modular and easy-to-use.
- Off-the-shelf chains: built-in assemblages of components for accomplishing higher-level tasks.
Off-the-shelf chains make it easy to get started. Components make it easy to customize existing chains and build new ones.
The LangChain.dart framework is made up of several different packages:
LangChain.dart has a modular design where the core langchain package provides the LangChain API and each integration with a model provider, database, etc. is provided by a separate package.
Here’s how to install LangChain, set up your environment, and start building.
We recommend following our Quickstart guide to familiarize yourself with the framework by building your first LangChain application.
Note: These docs are for the LangChain Dart package. For documentation on LangChain Python click here, and for LangChain.js click here.
LCEL is a declarative way to compose chains. LCEL was designed from day 1 to support putting prototypes in production, with no code changes, from the simplest “prompt + LLM” chain to the most complex chains.
- Overview: LCEL and its benefits
- Interface: The standard interface for LCEL objects
- Cookbook: Example code for accomplishing common tasks
LangChain.dart provides standard, extendable interfaces and integrations for the following modules:
Model I/O
Interface with language models.
Retrieval
Interface with application-specific data.
Agents
Let models choose which tools to use given high-level directives
Walkthroughes and best-practices for common end-to-end use cases, like:
- Document question answering
- Chatbots
- Analyzing structured data
- and much more...
Best practices for developing with LangChain.
LangChain is part of a rich ecosystem of tools that integrate with our framework and build on top of it. Check out our growing list of integrations and dependent repos.
Head to the reference section for full documentation of all classes and methods in the LangChain Dart package.
Check out the developer's guide for guidelines on contributing and help getting your dev environment set up.
Our community is full of prolific developers, creative builders, and fantastic teachers. Join us on GitHub or Discord to ask questions, share feedback, meet other developers building with LangChain.dart, and dream about the future of LLM’s.