Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rubenszimbres/gemini-rag
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
https://github.com/rubenszimbres/gemini-rag
cloud-run dialogflow gemini-pro google-cloud langchain retrieval-augmented-generation vertex-ai vertex-ai-gemini-api
Last synced: about 2 months ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/rubenszimbres/gemini-rag
- Owner: RubensZimbres
- License: apache-2.0
- Created: 2024-02-25T22:58:15.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-08T00:31:37.000Z (10 months ago)
- Last Synced: 2024-07-30T17:40:48.591Z (5 months ago)
- Topics: cloud-run, dialogflow, gemini-pro, google-cloud, langchain, retrieval-augmented-generation, vertex-ai, vertex-ai-gemini-api
- Language: Python
- Homepage:
- Size: 857 KB
- Stars: 23
- Watchers: 4
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ✨ 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:
* AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation: https://arxiv.org/abs/2308.08155
* Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks: https://arxiv.org/abs/2005.11401✏️ Articles:
* Cost-Efficient Multi-Agent Collaboration with LangGraph + Gemma for Code Generation: https://medium.com/@rubenszimbres/cost-efficient-multi-agent-collaboration-with-langgraph-gemma-for-code-generation-88d6cf87fc99
* Code Generation using Retrieval Augmented Generation + LangChain: https://medium.com/@rubenszimbres/code-generation-using-retrieval-augmented-generation-langchain-861e3c1a1a53Project 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_