Skip to main content

Installation

Langchain as a framework consists of a number of packages. They're split into different packages allowing you to choose exactly what pieces of the framework to install and use.

Installing essential Langchain.dart packages

langchain

Contains higher-level and use-case specific chains, agents, and retrieval algorithms that are at the core of the application's cognitive architecture.

Depend on this package to build LLM applications with Langchain.dart.

This package exposes langchain_core so you don't need to depend on it explicitly.

dart pub add langchain

langchain_core

This package contains base abstractions of different components and ways to compose them together. The interfaces for core components like LLMs, vector stores, retrievers and more are defined here.

Depend on this package to build frameworks on top of Langchain.dart or to interoperate with it.

To install this package in your Dart or Flutter project

dart pub add langchain_core

langchain_community

Contains third-party integrations and community-contributed components that are not part of the core Langchain.dart API.

Depend on this package if you want to use any of the integrations or components it provides like CSV,JSON,Text or HTML loaders and more.

dart pub add langchain langchain_community

Integration packages

Certain integrations like OpenAI and Anthropic have their own packages. Any integrations that require their own package will be documented as such in the Integration docs.

Let's say you're using OpenAI, install the langchain_openai package.

dart pub add langchain langchain_community langchain_openai

Let's say you want Google integration to use (GoogleAI, VertexAI, Gemini etc), install the langchain_google package.

dart pub add langchain langchain_community langchain_google

The following table contains the list of existing Langchain.dart integration packages.

PackageVersionDescription
langchain_corelangchain_coreCore abstractions and LCEL
langchainlangchainHigher-level and use-case specific chains, agents, and retrieval algorithms
langchain_communitylangchain_communityThird-party integrations (without specific packages) and community-contributed components and utilities
langchain_openailangchain_openaiOpenAI integration (GPT-3.5 Turbo, GPT-4, GPT-4o, Embeddings, Tools, Vision, DALL·E 3, etc.) and OpenAI Compatible services (TogetherAI, Anyscale, OpenRouter, One API, Groq, Llamafile, GPT4All, etc.)
langchain_googlelangchain_googleGoogle integration (GoogleAI, VertexAI, Gemini, PaLM 2, Embeddings, Vector Search, etc.)
langchain_firebaselangchain_firebaseFirebase integration (VertexAI for Firebase (Gemini 1.5 Pro, Gemini 1.5 Flash, etc.))
langchain_ollamalangchain_ollamaOllama integration (Llama 3, Phi-3, WizardLM-2, Mistral 7B, Gemma, CodeGemma, Command R, LLaVA, DBRX, Qwen 1.5, Dolphin, DeepSeek Coder, Vicuna, Orca, etc.)
langchain_mistralailangchain_mistralaiMistral AI integration (Mistral-7B, Mixtral 8x7B, Mixtral 8x22B, Mistral Small, Mistral Large, embeddings, etc.).
langchain_pineconelangchain_pineconePinecone vector database integration
langchain_chromalangchain_chromaChroma vector database integration
langchain_supabaselangchain_supabaseSupabase Vector database integration

Documentation

Detailed documentation for various integrations can be found in the /docs/05-integration/ directory: