seansullivan/Langchain-Docs huggingface dataset:
## Neo4j

> What is `Neo4j`?

> *   Neo4j is an `open-source database management system` that specializes in graph database technology.
> *   Neo4j allows you to represent and store data in nodes and edges, making it ideal for handling connected data and relationships.
> *   Neo4j provides a `Cypher Query Language`, making it easy to interact with and query your graph data.
> *   With Neo4j, you can achieve high-performance `graph traversals and queries`, suitable for production-level systems.

> Get started with Neo4j by visiting [their website](https://neo4j.com/).

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

*   Install the Python SDK with `pip install neo4j`

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

The Neo4j vector index is used as a vectorstore, whether for semantic search or example selection.

```
from langchain_community.vectorstores import Neo4jVector
```

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

## GraphCypherQAChain[​](#graphcypherqachain "Direct link to GraphCypherQAChain")

There exists a wrapper around Neo4j graph database that allows you to generate Cypher statements based on the user input and use them to retrieve relevant information from the database.

```
from langchain_community.graphs import Neo4jGraphfrom langchain.chains import GraphCypherQAChain
```

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

## Constructing a knowledge graph from text[​](#constructing-a-knowledge-graph-from-text "Direct link to Constructing a knowledge graph from text")

Text data often contain rich relationships and insights that can be useful for various analytics, recommendation engines, or knowledge management applications. Diffbot's NLP API allows for the extraction of entities, relationships, and semantic meaning from unstructured text data. By coupling Diffbot's NLP API with Neo4j, a graph database, you can create powerful, dynamic graph structures based on the information extracted from text. These graph structures are fully queryable and can be integrated into various applications.

```
from langchain_community.graphs import Neo4jGraphfrom langchain_experimental.graph_transformers.diffbot import DiffbotGraphTransformer
```

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

## Memory[​](#memory "Direct link to Memory")

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

```
from langchain.memory import Neo4jChatMessageHistory
```
## NLPCloud

> [NLP Cloud](https://docs.nlpcloud.com/#introduction) is an artificial intelligence platform that allows you to use the most advanced AI engines, and even train your own engines with your own data.

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

*   Install the `nlpcloud` package.

*   Get an NLPCloud api key and set it as an environment variable (`NLPCLOUD_API_KEY`)

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

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

```
from langchain_community.llms import NLPCloud
```

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

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

```
from langchain_community.embeddings import NLPCloudEmbeddings
```

* * *

#### Help us out by providing feedback on this documentation page:
[Notion](https://www.notion.so/) is a collaboration platform with modified Markdown support that integrates kanban boards, tasks, wikis and databases. It is an all-in-one workspace for notetaking, knowledge and data management, and project and task management.

All instructions are in examples below.

We have two different loaders: `NotionDirectoryLoader` and `NotionDBLoader`.

```
from langchain_community.document_loaders import NotionDirectoryLoader
```
We need to install the `nucliadb-protos` package to use the `Nuclia Understanding API`.

To use the `Nuclia Understanding API`, we need to have a `Nuclia account`. We can create one for free at [https://nuclia.cloud](https://nuclia.cloud/), and then [create a NUA key](https://docs.nuclia.dev/docs/docs/using/understanding/intro).

To use the Nuclia document transformer, we need to instantiate a `NucliaUnderstandingAPI` tool with `enable_ml` set to `True`:

```
from langchain_community.tools.nuclia import NucliaUnderstandingAPInua = NucliaUnderstandingAPI(enable_ml=True)
```
## Oracle Cloud Infrastructure (OCI)

The `LangChain` integrations related to [Oracle Cloud Infrastructure](https://www.oracle.com/artificial-intelligence/).

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

### OCI Generative AI[​](#oci-generative-ai "Direct link to OCI Generative AI")

> Oracle Cloud Infrastructure (OCI) [Generative AI](https://docs.oracle.com/en-us/iaas/Content/generative-ai/home.htm) is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases, and which are available through a single API. Using the OCI Generative AI service you can access ready-to-use pretrained models, or create and host your own fine-tuned custom models based on your own data on dedicated AI clusters.

To use, you should have the latest `oci` python SDK installed.

See [usage examples](https://python.langchain.com/docs/integrations/llms/oci_generative_ai/).

```
from langchain_community.llms import OCIGenAI
```

### OCI Data Science Model Deployment Endpoint[​](#oci-data-science-model-deployment-endpoint "Direct link to OCI Data Science Model Deployment Endpoint")

> [OCI Data Science](https://docs.oracle.com/en-us/iaas/data-science/using/home.htm) is a fully managed and serverless platform for data science teams. Using the OCI Data Science platform you can build, train, and manage machine learning models, and then deploy them as an OCI Model Deployment Endpoint using the [OCI Data Science Model Deployment Service](https://docs.oracle.com/en-us/iaas/data-science/using/model-dep-about.htm).

If you deployed a LLM with the VLLM or TGI framework, you can use the `OCIModelDeploymentVLLM` or `OCIModelDeploymentTGI` classes to interact with it.

To use, you should have the latest `oracle-ads` python SDK installed.

```
pip install -U oracle-ads
```

See [usage examples](https://python.langchain.com/docs/integrations/llms/oci_model_deployment_endpoint/).

```
from langchain_community.llms import OCIModelDeploymentVLLMfrom langchain_community.llms import OCIModelDeploymentTGI
```

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

### OCI Generative AI[​](#oci-generative-ai-1 "Direct link to OCI Generative AI")

See [usage examples](https://python.langchain.com/docs/integrations/text_embedding/oci_generative_ai/).

```
from langchain_community.embeddings import OCIGenAIEmbeddings
```
## Ollama

> [Ollama](https://ollama.ai/) is a python library. It allows you to run open-source large language models, such as LLaMA2, locally.
> 
> `Ollama` bundles model weights, configuration, and data into a single package, defined by a Modelfile. It optimizes setup and configuration details, including GPU usage. For a complete list of supported models and model variants, see the [Ollama model library](https://ollama.ai/library).

See [this guide](https://python.langchain.com/docs/guides/development/local_llms/#quickstart) for more details on how to use `Ollama` with LangChain.

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

Follow [these instructions](https://github.com/jmorganca/ollama?tab=readme-ov-file#ollama) to set up and run a local Ollama instance. To use, you should set up the environment variables `ANYSCALE_API_BASE` and `ANYSCALE_API_KEY`.

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

```
from langchain_community.llms import Ollama
```

See the notebook example [here](https://python.langchain.com/docs/integrations/llms/ollama/).

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

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

```
from langchain_community.chat_models import ChatOllama
```

See the notebook example [here](https://python.langchain.com/docs/integrations/chat/ollama/).

### Ollama functions[​](#ollama-functions "Direct link to Ollama functions")

```
from langchain_experimental.llms.ollama_functions import OllamaFunctions
```

See the notebook example [here](https://python.langchain.com/docs/integrations/chat/ollama_functions/).

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

```
from langchain_community.embeddings import OllamaEmbeddings
```

See the notebook example [here](https://python.langchain.com/docs/integrations/text_embedding/ollama/).
This page covers how to use the OpenSearch ecosystem within LangChain. It is broken into two parts: installation and setup, and then references to specific OpenSearch wrappers.

There exists a wrapper around OpenSearch vector databases, allowing you to use it as a vectorstore for semantic search using approximate vector search powered by lucene, nmslib and faiss engines or using painless scripting and script scoring functions for bruteforce vector search.

```
from langchain_community.vectorstores import OpenSearchVectorSearch
```
## NVIDIA

> NVIDIA provides an integration package for LangChain: `langchain-nvidia-ai-endpoints`.

## NVIDIA AI Foundation Endpoints[​](#nvidia-ai-foundation-endpoints "Direct link to NVIDIA AI Foundation Endpoints")

> [NVIDIA AI Foundation Endpoints](https://www.nvidia.com/en-us/ai-data-science/foundation-models/) give users easy access to NVIDIA hosted API endpoints for NVIDIA AI Foundation Models like `Mixtral 8x7B`, `Llama 2`, `Stable Diffusion`, etc. These models, hosted on the [NVIDIA NGC catalog](https://catalog.ngc.nvidia.com/ai-foundation-models), are optimized, tested, and hosted on the NVIDIA AI platform, making them fast and easy to evaluate, further customize, and seamlessly run at peak performance on any accelerated stack.
> 
> With [NVIDIA AI Foundation Endpoints](https://www.nvidia.com/en-us/ai-data-science/foundation-models/), you can get quick results from a fully accelerated stack running on [NVIDIA DGX Cloud](https://www.nvidia.com/en-us/data-center/dgx-cloud/). Once customized, these models can be deployed anywhere with enterprise-grade security, stability, and support using [NVIDIA AI Enterprise](https://www.nvidia.com/en-us/data-center/products/ai-enterprise/).

A selection of NVIDIA AI Foundation models is supported directly in LangChain with familiar APIs.

The supported models can be found [in NGC](https://catalog.ngc.nvidia.com/ai-foundation-models).

These models can be accessed via the [`langchain-nvidia-ai-endpoints`](https://pypi.org/project/langchain-nvidia-ai-endpoints/) package, as shown below.

### Setting up[​](#setting-up "Direct link to Setting up")

*   Create a free [NVIDIA NGC](https://catalog.ngc.nvidia.com/) account.
*   Navigate to `Catalog > AI Foundation Models > (Model with API endpoint)`.
*   Select `API` and generate the key `NVIDIA_API_KEY`.

```
export NVIDIA_API_KEY=nvapi-XXXXXXXXXXXXXXXXXXXXXXXXXX
```

*   Install a package:

```
pip install -U langchain-nvidia-ai-endpoints
```

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

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

```
from langchain_nvidia_ai_endpoints import ChatNVIDIAllm = ChatNVIDIA(model="mixtral_8x7b")result = llm.invoke("Write a ballad about LangChain.")print(result.content)
```

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

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

```
from langchain_nvidia_ai_endpoints import NVIDIAEmbeddings
```
## OpenLLM

This page demonstrates how to use [OpenLLM](https://github.com/bentoml/OpenLLM) with LangChain.

`OpenLLM` is an open platform for operating large language models (LLMs) in production. It enables developers to easily run inference with any open-source LLMs, deploy to the cloud or on-premises, and build powerful AI apps.

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

Install the OpenLLM package via PyPI:

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

OpenLLM supports a wide range of open-source LLMs as well as serving users' own fine-tuned LLMs. Use `openllm model` command to see all available models that are pre-optimized for OpenLLM.

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

There is a OpenLLM Wrapper which supports loading LLM in-process or accessing a remote OpenLLM server:

```
from langchain_community.llms import OpenLLM
```

### Wrapper for OpenLLM server[​](#wrapper-for-openllm-server "Direct link to Wrapper for OpenLLM server")

This wrapper supports connecting to an OpenLLM server via HTTP or gRPC. The OpenLLM server can run either locally or on the cloud.

To try it out locally, start an OpenLLM server:

Wrapper usage:

```
from langchain_community.llms import OpenLLMllm = OpenLLM(server_url='http://localhost:3000')llm("What is the difference between a duck and a goose? And why there are so many Goose in Canada?")
```

### Wrapper for Local Inference[​](#wrapper-for-local-inference "Direct link to Wrapper for Local Inference")

You can also use the OpenLLM wrapper to load LLM in current Python process for running inference.

```
from langchain_community.llms import OpenLLMllm = OpenLLM(model_name="dolly-v2", model_id='databricks/dolly-v2-7b')llm("What is the difference between a duck and a goose? And why there are so many Goose in Canada?")
```

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

For a more detailed walkthrough of the OpenLLM Wrapper, see the [example notebook](https://python.langchain.com/docs/integrations/llms/openllm/)

* * *

#### Help us out by providing feedback on this documentation page:
This page covers how to use the Postgres [PGVector](https://github.com/pgvector/pgvector) ecosystem within LangChain It is broken into two parts: installation and setup, and then references to specific PGVector wrappers.

There exists a wrapper around Postgres vector databases, allowing you to use it as a vectorstore, whether for semantic search or example selection.

```
from langchain_community.vectorstores.pgvector import PGVector
```
## Postgres Embedding

> [pg\_embedding](https://github.com/neondatabase/pg_embedding) is an open-source package for vector similarity search using `Postgres` and the `Hierarchical Navigable Small Worlds` algorithm for approximate nearest neighbor search.

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

We need to install several python packages.

```
pip install psycopg2-binary
```

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

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

```
from langchain_community.vectorstores import PGEmbedding
```

* * *

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

> [Pinecone](https://docs.pinecone.io/docs/overview) is a vector database with broad functionality.

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

Install the Python SDK:

```
pip install langchain-pinecone
```

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

There exists a wrapper around Pinecone indexes, allowing you to use it as a vectorstore, whether for semantic search or example selection.

```
from langchain_pinecone import PineconeVectorStore
```

For a more detailed walkthrough of the Pinecone vectorstore, see [this notebook](https://python.langchain.com/docs/integrations/vectorstores/pinecone/)

## Retrievers[​](#retrievers "Direct link to Retrievers")

### Pinecone Hybrid Search[​](#pinecone-hybrid-search "Direct link to Pinecone Hybrid Search")

```
pip install pinecone-client pinecone-text
```

```
from langchain_community.retrievers import (    PineconeHybridSearchRetriever,)
```

For more detailed information, see [this notebook](https://python.langchain.com/docs/integrations/retrievers/pinecone_hybrid_search/).

### Self Query retriever[​](#self-query-retriever "Direct link to Self Query retriever")

Pinecone vector store can be used as a retriever for self-querying.

For more detailed information, see [this notebook](https://python.langchain.com/docs/integrations/retrievers/self_query/pinecone/).
This page covers how to use the [Runhouse](https://github.com/run-house/runhouse) ecosystem within LangChain. It is broken into three parts: installation and setup, LLMs, and Embeddings.

For a basic self-hosted LLM, you can use the `SelfHostedHuggingFaceLLM` class. For more custom LLMs, you can use the `SelfHostedPipeline` parent class.

```
from langchain_community.llms import SelfHostedPipeline, SelfHostedHuggingFaceLLM
```

There are several ways to use self-hosted embeddings with LangChain via Runhouse.

For a basic self-hosted embedding from a Hugging Face Transformers model, you can use the `SelfHostedEmbedding` class.
Learn how to use LangChain with models on Predibase.

Predibase integrates with LangChain by implementing LLM module. You can see a short example below or a full notebook under LLM > Integrations > Predibase.

Predibase also supports Predibase-hosted and HuggingFace-hosted adapters that are fine-tuned on the base model given by the `model` argument:

```
import osos.environ["PREDIBASE_API_TOKEN"] = "{PREDIBASE_API_TOKEN}"from langchain_community.llms import Predibase# The fine-tuned adapter is hosted at Predibase (adapter_version can be specified; omitting it is equivalent to the most recent version).model =  Predibase(model="mistral-7b"", adapter_id="e2e_nlg", adapter_version=1, predibase_api_key=os.environ.get("PREDIBASE_API_TOKEN"))response = model("Can you recommend me a nice dry wine?")print(response)
```

Predibase also supports adapters that are fine-tuned on the base model given by the `model` argument:

```
import osos.environ["PREDIBASE_API_TOKEN"] = "{PREDIBASE_API_TOKEN}"from langchain_community.llms import Predibase# The fine-tuned adapter is hosted at HuggingFace (adapter_version does not apply and will be ignored).model =  Predibase(model="mistral-7b"", adapter_id="predibase/e2e_nlg", predibase_api_key=os.environ.get("PREDIBASE_API_TOKEN"))response = model("Can you recommend me a nice dry wine?")print(response)
```
## Salute Devices

Salute Devices provides GigaChat LLM's models.

For more info how to get access to GigaChat [follow here](https://developers.sber.ru/docs/ru/gigachat/api/integration).

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

GigaChat package can be installed via pip from PyPI:

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

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

```
from langchain_community.llms import GigaChat
```

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

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

```
from langchain_community.chat_models import GigaChat
```

## Embeddings[​](#embeddings "Direct link to Embeddings")

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

```
from langchain_community.embeddings import GigaChatEmbeddings
```

* * *

#### Help us out by providing feedback on this documentation page:
This page covers how to use the [SearchApi](https://www.searchapi.io/) Google Search API within LangChain. SearchApi is a real-time SERP API for easy SERP scraping.

There is a SearchApiAPIWrapper utility which wraps this API. To import this utility:

```
from langchain_community.utilities import SearchApiAPIWrapperfrom langchain_openai import OpenAIfrom langchain.agents import initialize_agent, Toolfrom langchain.agents import AgentTypeimport osos.environ["SEARCHAPI_API_KEY"] = ""os.environ['OPENAI_API_KEY'] = ""llm = OpenAI(temperature=0)search = SearchApiAPIWrapper()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("Who lived longer: Plato, Socrates, or Aristotle?")
```

You can also easily load this wrapper as a Tool (to use with an Agent). You can do this with:
This page covers how to use the `RWKV-4` wrapper within LangChain. It is broken into two parts: installation and setup, and then usage with an example.

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

```
from langchain_community.llms import RWKV# Test the model```pythondef generate_prompt(instruction, input=None):    if input:        return f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.# Instruction:{instruction}# Input:{input}# Response:"""    else:        return f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.# Instruction:{instruction}# Response:"""model = RWKV(model="./models/RWKV-4-Raven-3B-v7-Eng-20230404-ctx4096.pth", strategy="cpu fp32", tokens_path="./rwkv/20B_tokenizer.json")response = model(generate_prompt("Once upon a time, "))
```

See the [rwkv pip](https://pypi.org/project/rwkv/) page for more information about strategies, including streaming and cuda support.
[PromptLayer](https://docs.promptlayer.com/introduction) is a platform for prompt engineering. It also helps with the LLM observability to visualize requests, version prompts, and track usage.

While `PromptLayer` does have LLMs that integrate directly with LangChain (e.g. [`PromptLayerOpenAI`](https://docs.promptlayer.com/languages/langchain)), using a callback is the recommended way to integrate `PromptLayer` with LangChain.

```
import promptlayer  # Don't forget this import!from langchain.callbacks import PromptLayerCallbackHandler
```
## Psychic

danger

This provider is no longer maintained, and may not work. Use with caution.

> [Psychic](https://www.psychic.dev/) is a platform for integrating with SaaS tools like `Notion`, `Zendesk`, `Confluence`, and `Google Drive` via OAuth and syncing documents from these applications to your SQL or vector database. You can think of it like Plaid for unstructured data.

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

Psychic is easy to set up - you import the `react` library and configure it with your `Sidekick API` key, which you get from the [Psychic dashboard](https://dashboard.psychic.dev/). When you connect the applications, you  
view these connections from the dashboard and retrieve data using the server-side libraries.

1.  Create an account in the [dashboard](https://dashboard.psychic.dev/).
2.  Use the [react library](https://docs.psychic.dev/sidekick-link) to add the Psychic link modal to your frontend react app. You will use this to connect the SaaS apps.
3.  Once you have created a connection, you can use the `PsychicLoader` by following the [example notebook](https://python.langchain.com/docs/integrations/document_loaders/psychic/)

## Advantages vs Other Document Loaders[​](#advantages-vs-other-document-loaders "Direct link to Advantages vs Other Document Loaders")

1.  **Universal API:** Instead of building OAuth flows and learning the APIs for every SaaS app, you integrate Psychic once and leverage our universal API to retrieve data.
2.  **Data Syncs:** Data in your customers' SaaS apps can get stale fast. With Psychic you can configure webhooks to keep your documents up to date on a daily or realtime basis.
3.  **Simplified OAuth:** Psychic handles OAuth end-to-end so that you don't have to spend time creating OAuth clients for each integration, keeping access tokens fresh, and handling OAuth redirect logic.

* * *

#### Help us out by providing feedback on this documentation page:
With SemaDB Cloud, our hosted version, no fuss means no pod size calculations, no schema definitions, no partition settings, no parameter tuning, no search algorithm tuning, no complex installation, no complex API. It is integrated with [RapidAPI](https://rapidapi.com/semafind-semadb/api/semadb) providing transparent billing, automatic sharding and an interactive API playground.

There is a basic wrapper around `SemaDB` collections allowing you to use it as a vectorstore.

```
from langchain_community.vectorstores import SemaDB
```
[PubMed®](https://pubmed.ncbi.nlm.nih.gov/) by `The National Center for Biotechnology Information, National Library of Medicine` comprises more than 35 million citations for biomedical literature from `MEDLINE`, life science journals, and online books. Citations may include links to full text content from `PubMed Central` and publisher web sites.

You need to install a python package.

```
from langchain.retrievers import PubMedRetriever
```
[Shale Protocol](https://shaleprotocol.com/) provides production-ready inference APIs for open LLMs. It's a Plug & Play API as it's hosted on a highly scalable GPU cloud infrastructure.

Our free tier supports up to 1K daily requests per key as we want to eliminate the barrier for anyone to start building genAI apps with LLMs.

With Shale Protocol, developers/researchers can create apps and explore the capabilities of open LLMs at no cost.

This page covers how Shale-Serve API can be incorporated with LangChain.

As of June 2023, the API supports Vicuna-13B by default. We are going to support more LLMs such as Falcon-40B in future releases.

```
from langchain_openai import OpenAIfrom langchain_core.prompts import PromptTemplatefrom langchain.chains import LLMChainimport osos.environ['OPENAI_API_BASE'] = "https://shale.live/v1"os.environ['OPENAI_API_KEY'] = "ENTER YOUR API KEY"llm = OpenAI()template = """Question: {question}# Answer: Let's think step by step."""prompt = PromptTemplate.from_template(template)llm_chain = LLMChain(prompt=prompt, llm=llm)question = "What NFL team won the Super Bowl in the year Justin Beiber was born?"llm_chain.run(question)
```
## PygmalionAI

> [PygmalionAI](https://pygmalion.chat/) is a company supporting the open-source models by serving the inference endpoint for the [Aphrodite Engine](https://github.com/PygmalionAI/aphrodite-engine).

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

```
pip install aphrodite-engine
```

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

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

```
from langchain_community.llms import Aphrodite
```

* * *

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

> [spaCy](https://spacy.io/) is an open-source software library for advanced natural language processing, written in the programming languages Python and Cython.

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

## Text Splitter[​](#text-splitter "Direct link to Text Splitter")

See a [usage example](https://python.langchain.com/docs/modules/data_connection/document_transformers/split_by_token/#spacy).

```
from langchain_text_splitters import SpacyTextSplitter
```

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

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

```
from langchain_community.embeddings.spacy_embeddings import SpacyEmbeddings
```

* * *

#### Help us out by providing feedback on this documentation page:
This page covers how to use the `Snowflake` ecosystem within `LangChain`.

Snowflake offers their open weight `arctic` line of embedding models for free on [Hugging Face](https://huggingface.co/Snowflake/snowflake-arctic-embed-l). You can use these models via the [HuggingFaceEmbeddings](https://python.langchain.com/docs/integrations/text_embedding/huggingfacehub/) connector:

```
from langchain_community.text_embeddings import HuggingFaceEmbeddingsmodel = HuggingFaceEmbeddings(model_name="snowflake/arctic-embed-l")
```
## Spreedly

> [Spreedly](https://docs.spreedly.com/) is a service that allows you to securely store credit cards and use them to transact against any number of payment gateways and third party APIs. It does this by simultaneously providing a card tokenization/vault service as well as a gateway and receiver integration service. Payment methods tokenized by Spreedly are stored at `Spreedly`, allowing you to independently store a card and then pass that card to different end points based on your business requirements.

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

See [setup instructions](https://python.langchain.com/docs/integrations/document_loaders/spreedly/).

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

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

```
from langchain_community.document_loaders import SpreedlyLoader
```

* * *

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

> [Remembrall](https://remembrall.dev/) is a platform that gives a language model long-term memory, retrieval augmented generation, and complete observability.

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

To get started, [sign in with Github on the Remembrall platform](https://remembrall.dev/login) and copy your [API key from the settings page](https://remembrall.dev/dashboard/settings).

## Memory[​](#memory "Direct link to Memory")

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

* * *

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

This page covers how to run models on Replicate within LangChain.

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

*   Create a [Replicate](https://replicate.com/) account. Get your API key and set it as an environment variable (`REPLICATE_API_TOKEN`)
*   Install the [Replicate python client](https://github.com/replicate/replicate-python) with `pip install replicate`

## Calling a model[​](#calling-a-model "Direct link to Calling a model")

Find a model on the [Replicate explore page](https://replicate.com/explore), and then paste in the model name and version in this format: `owner-name/model-name:version`

For example, for this [dolly model](https://replicate.com/replicate/dolly-v2-12b), click on the API tab. The model name/version would be: `"replicate/dolly-v2-12b:ef0e1aefc61f8e096ebe4db6b2bacc297daf2ef6899f0f7e001ec445893500e5"`

Only the `model` param is required, but any other model parameters can also be passed in with the format `input={model_param: value, ...}`

For example, if we were running stable diffusion and wanted to change the image dimensions:

```
Replicate(model="stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf", input={'image_dimensions': '512x512'})
```

_Note that only the first output of a model will be returned._ From here, we can initialize our model:

```
llm = Replicate(model="replicate/dolly-v2-12b:ef0e1aefc61f8e096ebe4db6b2bacc297daf2ef6899f0f7e001ec445893500e5")
```

And run it:

```
prompt = """Answer the following yes/no question by reasoning step by step.Can a dog drive a car?"""llm(prompt)
```

We can call any Replicate model (not just LLMs) using this syntax. For example, we can call [Stable Diffusion](https://replicate.com/stability-ai/stable-diffusion):

```
text2image = Replicate(model="stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf", input={'image_dimensions':'512x512'})image_output = text2image("A cat riding a motorcycle by Picasso")
```
[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.

We need to install the `SQLAlchemy` python package.

```
from langchain_community.vectorstores import SQLiteVSS
```
## Roam

> [ROAM](https://roamresearch.com/) is a note-taking tool for networked thought, designed to create a personal knowledge base.

## 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/roam/).

```
from langchain_community.document_loaders import RoamLoader
```
## SparkLLM

> [SparkLLM](https://xinghuo.xfyun.cn/spark) is a large-scale cognitive model independently developed by iFLYTEK. It has cross-domain knowledge and language understanding ability by learning a large amount of texts, codes and images. It can understand and perform tasks based on natural dialogue.

## SparkLLM LLM Model[​](#sparkllm-llm-model "Direct link to SparkLLM LLM Model")

An example is available at [example](https://python.langchain.com/docs/integrations/llms/sparkllm/).

## SparkLLM Chat Model[​](#sparkllm-chat-model "Direct link to SparkLLM Chat Model")

An example is available at [example](https://python.langchain.com/docs/integrations/chat/sparkllm/).

## SparkLLM Text Embedding Model[​](#sparkllm-text-embedding-model "Direct link to SparkLLM Text Embedding Model")

An example is available at [example](https://python.langchain.com/docs/integrations/text_embedding/sparkllm/)

* * *

#### Help us out by providing feedback on this documentation page:
[Stack Exchange](https://en.wikipedia.org/wiki/Stack_Exchange) is a network of question-and-answer (Q&A) websites on topics in diverse fields, each site covering a specific topic, where questions, answers, and users are subject to a reputation award process.

This page covers how to use the `Stack Exchange API` within LangChain.

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

```
from langchain_community.utilities import StackExchangeAPIWrapper
```

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

> [StarRocks](https://www.starrocks.io/) is a High-Performance Analytical Database. `StarRocks` is a next-gen sub-second MPP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics and ad-hoc query.

> Usually `StarRocks` 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/starrocks/).

```
from langchain_community.vectorstores import StarRocks
```
## Stripe

> [Stripe](https://stripe.com/en-ca) is an Irish-American financial services and software as a service (SaaS) company. It offers payment-processing software and application programming interfaces for e-commerce websites and mobile applications.

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

See [setup instructions](https://python.langchain.com/docs/integrations/document_loaders/stripe/).

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

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

```
from langchain_community.document_loaders import StripeLoader
```

* * *

#### Help us out by providing feedback on this documentation page:
[Telegram Messenger](https://web.telegram.org/a/) is a globally accessible freemium, cross-platform, encrypted, cloud-based and centralized instant messaging service. The application also provides optional end-to-end encrypted chats and video calling, VoIP, file sharing and several other features.

```
from langchain_community.document_loaders import TelegramChatFileLoaderfrom langchain_community.document_loaders import TelegramChatApiLoader
```
## Streamlit

> [Streamlit](https://streamlit.io/) is a faster way to build and share data apps. `Streamlit` turns data scripts into shareable web apps in minutes. All in pure Python. No front‑end experience required. See more examples at [streamlit.io/generative-ai](https://streamlit.io/generative-ai).

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

We need to install the `streamlit` Python package:

## Memory[​](#memory "Direct link to Memory")

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

```
from langchain_community.chat_message_histories import StreamlitChatMessageHistory
```

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

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

```
from langchain_community.callbacks import StreamlitCallbackHandler
```

* * *

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

> [Alibaba Cloud Tair](https://www.alibabacloud.com/help/en/tair/latest/what-is-tair) is a cloud native in-memory database service developed by `Alibaba Cloud`. It provides rich data models and enterprise-grade capabilities to support your real-time online scenarios while maintaining full compatibility with open-source `Redis`. `Tair` also introduces persistent memory-optimized instances that are based on new non-volatile memory (NVM) storage medium.

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

Install Tair Python SDK:

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

```
from langchain_community.vectorstores import Tair
```

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

* * *

#### Help us out by providing feedback on this documentation page:
To utilize the `TigerGraph InquiryAI` functionality, you can import `TigerGraph` from `langchain_community.graphs`.

```
import pyTigerGraph as tgconn = tg.TigerGraphConnection(host="DATABASE_HOST_HERE", graphname="GRAPH_NAME_HERE", username="USERNAME_HERE", password="PASSWORD_HERE")### ==== CONFIGURE INQUIRYAI HOST ====conn.ai.configureInquiryAIHost("INQUIRYAI_HOST_HERE")from langchain_community.graphs import TigerGraphgraph = TigerGraph(conn)result = graph.query("How many servers are there?")print(result)
```
[TiDB Cloud](https://tidbcloud.com/), is a comprehensive Database-as-a-Service (DBaaS) solution, that provides dedicated and serverless options. `TiDB Serverless` is now integrating a built-in vector search into the MySQL landscape. With this enhancement, you can seamlessly develop AI applications using `TiDB Serverless` without the need for a new database or additional technical stacks. Be among the first to experience it by joining the [waitlist for the private beta](https://tidb.cloud/ai).

You have to get the connection details for the TiDB database. Visit the [TiDB Cloud](https://tidbcloud.com/) to get the connection details.

```
## Document loader```pythonfrom langchain_community.document_loaders import TiDBLoader
```
## 2Markdown

> [2markdown](https://2markdown.com/) service transforms website content into structured markdown files.

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

We need the `API key`. See [instructions how to get it](https://2markdown.com/login).

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

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

```
from langchain_community.document_loaders import ToMarkdownLoader
```

* * *

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

> [Trello](https://www.atlassian.com/software/trello) is a web-based project management and collaboration tool that allows individuals and teams to organize and track their tasks and projects. It provides a visual interface known as a "board" where users can create lists and cards to represent their tasks and activities. The TrelloLoader allows us to load cards from a `Trello` board.

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

```
pip install py-trello beautifulsoup4
```

See [setup instructions](https://python.langchain.com/docs/integrations/document_loaders/trello/).

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

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

```
from langchain_community.document_loaders import TrelloLoader
```

* * *

#### Help us out by providing feedback on this documentation page:
[Together AI](https://together.ai/) is a cloud platform for building and running generative AI.

It makes it easy to fine-tune or run leading open-source models with a couple lines of code. We have integrated the world’s leading open-source models, including `Llama-2`, `RedPajama`, `Falcon`, `Alpaca`, `Stable Diffusion XL`, and more. Read mo

API key can be passed in as init param `together_api_key` or set as environment variable `TOGETHER_API_KEY`.

```
%pip install --upgrade --quiet langchain-together
```
## TruLens

> [TruLens](https://trulens.org/) is an [open-source](https://github.com/truera/trulens) package that provides instrumentation and evaluation tools for large language model (LLM) based applications.

This page covers how to use [TruLens](https://trulens.org/) to evaluate and track LLM apps built on langchain.

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

Install the `trulens-eval` python package.

## Quickstart[​](#quickstart "Direct link to Quickstart")

See the integration details in the [TruLens documentation](https://www.trulens.org/trulens_eval/getting_started/quickstarts/langchain_quickstart/).

### Tracking[​](#tracking "Direct link to Tracking")

Once you've created your LLM chain, you can use TruLens for evaluation and tracking. TruLens has a number of [out-of-the-box Feedback Functions](https://www.trulens.org/trulens_eval/evaluation/feedback_functions/), and is also an extensible framework for LLM evaluation.

Create the feedback functions:

```
from trulens_eval.feedback import Feedback, Huggingface, # Initialize HuggingFace-based feedback function collection class:hugs = Huggingface()openai = OpenAI()# Define a language match feedback function using HuggingFace.lang_match = Feedback(hugs.language_match).on_input_output()# By default this will check language match on the main app input and main app# output.# Question/answer relevance between overall question and answer.qa_relevance = Feedback(openai.relevance).on_input_output()# By default this will evaluate feedback on main app input and main app output.# Toxicity of inputtoxicity = Feedback(openai.toxicity).on_input()
```

### Chains[​](#chains "Direct link to Chains")

After you've set up Feedback Function(s) for evaluating your LLM, you can wrap your application with TruChain to get detailed tracing, logging and evaluation of your LLM app.

Note: See code for the `chain` creation is in the [TruLens documentation](https://www.trulens.org/trulens_eval/getting_started/quickstarts/langchain_quickstart/).

```
from trulens_eval import TruChain# wrap your chain with TruChaintruchain = TruChain(    chain,    app_id='Chain1_ChatApplication',    feedbacks=[lang_match, qa_relevance, toxicity])# Note: any `feedbacks` specified here will be evaluated and logged whenever the chain is used.truchain("que hora es?")
```

### Evaluation[​](#evaluation "Direct link to Evaluation")

Now you can explore your LLM-based application!

Doing so will help you understand how your LLM application is performing at a glance. As you iterate new versions of your LLM application, you can compare their performance across all of the different quality metrics you've set up. You'll also be able to view evaluations at a record level, and explore the chain metadata for each record.

```
from trulens_eval import Trutru = Tru()tru.run_dashboard() # open a Streamlit app to explore
```

For more information on TruLens, visit [trulens.org](https://www.trulens.org/)

* * *

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

> [Trubrics](https://trubrics.com/) is an LLM user analytics platform that lets you collect, analyse and manage user prompts & feedback on AI models.
> 
> Check out [Trubrics repo](https://github.com/trubrics/trubrics-sdk) for more information on `Trubrics`.

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

We need to install the `trubrics` Python package:

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

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

```
from langchain.callbacks import TrubricsCallbackHandler
```
## Typesense

> [Typesense](https://typesense.org/) is an open-source, in-memory search engine, that you can either [self-host](https://typesense.org/docs/guide/install-typesense.html#option-2-local-machine-self-hosting) or run on [Typesense Cloud](https://cloud.typesense.org/). `Typesense` focuses on performance by storing the entire index in RAM (with a backup on disk) and also focuses on providing an out-of-the-box developer experience by simplifying available options and setting good defaults.

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

```
pip install typesense openapi-schema-pydantic
```

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

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

```
from langchain_community.vectorstores import Typesense
```

* * *

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