Git Product home page Git Product logo

rubenszimbres / gemini-rag Goto Github PK

View Code? Open in Web Editor NEW
24.0 4.0 9.0 878 KB

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

License: Apache License 2.0

HTML 15.71% Python 77.95% Dockerfile 6.34%
cloud-run dialogflow gemini-pro google-cloud langchain retrieval-augmented-generation vertex-ai vertex-ai-gemini-api

gemini-rag's Introduction

โœจ 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

gemini-rag's People

Contributors

rubenszimbres avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.