langchain-elasticsearch
This package contains the LangChain integration with Elasticsearch.
Installation
pip install -U langchain-elasticsearch
Elasticsearch setup
Elastic Cloud
You need a running Elasticsearch deployment. The easiest way to start one is through Elastic Cloud.
You can sign up for a free trial.
Create a deployment
Get your Cloud ID:
In the Elastic Cloud console, click "Manage" next to your deployment
Copy the Cloud ID and paste it into the es_cloud_id parameter below
Create an API key:
In the Elastic Cloud console, click "Open" next to your deployment
In the left-hand side menu, go to "Stack Management", then to "API Keys"
Click "Create API key"
Enter a name for the API key and click "Create"
Copy the API key and paste it into the es_api_key parameter below
Alternatively, you can run Elasticsearch via Docker as described in the docs.
Usage
ElasticsearchStore
The ElasticsearchStore class exposes Elasticsearch as a vector store.
from langchain_elasticsearch impor
|