Qa Langchain Gemini Elasticsearch
openai-chatgptlangchain-pythonchatgptgenaielasticsearchelasticopenaiAIintegrationschatlogvectordatabasenotebooksPythonsearchgenaistackvectorelasticsearch-labsgeminilangchainapplications
Export
Question Answering using Gemini, Langchain & Elasticsearch
This tutorial demonstrates how to use the Gemini API to create embeddings and store them in Elasticsearch. We will learn how to connect Gemini to private data stored in Elasticsearch and build question/answer capabilities over it using LangChian.
setup
-
Elastic Credentials - Create an Elastic Cloud deployment to get all Elastic credentials (
ELASTIC_CLOUD_ID,ELASTIC_API_KEY). -
GOOGLE_API_KEY- To use the Gemini API, you need to create an API key in Google AI Studio.
Install packages
[ ]
Import packages and credentials
[ ]
Get Credentials
[ ]
Add documents
Let's download the sample dataset and deserialize the document.
[ ]
Split Documents into Passages
[ ]
Index Documents into Elasticsearch using Gemini Embeddings
[ ]
Create a retriever using Elasticsearch
[ ]
Format Docs
[ ]
Create a Chain using Prompt Template + gemini-pro model
[ ]