Skip to content

RubensZimbres/Gemini-RAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ Gemini-LangChain-RAG Powered Chatbot in Dialogflow 🦜

This project is part of the GDE's Gemini Sprint. The idea was to develop a chatbot that uses Gemini-1.0-Pro to answer questions, and has memory of past interactions by using LangChain. Also, it has its context enriched by RAG (Retrieval Augmented Generation). This memory obtained through LangChain allows the chatbot to remember past interactions independently of Dialogflow $session.params. RAG document is vectorized with gecko-embeddings, chunked and a FAISS index is created. Later, a TOP-K result of embeddings similarity is retrieved to answer the questions, along with the chat history. The application is served via Flask and deployed in Cloud Run. It can also be deployed in GKE (Google Kubernetes Engine). The Flask application is stateful for demonstration purposes. However, user session must be saved in a database.

✒️ Papers:

✏️ Articles:

Project Architecture

In this repo, you have the steps to create a RAG (Retrieval Augmented Generation) application with Gemini and Langchain, build the image and deploy it in Cloud Run, add the Flask interface, and then deploy a Dialogflow chatbot to a website.

🔎 Steps:

  • Test locally
  • Make deployment in Cloud Run
  • Generate the flow and pages in Dialogflow + test webhook
  • Add HTML code to website + create event called 'sayhi' in Default Welcome Page in Dialogflow so that the bot starts a conversation

🛡️ Deployment in Cloud Run:

gcloud builds submit --tag gcr.io/your-project/container-name . --timeout=85000
gcloud run deploy container-name --image gcr.io/your-project/container-name --min-instances 1 --max-instances 5 --cpu 1 --allow-unauthenticated --memory 512Mi --region us-east1 --concurrency 10

Final Project Screenshot:

✨ Google ML Developer Programs team supported this work by providing Google Cloud Credits

About

Chatbot that uses Gemini-1.0-Pro to answer questions, with memory by using LangChain. Also, it's enriched by RAG and deployed in Dialogflow

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published