LangChain is a popular framework for working with AI, Vectors, and embeddings. Used to simplify building a variety of AI applications.
Elasticsearch can be used with LangChain in three ways:
- Use the LangChain ElasticsearchStore to store and retrieve documents from Elasticsearch.
- Use the LangChain self-query retriever, with the help of an LLM like OpenAI, to transform a user's query into a query + filter to retrieve relevant documents from Elasticsearch.
- Use the LangChain ElasticsearchRetriever for the most flexible way to retrieve documents from Elasticsearch.
Blogs to get started with Elasticsearch and LangChain
Notebooks
- Question Answering with LangChain and Elasticsearch
- Chatbot with LangChain and Elasticsearch
- Self Query Retriever Example
- Self Query Retriever for Question Answering
- Self Query Retriever with BM25 Retrieval
LangServe Templates
LangChain Powered RAG Reference App
This reference app demonstrates how to use LangChain to power a RAG (Retrieval Augmented Generation) model. The app uses the ElasticsearchStore to store and retrieve documents from Elasticsearch. This is a quick way to get started with Langchain and Elasticsearch.
https://github.com/elastic/elasticsearch-labs/tree/main/example-apps/chatbot-rag-app