Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
Open on GitHub

Elasticsearch

Elasticsearch is a distributed, RESTful search and analytics engine.It provides a distributed, multi-tenant-capable full-text search engine with an HTTP web interface and schema-freeJSON documents.

Installation and Setup

Setup Elasticsearch

There are two ways to get started with Elasticsearch:

Install Elasticsearch on your local machine via Docker

Example: Run a single-node Elasticsearch instance with security disabled.This is not recommended for production use.

    docker run -p 9200:9200 -e "discovery.type=single-node" -e "xpack.security.enabled=false" -e "xpack.security.http.ssl.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:8.9.0

Deploy Elasticsearch on Elastic Cloud

Elastic Cloud is a managed Elasticsearch service. Signup for afree trial.

Install Client

pip install elasticsearch
pip install langchain-elasticsearch

Embedding models

See ausage example.

from langchain_elasticsearchimport ElasticsearchEmbeddings

Vector store

See ausage example.

from langchain_elasticsearchimport ElasticsearchStore
API Reference:ElasticsearchStore

Third-party integrations

EcloudESVectorStore

from langchain_community.vectorstores.ecloud_vector_searchimport EcloudESVectorStore
API Reference:EcloudESVectorStore

Retrievers

ElasticsearchRetriever

TheElasticsearchRetriever enables flexible access to all Elasticsearch featuresthrough the Query DSL.

See ausage example.

from langchain_elasticsearchimport ElasticsearchRetriever

BM25

See ausage example.

from langchain_community.retrieversimport ElasticSearchBM25Retriever

Memory

See ausage example.

from langchain_elasticsearchimport ElasticsearchChatMessageHistory

LLM cache

See ausage example.

from langchain_elasticsearchimport ElasticsearchCache
API Reference:ElasticsearchCache

Byte Store

See ausage example.

from langchain_elasticsearchimport ElasticsearchEmbeddingsCache

Chain

It is a chain for interacting with Elasticsearch Database.

from langchain.chains.elasticsearch_databaseimport ElasticsearchDatabaseChain

[8]ページ先頭

©2009-2025 Movatter.jp