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