seansullivan/Langchain-Docs huggingface dataset:
## SQLite

> [SQLite](https://en.wikipedia.org/wiki/SQLite) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the most widely deployed database engine, as it is used by several of the top web browsers, operating systems, mobile phones, and other embedded systems.

In this walkthrough we’ll create a simple conversation chain which uses `ConversationEntityMemory` backed by a `SqliteEntityStore`.

```
# os.environ["LANGCHAIN_TRACING_V2"] = "true"# os.environ["LANGCHAIN_API_KEY"] = getpass.getpass()
```

## Usage[​](#usage "Direct link to Usage")

To use the storage you need to provide only 2 things:

1.  Session Id - a unique identifier of the session, like user name, email, chat id etc.
2.  Connection string - a string that specifies the database connection. For SQLite, that string is `slqlite:///` followed by the name of the database file. If that file doesn’t exist, it will be created.

```
from langchain_community.chat_message_histories import SQLChatMessageHistorychat_message_history = SQLChatMessageHistory(    session_id="test_session_id", connection_string="sqlite:///sqlite.db")chat_message_history.add_user_message("Hello")chat_message_history.add_ai_message("Hi")
```

```
chat_message_history.messages
```

```
[HumanMessage(content='Hello'), AIMessage(content='Hi')]
```

## Chaining[​](#chaining "Direct link to Chaining")

We can easily combine this message history class with [LCEL Runnables](https://python.langchain.com/docs/expression_language/how_to/message_history/)

To do this we will want to use OpenAI, so we need to install that. We will also need to set the OPENAI\_API\_KEY environment variable to your OpenAI key.

```
pip install -U langchain-openaiexport OPENAI_API_KEY='sk-xxxxxxx'
```

```
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholderfrom langchain_core.runnables.history import RunnableWithMessageHistoryfrom langchain_openai import ChatOpenAI
```

```
prompt = ChatPromptTemplate.from_messages(    [        ("system", "You are a helpful assistant."),        MessagesPlaceholder(variable_name="history"),        ("human", "{question}"),    ])chain = prompt | ChatOpenAI()
```

```
chain_with_history = RunnableWithMessageHistory(    chain,    lambda session_id: SQLChatMessageHistory(        session_id=session_id, connection_string="sqlite:///sqlite.db"    ),    input_messages_key="question",    history_messages_key="history",)
```

```
# This is where we configure the session idconfig = {"configurable": {"session_id": "<SQL_SESSION_ID>"}}
```

```
chain_with_history.invoke({"question": "Hi! I'm bob"}, config=config)
```

```
AIMessage(content='Hello Bob! How can I assist you today?')
```

```
chain_with_history.invoke({"question": "Whats my name"}, config=config)
```

```
AIMessage(content='Your name is Bob! Is there anything specific you would like assistance with, Bob?')
```
This notebook goes over how to use `Upstash Redis` to store chat message history.

```
from langchain_community.chat_message_histories import (    UpstashRedisChatMessageHistory,)URL = "<UPSTASH_REDIS_REST_URL>"TOKEN = "<UPSTASH_REDIS_REST_TOKEN>"history = UpstashRedisChatMessageHistory(    url=URL, token=TOKEN, ttl=10, session_id="my-test-session")history.add_user_message("hello llm!")history.add_ai_message("hello user!")
```
## ByteDance

> [ByteDance](https://bytedance.com/) is a Chinese internet technology company.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

Get the access token. You can find the access instructions [here](https://open.larksuite.com/document)

## Document Loader[​](#document-loader "Direct link to Document Loader")

### Lark Suite[​](#lark-suite "Direct link to Lark Suite")

> [Lark Suite](https://www.larksuite.com/) is an enterprise collaboration platform developed by `ByteDance`.

See a [usage example](https://python.langchain.com/docs/integrations/document_loaders/larksuite/).

```
from langchain_community.document_loaders.larksuite import LarkSuiteDocLoader
```
## Cassandra

> [Apache Cassandra®](https://cassandra.apache.org/) is a NoSQL, row-oriented, highly scalable and highly available database. Starting with version 5.0, the database ships with [vector search capabilities](https://cassandra.apache.org/doc/trunk/cassandra/vector-search/overview.html).

The integrations outlined in this page can be used with `Cassandra` as well as other CQL-compatible databases, i.e. those using the `Cassandra Query Language` protocol.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

Install the following Python package:

```
pip install "cassio>=0.1.4"
```

## Vector Store[​](#vector-store "Direct link to Vector Store")

```
from langchain_community.vectorstores import Cassandra
```

Learn more in the [example notebook](https://python.langchain.com/docs/integrations/vectorstores/cassandra/).

## Chat message history[​](#chat-message-history "Direct link to Chat message history")

```
from langchain_community.chat_message_histories import CassandraChatMessageHistory
```

Learn more in the [example notebook](https://python.langchain.com/docs/integrations/memory/cassandra_chat_message_history/).

## LLM Cache[​](#llm-cache "Direct link to LLM Cache")

```
from langchain.globals import set_llm_cachefrom langchain_community.cache import CassandraCacheset_llm_cache(CassandraCache())
```

Learn more in the [example notebook](https://python.langchain.com/docs/integrations/llms/llm_caching/#cassandra-caches) (scroll to the Cassandra section).

## Semantic LLM Cache[​](#semantic-llm-cache "Direct link to Semantic LLM Cache")

```
from langchain.globals import set_llm_cachefrom langchain_community.cache import CassandraSemanticCacheset_llm_cache(CassandraSemanticCache(    embedding=my_embedding,    table_name="my_store",))
```

Learn more in the [example notebook](https://python.langchain.com/docs/integrations/llms/llm_caching/#cassandra-caches) (scroll to the appropriate section).

## Document loader[​](#document-loader "Direct link to Document loader")

```
from langchain_community.document_loaders import CassandraLoader
```

Learn more in the [example notebook](https://python.langchain.com/docs/integrations/document_loaders/cassandra/).

#### Attribution statement[​](#attribution-statement "Direct link to Attribution statement")

> Apache Cassandra, Cassandra and Apache are either registered trademarks or trademarks of the [Apache Software Foundation](http://www.apache.org/) in the United States and/or other countries.
[

## 📄️ Clarifai

Clarifai is one of first deep learning platforms having been founded in 2013. Clarifai provides an AI platform with the full AI lifecycle for data exploration, data labeling, model training, evaluation and inference around images, video, text and audio data. In the LangChain ecosystem, as far as we're aware, Clarifai is the only provider that supports LLMs, embeddings and a vector store in one production scale platform, making it an excellent choice to operationalize your LangChain implementations.

](https://python.langchain.com/docs/integrations/providers/clarifai/)
## AI21 Labs

> [AI21 Labs](https://www.ai21.com/about) is a company specializing in Natural Language Processing (NLP), which develops AI systems that can understand and generate natural language.

This page covers how to use the `AI21` ecosystem within `LangChain`.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

*   Get an AI21 api key and set it as an environment variable (`AI21_API_KEY`)
*   Install the Python package:

```
pip install langchain-ai21
```

## LLMs[​](#llms "Direct link to LLMs")

See a [usage example](https://python.langchain.com/docs/integrations/llms/ai21/).

```
from langchain_community.llms import AI21
```

## Chat models[​](#chat-models "Direct link to Chat models")

See a [usage example](https://python.langchain.com/docs/integrations/chat/ai21/).

```
from langchain_ai21 import ChatAI21
```

## Embedding models[​](#embedding-models "Direct link to Embedding models")

See a [usage example](https://python.langchain.com/docs/integrations/text_embedding/ai21/).

```
from langchain_ai21 import AI21Embeddings
```

* * *

#### Help us out by providing feedback on this documentation page:
## Acreom

[acreom](https://acreom.com/) is a dev-first knowledge base with tasks running on local `markdown` files.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

No installation is required.

## Document Loader[​](#document-loader "Direct link to Document Loader")

See a [usage example](https://python.langchain.com/docs/integrations/document_loaders/acreom/).

```
from langchain_community.document_loaders import AcreomLoader
```

* * *

#### Help us out by providing feedback on this documentation page:
## CerebriumAI

> [Cerebrium](https://docs.cerebrium.ai/cerebrium/getting-started/introduction) is a serverless GPU infrastructure provider. It provides API access to several LLM models.

See the examples in the [CerebriumAI documentation](https://docs.cerebrium.ai/examples/langchain).

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

*   Install a python package:

*   [Get an CerebriumAI api key](https://docs.cerebrium.ai/cerebrium/getting-started/installation) and set it as an environment variable (`CEREBRIUMAI_API_KEY`)

## LLMs[​](#llms "Direct link to LLMs")

See a [usage example](https://python.langchain.com/docs/integrations/llms/cerebriumai/).

```
from langchain_community.llms import CerebriumAI
```

* * *

#### Help us out by providing feedback on this documentation page:
## Activeloop Deep Lake

> [Activeloop Deep Lake](https://docs.activeloop.ai/) is a data lake for Deep Learning applications, allowing you to use it as a vector store.

## Why Deep Lake?[​](#why-deep-lake "Direct link to Why Deep Lake?")

*   More than just a (multi-modal) vector store. You can later use the dataset to fine-tune your own LLM models.
*   Not only stores embeddings, but also the original data with automatic version control.
*   Truly serverless. Doesn't require another service and can be used with major cloud providers (`AWS S3`, `GCS`, etc.)

`Activeloop Deep Lake` supports `SelfQuery Retrieval`: [Activeloop Deep Lake Self Query Retrieval](https://python.langchain.com/docs/integrations/retrievers/self_query/activeloop_deeplake_self_query/)

## More Resources[​](#more-resources "Direct link to More Resources")

1.  [Ultimate Guide to LangChain & Deep Lake: Build ChatGPT to Answer Questions on Your Financial Data](https://www.activeloop.ai/resources/ultimate-guide-to-lang-chain-deep-lake-build-chat-gpt-to-answer-questions-on-your-financial-data/)
2.  [Twitter the-algorithm codebase analysis with Deep Lake](https://github.com/langchain-ai/langchain/blob/master/cookbook/twitter-the-algorithm-analysis-deeplake.ipynb)
3.  Here is [whitepaper](https://www.deeplake.ai/whitepaper) and [academic paper](https://arxiv.org/pdf/2209.10785.pdf) for Deep Lake
4.  Here is a set of additional resources available for review: [Deep Lake](https://github.com/activeloopai/deeplake), [Get started](https://docs.activeloop.ai/getting-started) and [Tutorials](https://docs.activeloop.ai/hub-tutorials)

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

Install the Python package:

```
pip install deeplake
```

## VectorStore[​](#vectorstore "Direct link to VectorStore")

```
from langchain_community.vectorstores import DeepLake
```

See a [usage example](https://python.langchain.com/docs/integrations/vectorstores/activeloop_deeplake/).

* * *

#### Help us out by providing feedback on this documentation page:
[Airtable](https://en.wikipedia.org/wiki/Airtable) is a cloud collaboration service. `Airtable` is a spreadsheet-database hybrid, with the features of a database but applied to a spreadsheet. The fields in an Airtable table are similar to cells in a spreadsheet, but have types such as 'checkbox', 'phone number', and 'drop-down list', and can reference file attachments like images.

Users can create a database, set up column types, add records, link tables to one another, collaborate, sort records and publish views to external websites.

```
from langchain_community.document_loaders import AirtableLoader
```
## Cloudflare

> [Cloudflare, Inc. (Wikipedia)](https://en.wikipedia.org/wiki/Cloudflare) is an American company that provides content delivery network services, cloud cybersecurity, DDoS mitigation, and ICANN-accredited domain registration services.

> [Cloudflare Workers AI](https://developers.cloudflare.com/workers-ai/) allows you to run machine learning models, on the `Cloudflare` network, from your code via REST API.

## Embedding models[​](#embedding-models "Direct link to Embedding models")

See [installation instructions and usage example](https://python.langchain.com/docs/integrations/text_embedding/cloudflare_workersai/).

```
from langchain_community.embeddings.cloudflare_workersai import CloudflareWorkersAIEmbeddings
```
## Aleph Alpha

> [Aleph Alpha](https://docs.aleph-alpha.com/) was founded in 2019 with the mission to research and build the foundational technology for an era of strong AI. The team of international scientists, engineers, and innovators researches, develops, and deploys transformative AI like large language and multimodal models and runs the fastest European commercial AI cluster.

> [The Luminous series](https://docs.aleph-alpha.com/docs/introduction/luminous/) is a family of large language models.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

```
pip install aleph-alpha-client
```

You have to create a new token. Please, see [instructions](https://docs.aleph-alpha.com/docs/account/#create-a-new-token).

```
from getpass import getpassALEPH_ALPHA_API_KEY = getpass()
```

## LLM[​](#llm "Direct link to LLM")

See a [usage example](https://python.langchain.com/docs/integrations/llms/aleph_alpha/).

```
from langchain_community.llms import AlephAlpha
```

## Text Embedding Models[​](#text-embedding-models "Direct link to Text Embedding Models")

See a [usage example](https://python.langchain.com/docs/integrations/text_embedding/aleph_alpha/).

```
from langchain_community.embeddings import AlephAlphaSymmetricSemanticEmbedding, AlephAlphaAsymmetricSemanticEmbedding
```

* * *

#### Help us out by providing feedback on this documentation page:
## Annoy

> [Annoy](https://github.com/spotify/annoy) (`Approximate Nearest Neighbors Oh Yeah`) is a C++ library with Python bindings to search for points in space that are close to a given query point. It also creates large read-only file-based data structures that are mapped into memory so that many processes may share the same data.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

## Vectorstore[​](#vectorstore "Direct link to Vectorstore")

See a [usage example](https://python.langchain.com/docs/integrations/vectorstores/annoy/).

```
from langchain_community.vectorstores import Annoy
```

* * *

#### Help us out by providing feedback on this documentation page:
## Apache Doris

> [Apache Doris](https://doris.apache.org/) is a modern data warehouse for real-time analytics. It delivers lightning-fast analytics on real-time data at scale.

> Usually `Apache Doris` is categorized into OLAP, and it has showed excellent performance in [ClickBench — a Benchmark For Analytical DBMS](https://benchmark.clickhouse.com/). Since it has a super-fast vectorized execution engine, it could also be used as a fast vectordb.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

## Vector Store[​](#vector-store "Direct link to Vector Store")

See a [usage example](https://python.langchain.com/docs/integrations/vectorstores/apache_doris/).

```
from langchain_community.vectorstores import ApacheDoris
```

* * *

#### Help us out by providing feedback on this documentation page:
This integration enables you run Actors on the `Apify` platform and load their results into LangChain to feed your vector indexes with documents and data from the web, e.g. to generate answers from websites with documentation, blogs, or knowledge bases.

You can use the `ApifyWrapper` to run Actors on the Apify platform.

```
from langchain_community.utilities import ApifyWrapper
```

You can also use our `ApifyDatasetLoader` to get data from Apify dataset.
## Confident AI

> [Confident AI](https://confident-ai.com/) is a creator of the `DeepEval`.
> 
> [DeepEval](https://github.com/confident-ai/deepeval) is a package for unit testing LLMs. Using `DeepEval`, everyone can build robust language models through faster iterations using both unit testing and integration testing. \`DeepEval provides support for each step in the iteration from synthetic data creation to testing.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

You need to get the [DeepEval API credentials](https://app.confident-ai.com/).

You need to install the `DeepEval` Python package:

## Callbacks[​](#callbacks "Direct link to Callbacks")

See an [example](https://python.langchain.com/docs/integrations/callbacks/confident/).

```
from langchain.callbacks.confident_callback import DeepEvalCallbackHandler
```

* * *

#### Help us out by providing feedback on this documentation page:
## Context

> [Context](https://context.ai/) provides user analytics for LLM-powered products and features.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

We need to install the `context-python` Python package:

```
pip install context-python
```

## Callbacks[​](#callbacks "Direct link to Callbacks")

See a [usage example](https://python.langchain.com/docs/integrations/callbacks/context/).

```
from langchain.callbacks import ContextCallbackHandler
```

* * *

#### Help us out by providing feedback on this documentation page:
## Confluence

> [Confluence](https://www.atlassian.com/software/confluence) is a wiki collaboration platform that saves and organizes all of the project-related material. `Confluence` is a knowledge base that primarily handles content management activities.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

```
pip install atlassian-python-api
```

We need to set up `username/api_key` or `Oauth2 login`. See [instructions](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/).

## Document Loader[​](#document-loader "Direct link to Document Loader")

See a [usage example](https://python.langchain.com/docs/integrations/document_loaders/confluence/).

```
from langchain_community.document_loaders import ConfluenceLoader
```

* * *

#### Help us out by providing feedback on this documentation page:
## C Transformers

This page covers how to use the [C Transformers](https://github.com/marella/ctransformers) library within LangChain. It is broken into two parts: installation and setup, and then references to specific C Transformers wrappers.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

*   Install the Python package with `pip install ctransformers`
*   Download a supported [GGML model](https://huggingface.co/TheBloke) (see [Supported Models](https://github.com/marella/ctransformers#supported-models))

## Wrappers[​](#wrappers "Direct link to Wrappers")

### LLM[​](#llm "Direct link to LLM")

There exists a CTransformers LLM wrapper, which you can access with:

```
from langchain_community.llms import CTransformers
```

It provides a unified interface for all models:

```
llm = CTransformers(model='/path/to/ggml-gpt-2.bin', model_type='gpt2')print(llm('AI is going to'))
```

If you are getting `illegal instruction` error, try using `lib='avx'` or `lib='basic'`:

```
llm = CTransformers(model='/path/to/ggml-gpt-2.bin', model_type='gpt2', lib='avx')
```

It can be used with models hosted on the Hugging Face Hub:

```
llm = CTransformers(model='marella/gpt-2-ggml')
```

If a model repo has multiple model files (`.bin` files), specify a model file using:

```
llm = CTransformers(model='marella/gpt-2-ggml', model_file='ggml-model.bin')
```

Additional parameters can be passed using the `config` parameter:

```
config = {'max_new_tokens': 256, 'repetition_penalty': 1.1}llm = CTransformers(model='marella/gpt-2-ggml', config=config)
```

See [Documentation](https://github.com/marella/ctransformers#config) for a list of available parameters.

For a more detailed walkthrough of this, see [this notebook](https://python.langchain.com/docs/integrations/llms/ctransformers/).
[CTranslate2](https://opennmt.net/CTranslate2/quickstart.html) is a C++ and Python library for efficient inference with Transformer models.

The project implements a custom runtime that applies many performance optimization techniques such as weights quantization, layers fusion, batch reordering, etc., to accelerate and reduce the memory usage of Transformer models on CPU and GPU.

A full list of features and supported models is included in the [project’s repository](https://opennmt.net/CTranslate2/guides/transformers.html). To start, please check out the official [quickstart guide](https://opennmt.net/CTranslate2/quickstart.html).

```
from langchain_community.llms import CTranslate2
```
This document demonstrates to leverage DashVector within the LangChain ecosystem. In particular, it shows how to install DashVector, and how to use it as a VectorStore plugin in LangChain. It is broken into two parts: installation and setup, and then references to specific DashVector wrappers.

A DashVector Collection is wrapped as a familiar VectorStore for native usage within LangChain, which allows it to be readily used for various scenarios, such as semantic search or example selection.

```
from langchain_community.vectorstores import DashVector
```

For a detailed walkthrough of the DashVector wrapper, please refer to [this notebook](https://python.langchain.com/docs/integrations/vectorstores/dashvector/)
## DataForSEO

> [DataForSeo](https://dataforseo.com/) provides comprehensive SEO and digital marketing data solutions via API.

This page provides instructions on how to use the DataForSEO search APIs within LangChain.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

Get a [DataForSEO API Access login and password](https://app.dataforseo.com/register), and set them as environment variables (`DATAFORSEO_LOGIN` and `DATAFORSEO_PASSWORD` respectively).

```
import osos.environ["DATAFORSEO_LOGIN"] = "your_login"os.environ["DATAFORSEO_PASSWORD"] = "your_password"
```

## Utility[​](#utility "Direct link to Utility")

The DataForSEO utility wraps the API. To import this utility, use:

```
from langchain_community.utilities.dataforseo_api_search import DataForSeoAPIWrapper
```

For a detailed walkthrough of this wrapper, see [this notebook](https://python.langchain.com/docs/integrations/tools/dataforseo/).

You can also load this wrapper as a Tool to use with an Agent:

```
from langchain.agents import load_toolstools = load_tools(["dataforseo-api-search"])
```

## Example usage[​](#example-usage "Direct link to Example usage")

```
dataforseo = DataForSeoAPIWrapper(api_login="your_login", api_password="your_password")result = dataforseo.run("Bill Gates")print(result)
```
[ArangoDB](https://github.com/arangodb/arangodb) is a scalable graph database system to drive value from connected data, faster. Native graphs, an integrated search engine, and JSON support, via a single query language. ArangoDB runs on-prem, in the cloud – anywhere.

Connect your `ArangoDB` Database with a chat model to get insights on your data.

```
from arango import ArangoClientfrom langchain_community.graphs import ArangoGraphfrom langchain.chains import ArangoGraphQAChain
```
## Argilla

> [Argilla](https://argilla.io/) is an open-source data curation platform for LLMs. Using `Argilla`, everyone can build robust language models through faster data curation using both human and machine feedback. `Argilla` provides support for each step in the MLOps cycle, from data labeling to model monitoring.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

Get your [API key](https://platform.openai.com/account/api-keys).

Install the Python package:

## Callbacks[​](#callbacks "Direct link to Callbacks")

```
from langchain.callbacks import ArgillaCallbackHandler
```

See an [example](https://python.langchain.com/docs/integrations/callbacks/argilla/).
[Arcee](https://www.arcee.ai/about/about-us) enables the development and advancement of what we coin as SLMs—small, specialized, secure, and scalable language models. By offering a SLM Adaptation System and a seamless, secure integration, `Arcee` empowers enterprises to harness the full potential of domain-adapted language models, driving the transformative innovation in operations.

Get your `Arcee API` key.

```
from langchain_community.llms import Arcee
```
[ArcGIS](https://www.esri.com/en-us/arcgis/about-arcgis/overview) is a family of client, server and online geographic information system software developed and maintained by [Esri](https://www.esri.com/).

`ArcGISLoader` uses the `arcgis` package. `arcgis` is a Python library for the vector and raster analysis, geocoding, map making, routing and directions. It administers, organizes and manages users, groups and information items in your GIS. It enables access to ready-to-use maps and curated geographic data from `Esri` and other authoritative sources, and works with your own data as well.

We have to install the `arcgis` package.

```
from langchain_community.document_loaders import ArcGISLoader
```
[arXiv](https://arxiv.org/) is an open-access archive for 2 million scholarly articles in the fields of physics, mathematics, computer science, quantitative biology, quantitative finance, statistics, electrical engineering and systems science, and economics.

First, you need to install `arxiv` python package.

Second, you need to install `PyMuPDF` python package which transforms PDF files downloaded from the `arxiv.org` site into the text format.

```
from langchain_community.document_loaders import ArxivLoader
```
## AwaDB

> [AwaDB](https://github.com/awa-ai/awadb) is an AI Native database for the search and storage of embedding vectors used by LLM Applications.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

## Vector store[​](#vector-store "Direct link to Vector store")

```
from langchain_community.vectorstores import AwaDB
```

See a [usage example](https://python.langchain.com/docs/integrations/vectorstores/awadb/).

## Embedding models[​](#embedding-models "Direct link to Embedding models")

```
from langchain_community.embeddings import AwaEmbeddings
```

See a [usage example](https://python.langchain.com/docs/integrations/text_embedding/awadb/).

* * *

#### Help us out by providing feedback on this documentation page:
## Atlas

> [Nomic Atlas](https://docs.nomic.ai/index.html) is a platform for interacting with both small and internet scale unstructured datasets.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

*   Install the Python package with `pip install nomic`
*   `Nomic` is also included in langchains poetry extras `poetry install -E all`

## VectorStore[​](#vectorstore "Direct link to VectorStore")

See a [usage example](https://python.langchain.com/docs/integrations/vectorstores/atlas/).

```
from langchain_community.vectorstores import AtlasDB
```

* * *

#### Help us out by providing feedback on this documentation page:
[AssemblyAI](https://www.assemblyai.com/) builds `Speech AI` models for tasks like speech-to-text, speaker diarization, speech summarization, and more. `AssemblyAI’s` Speech AI models include accurate speech-to-text for voice data (such as calls, virtual meetings, and podcasts), speaker detection, sentiment analysis, chapter detection, PII redaction.

Install the `assemblyai` package.

```
pip install -U assemblyai
```

The `AssemblyAIAudioTranscriptLoader` transcribes audio files with the `AssemblyAI API` and loads the transcribed text into documents.
## Baidu

> [Baidu Cloud](https://cloud.baidu.com/) is a cloud service provided by `Baidu, Inc.`, headquartered in Beijing. It offers a cloud storage service, client software, file management, resource sharing, and Third Party Integration.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

Register and get the `Qianfan` `AK` and `SK` keys [here](https://cloud.baidu.com/product/wenxinworkshop).

## LLMs[​](#llms "Direct link to LLMs")

### Baidu Qianfan[​](#baidu-qianfan "Direct link to Baidu Qianfan")

See a [usage example](https://python.langchain.com/docs/integrations/llms/baidu_qianfan_endpoint/).

```
from langchain_community.llms import QianfanLLMEndpoint
```

## Chat models[​](#chat-models "Direct link to Chat models")

### Qianfan Chat Endpoint[​](#qianfan-chat-endpoint "Direct link to Qianfan Chat Endpoint")

See a [usage example](https://python.langchain.com/docs/integrations/chat/baidu_qianfan_endpoint/).

```
from langchain_community.chat_models import QianfanChatEndpoint
```

## Embedding models[​](#embedding-models "Direct link to Embedding models")

### Baidu Qianfan[​](#baidu-qianfan-1 "Direct link to Baidu Qianfan")

See a [usage example](https://python.langchain.com/docs/integrations/text_embedding/baidu_qianfan_endpoint/).

```
from langchain_community.embeddings import QianfanEmbeddingsEndpoint
```

## Vector stores[​](#vector-stores "Direct link to Vector stores")

### Baidu Cloud ElasticSearch VectorSearch[​](#baidu-cloud-elasticsearch-vectorsearch "Direct link to Baidu Cloud ElasticSearch VectorSearch")

See a [usage example](https://python.langchain.com/docs/integrations/vectorstores/baiducloud_vector_search/).

```
from langchain_community.vectorstores import BESVectorStore
```

* * *

#### Help us out by providing feedback on this documentation page:
You'll need to set up a Github repo for your Banana app. You can get started in 5 minutes using [this guide](https://docs.banana.dev/banana-docs/).

Alternatively, for a ready-to-go LLM example, you can check out Banana's [CodeLlama-7B-Instruct-GPTQ](https://github.com/bananaml/demo-codellama-7b-instruct-gptq) GitHub repository. Just fork it and deploy it within Banana.

To use Banana apps within Langchain, you must include the `outputs` key in the returned json, and the value must be a string.

```
@app.handler("/")def handler(context: dict, request: Request) -> Response:    """Handle a request to generate code from a prompt."""    model = context.get("model")    tokenizer = context.get("tokenizer")    max_new_tokens = request.json.get("max_new_tokens", 512)    temperature = request.json.get("temperature", 0.7)    prompt = request.json.get("prompt")    prompt_template=f'''
 Write code to solve the following coding problem that obeys the constraints and passes the example test cases. Please wrap your code answer using ```:    {prompt}    
    '''    input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()    output = model.generate(inputs=input_ids, temperature=temperature, max_new_tokens=max_new_tokens)    result = tokenizer.decode(output[0])    return Response(json={"outputs": result}, status=200)
```
## Baichuan

> [Baichuan Inc.](https://www.baichuan-ai.com/) is a Chinese startup in the era of AGI, dedicated to addressing fundamental human needs: Efficiency, Health, and Happiness.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

Register and get an API key [here](https://platform.baichuan-ai.com/).

## LLMs[​](#llms "Direct link to LLMs")

See a [usage example](https://python.langchain.com/docs/integrations/llms/baichuan/).

```
from langchain_community.llms import BaichuanLLM
```

## Chat models[​](#chat-models "Direct link to Chat models")

See a [usage example](https://python.langchain.com/docs/integrations/chat/baichuan/).

```
from langchain_community.chat_models import ChatBaichuan
```

## Embedding models[​](#embedding-models "Direct link to Embedding models")

See a [usage example](https://python.langchain.com/docs/integrations/text_embedding/baichuan/).

```
from langchain_community.embeddings import BaichuanTextEmbeddings
```

* * *

#### Help us out by providing feedback on this documentation page:
## BiliBili

> [Bilibili](https://www.bilibili.tv/) is one of the most beloved long-form video sites in China.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

```
pip install bilibili-api-python
```

## Document Loader[​](#document-loader "Direct link to Document Loader")

See a [usage example](https://python.langchain.com/docs/integrations/document_loaders/bilibili/).

```
from langchain_community.document_loaders import BiliBiliLoader
```

* * *

#### Help us out by providing feedback on this documentation page:
## BibTeX

> [BibTeX](https://www.ctan.org/pkg/bibtex) is a file format and reference management system commonly used in conjunction with `LaTeX` typesetting. It serves as a way to organize and store bibliographic information for academic and research documents.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

We have to install the `bibtexparser` and `pymupdf` packages.

```
pip install bibtexparser pymupdf
```

## Document loader[​](#document-loader "Direct link to Document loader")

See a [usage example](https://python.langchain.com/docs/integrations/document_loaders/bibtex/).

```
from langchain_community.document_loaders import BibtexLoader
```

* * *

#### Help us out by providing feedback on this documentation page:
## Beam

> [Beam](https://www.beam.cloud/) is a cloud computing platform that allows you to run your code on remote servers with GPUs.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

*   [Create an account](https://www.beam.cloud/)
*   Install the Beam CLI with `curl https://raw.githubusercontent.com/slai-labs/get-beam/main/get-beam.sh -sSfL | sh`
*   Register API keys with `beam configure`
*   Set environment variables (`BEAM_CLIENT_ID`) and (`BEAM_CLIENT_SECRET`)
*   Install the Beam SDK:

## LLMs[​](#llms "Direct link to LLMs")

See a [usage example](https://python.langchain.com/docs/integrations/llms/beam/).

See another example in the [Beam documentation](https://docs.beam.cloud/examples/langchain).

```
from langchain_community.llms.beam import Beam
```

* * *

#### Help us out by providing feedback on this documentation page:
[Blackboard Learn](https://en.wikipedia.org/wiki/Blackboard_Learn) (previously the `Blackboard Learning Management System`) is a web-based virtual learning environment and learning management system developed by Blackboard Inc. The software features course management, customizable open architecture, and scalable design that allows integration with student information systems and authentication protocols. It may be installed on local servers, hosted by `Blackboard ASP Solutions`, or provided as Software as a Service hosted on Amazon Web Services. Its main purposes are stated to include the addition of online elements to courses traditionally delivered face-to-face and development of completely online courses with few or no face-to-face meetings.

There isn't any special setup for it.

```
from langchain_community.document_loaders import BlackboardLoader
```
## Bittensor

> [Neural Internet Bittensor](https://neuralinternet.ai/) network, an open source protocol that powers a decentralized, blockchain-based, machine learning network.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

Get your API\_KEY from [Neural Internet](https://neuralinternet.ai/).

## LLMs[​](#llms "Direct link to LLMs")

See a [usage example](https://python.langchain.com/docs/integrations/llms/bittensor/).

```
from langchain_community.llms import NIBittensorLLM
```

* * *

#### Help us out by providing feedback on this documentation page:
[Breebs](https://www.breebs.com/) is an open collaborative knowledge platform. Anybody can create a `Breeb`, a knowledge capsule based on PDFs stored on a Google Drive folder. A `Breeb` can be used by any LLM/chatbot to improve its expertise, reduce hallucinations and give access to sources. Behind the scenes, `Breebs` implements several `Retrieval Augmented Generation (RAG)` models to seamlessly provide useful context at each iteration.

```
from langchain.retrievers import BreebsRetriever
```
## Browserless

> [Browserless](https://www.browserless.io/docs/start) is a service that allows you to run headless Chrome instances in the cloud. It’s a great way to run browser-based automation at scale without having to worry about managing your own infrastructure.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

We have to get the API key [here](https://www.browserless.io/pricing/).

## Document loader[​](#document-loader "Direct link to Document loader")

See a [usage example](https://python.langchain.com/docs/integrations/document_loaders/browserless/).

```
from langchain_community.document_loaders import BrowserlessLoader
```

* * *

#### Help us out by providing feedback on this documentation page:
## Geopandas

> [GeoPandas](https://geopandas.org/) is an open source project to make working with geospatial data in python easier. `GeoPandas` extends the datatypes used by `pandas` to allow spatial operations on geometric types. Geometric operations are performed by `shapely`.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

We have to install several python packages.

```
pip install -U sodapy pandas geopandas
```

## Document Loader[​](#document-loader "Direct link to Document Loader")

See a [usage example](https://python.langchain.com/docs/integrations/document_loaders/geopandas/).

```
from langchain_community.document_loaders import OpenCityDataLoader
```

* * *

#### Help us out by providing feedback on this documentation page:
## Brave Search

> [Brave Search](https://en.wikipedia.org/wiki/Brave_Search) is a search engine developed by Brave Software.
> 
> *   `Brave Search` uses its own web index. As of May 2022, it covered over 10 billion pages and was used to serve 92% of search results without relying on any third-parties, with the remainder being retrieved server-side from the Bing API or (on an opt-in basis) client-side from Google. According to Brave, the index was kept "intentionally smaller than that of Google or Bing" in order to help avoid spam and other low-quality content, with the disadvantage that "Brave Search is not yet as good as Google in recovering long-tail queries."
> *   `Brave Search Premium`: As of April 2023 Brave Search is an ad-free website, but it will eventually switch to a new model that will include ads and premium users will get an ad-free experience. User data including IP addresses won't be collected from its users by default. A premium account will be required for opt-in data-collection.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

To get access to the Brave Search API, you need to [create an account and get an API key](https://api.search.brave.com/app/dashboard).

## Document Loader[​](#document-loader "Direct link to Document Loader")

See a [usage example](https://python.langchain.com/docs/integrations/document_loaders/brave_search/).

```
from langchain_community.document_loaders import BraveSearchLoader
```

## Tool[​](#tool "Direct link to Tool")

See a [usage example](https://python.langchain.com/docs/integrations/tools/brave_search/).

```
from langchain.tools import BraveSearch
```

* * *

#### Help us out by providing feedback on this documentation page:
## GitBook

> [GitBook](https://docs.gitbook.com/) is a modern documentation platform where teams can document everything from products to internal knowledge bases and APIs.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

There isn't any special setup for it.

## Document Loader[​](#document-loader "Direct link to Document Loader")

See a [usage example](https://python.langchain.com/docs/integrations/document_loaders/gitbook/).

```
from langchain_community.document_loaders import GitbookLoader
```
[GitHub](https://github.com/) is a developer platform that allows developers to create, store, manage and share their code. It uses `Git` software, providing the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous integration, and wikis for every project.

There are two document loaders available for GitHub.

```
from langchain_community.document_loaders import GitHubIssuesLoaderfrom langchain.document_loaders import GithubFileLoader
```
This page covers how to use the [Serper](https://serper.dev/) Google Search API within LangChain. Serper is a low-cost Google Search API that can be used to add answer box, knowledge graph, and organic results data from Google Search. It is broken into two parts: setup, and then references to the specific Google Serper wrapper.

## Setup[​](#setup "Direct link to Setup")

*   Go to [serper.dev](https://serper.dev/) to sign up for a free account
*   Get the api key and set it as an environment variable (`SERPER_API_KEY`)

## Wrappers[​](#wrappers "Direct link to Wrappers")

### Utility[​](#utility "Direct link to Utility")

There exists a GoogleSerperAPIWrapper utility which wraps this API. To import this utility:

```
from langchain_community.utilities import GoogleSerperAPIWrapper
```

You can use it as part of a Self Ask chain:

```
from langchain_community.utilities import GoogleSerperAPIWrapperfrom langchain_openai import OpenAIfrom langchain.agents import initialize_agent, Toolfrom langchain.agents import AgentTypeimport osos.environ["SERPER_API_KEY"] = ""os.environ['OPENAI_API_KEY'] = ""llm = OpenAI(temperature=0)search = GoogleSerperAPIWrapper()tools = [    Tool(        name="Intermediate Answer",        func=search.run,        description="useful for when you need to ask with search"    )]self_ask_with_search = initialize_agent(tools, llm, agent=AgentType.SELF_ASK_WITH_SEARCH, verbose=True)self_ask_with_search.run("What is the hometown of the reigning men's U.S. Open champion?")
```

#### Output[​](#output "Direct link to Output")

```
Entering new AgentExecutor chain... Yes.Follow up: Who is the reigning men's U.S. Open champion?Intermediate answer: Current champions Carlos Alcaraz, 2022 men's singles champion.Follow up: Where is Carlos Alcaraz from?Intermediate answer: El Palmar, SpainSo the final answer is: El Palmar, Spain> Finished chain.'El Palmar, Spain'
```

For a more detailed walkthrough of this wrapper, see [this notebook](https://python.langchain.com/docs/integrations/tools/google_serper/).

### Tool[​](#tool "Direct link to Tool")

You can also easily load this wrapper as a Tool (to use with an Agent). You can do this with:

```
from langchain.agents import load_toolstools = load_tools(["google-serper"])
```

For more information on tools, see [this page](https://python.langchain.com/docs/modules/tools/).
[Golden](https://golden.com/) provides a set of natural language APIs for querying and enrichment using the Golden Knowledge Graph e.g. queries such as: `Products from OpenAI`, `Generative ai companies with series a funding`, and `rappers who invest` can be used to retrieve structured data about relevant entities.

The `golden-query` langchain tool is a wrapper on top of the [Golden Query API](https://docs.golden.com/reference/query-api) which enables programmatic access to these results. See the [Golden Query API docs](https://docs.golden.com/reference/query-api) for more information.

There exists a GoldenQueryAPIWrapper utility which wraps this API. To import this utility:

```
from langchain_community.utilities.golden_query import GoldenQueryAPIWrapper
```

You can also easily load this wrapper as a Tool (to use with an Agent). You can do this with:
## GPT4All

This page covers how to use the `GPT4All` wrapper within LangChain. The tutorial is divided into two parts: installation and setup, followed by usage with an example.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

*   Install the Python package with `pip install gpt4all`
*   Download a [GPT4All model](https://gpt4all.io/index.html) and place it in your desired directory

In this example, We are using `mistral-7b-openorca.Q4_0.gguf`(Best overall fast chat model):

```
mkdir modelswget https://gpt4all.io/models/gguf/mistral-7b-openorca.Q4_0.gguf -O models/mistral-7b-openorca.Q4_0.gguf
```

## Usage[​](#usage "Direct link to Usage")

### GPT4All[​](#gpt4all-1 "Direct link to GPT4All")

To use the GPT4All wrapper, you need to provide the path to the pre-trained model file and the model's configuration.

```
from langchain_community.llms import GPT4All# Instantiate the model. Callbacks support token-wise streamingmodel = GPT4All(model="./models/mistral-7b-openorca.Q4_0.gguf", n_threads=8)# Generate textresponse = model("Once upon a time, ")
```

You can also customize the generation parameters, such as n\_predict, temp, top\_p, top\_k, and others.

To stream the model's predictions, add in a CallbackManager.

```
from langchain_community.llms import GPT4Allfrom langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler# There are many CallbackHandlers supported, such as# from langchain.callbacks.streamlit import StreamlitCallbackHandlercallbacks = [StreamingStdOutCallbackHandler()]model = GPT4All(model="./models/mistral-7b-openorca.Q4_0.gguf", n_threads=8)# Generate text. Tokens are streamed through the callback manager.model("Once upon a time, ", callbacks=callbacks)
```

## Model File[​](#model-file "Direct link to Model File")

You can find links to model file downloads in the [https://gpt4all.io/](https://gpt4all.io/index.html).

For a more detailed walkthrough of this, see [this notebook](https://python.langchain.com/docs/integrations/llms/gpt4all/)

* * *

#### Help us out by providing feedback on this documentation page:
## Graphsignal

This page covers how to use [Graphsignal](https://app.graphsignal.com/) to trace and monitor LangChain. Graphsignal enables full visibility into your application. It provides latency breakdowns by chains and tools, exceptions with full context, data monitoring, compute/GPU utilization, OpenAI cost analytics, and more.

## Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup")

*   Install the Python library with `pip install graphsignal`
*   Create free Graphsignal account [here](https://graphsignal.com/)
*   Get an API key and set it as an environment variable (`GRAPHSIGNAL_API_KEY`)

## Tracing and Monitoring[​](#tracing-and-monitoring "Direct link to Tracing and Monitoring")

Graphsignal automatically instruments and starts tracing and monitoring chains. Traces and metrics are then available in your [Graphsignal dashboards](https://app.graphsignal.com/).

Initialize the tracer by providing a deployment name:

```
import graphsignalgraphsignal.configure(deployment='my-langchain-app-prod')
```

To additionally trace any function or code, you can use a decorator or a context manager:

```
@graphsignal.trace_functiondef handle_request():        chain.run("some initial text")
```

```
with graphsignal.start_trace('my-chain'):    chain.run("some initial text")
```

Optionally, enable profiling to record function-level statistics for each trace.

```
with graphsignal.start_trace(        'my-chain', options=graphsignal.TraceOptions(enable_profiling=True)):    chain.run("some initial text")
```

See the [Quick Start](https://graphsignal.com/docs/guides/quick-start/) guide for complete setup instructions.