langchain 0.0.1 copy "langchain: ^0.0.1" to clipboard
langchain: ^0.0.1 copied to clipboard

Build powerful LLM-based Dart and Flutter applications with LangChain.dart.

🦜️🔗 LangChain.dart #

Test langchain MIT

Build powerful LLM-based Dart/Flutter applications.

🚧 Early Stage of Development 🚧 📢 Call for Collaborators 📢
Please note that this project is in a very early stage of development. We are still working on the initial version and there may be bugs and incomplete features. We are looking for collaborators to join the core group of maintainers.

What is LangChain.dart? #

LangChain.dart is a Dart port of the popular LangChain Python framework created by Harrison Chase.

LangChain provides a set of ready-to-use components for working with language models and the concept of chains, which allows to "chain" components together to formulate more advanced use cases around LLMs.

The components can be grouped into a few core modules:

LangChain.dart

  • Model I/O: streamlines the interaction between the model inputs (prompt templates), the Language Model (abstracting different providers), and the model output (output parsers).
  • Data Connection: assists in loading user data (document loaders), modifying it (document transformers), storing (via text embedding models and vector stores), and retrieving when needed (retrievers).
  • Chains: a way to compose multiple components or other chains into a single pipeline.
  • Memory: equips chains or agents with both short-term and long-term memory capabilities, facilitating recall of prior interactions with the user.
  • Agents: "Bots" that harness LLMs to perform tasks. They serve as the link between LLM and the tools (web search, calculators, database lookup, etc.). They determine what has to be accomplished and the tools that are more suitable for the specific task.

Motivation #

Large Language Models (LLMs) have revolutionized Natural Language Processing (NLP), serving as essential components in a wide range of applications, such as question-answering, summarization, translation, and text generation.

The adoption of LLMs is creating a new tech stack in its wake. However, most emerging libraries and tools are being predominantly developed for the Python and JavaScript ecosystems. As a result, the number of applications leveraging LLMs in these ecosystems has grown exponentially.

In contrast, the Dart / Flutter ecosystem has not experienced similar growth, which can likely be attributed to the scarcity of Dart and Flutter libraries that streamline the complexities associated with working with LLMs.

LangChain.dart aims to fill this gap by abstracting the intricacies of working with LLMs in Dart and Flutter, enabling developers to harness their combined potential effectively.

Packages #

LangChain.dart has a modular design where the core langchain package provides the LangChain API and each integration with a model provider, data store, etc. is provided by a separate package.

Package Version Description Models Data conn. Memory Tools
langchain langchain The core package that provides the LangChain API. 🟢 🟢 🟢 🟢
langchain_amazon langchain_amazon Integration with Amazon.
langchain_anthropic langchain_anthropic Integration with Anthropic.
langchain_chroma langchain_chroma Integration with Chroma.
langchain_cohere langchain_cohere Integration with Cohere.
langchain_google langchain_google Integration with Google.
langchain_huggingface langchain_huggingface Integration with Hugging Face.
langchain_microsoft langchain_microsoft Integration with Microsoft.
langchain_openai langchain_openai Integration with OpenAI.
langchain_pinecone langchain_pinecone Integration with Pinecone.
langchain_supabase langchain_supabase Integration with Supabase.
langchain_weaviate langchain_weaviate Integration with Weaviate.
langchain_wikipedia langchain_wikipedia Integration with Wikipedia.
langchain_wolfram langchain_wolfram Integration with Wolfram Research.
langchain_zapier langchain_zapier Integration with Zapier.

Getting started #

To start using LangChain.dart, add langchain as a dependency to your pubspec.yaml file. Also, include the dependencies for the specific integrations you want to use (e.g.langchain_openai):

dependencies:
  langchain: { version }
  langchain_openai: { version }

The most basic building block of LangChain is calling an LLM on some input:

final llm = OpenAI(apiKey: openaiApiKey, temperature: 0.9);
final result = await llm('Hello world!');

Documentation #

Support #

Having trouble? Get help in the official LangChain.dart Discord.

Contribute #

New contributors welcome! Check out our Contributors Guide for help getting started.

Join us on Discord to meet other maintainers. We'll help you get your first contribution in no time!

License #

LangChain.dart is licensed under the MIT License.

196
likes
0
pub points
92%
popularity

Publisher

verified publisherlangchaindart.dev

Build powerful LLM-based Dart and Flutter applications with LangChain.dart.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

characters, collection, cross_file, math_expressions, meta

More

Packages that depend on langchain