A chatbot using Retrieval-Augmented Generation (RAG) to provide information about Medi-Cal and Covered California.
Note: This is a refactored version of a project submitted for the Microsoft Rag Hack 2024. You can find the original submitted project here.
Healthcare in the United States can be expensive and complex to navigate. This Retrieval-Augmented Generation (RAG) chatbot focused on California Health Services is built to assist California residents to understand and query their rights and eligibility for programs like Medi-Cal and Covered California. This AI-powered solution aims to:
- Provide easy access to accurate information about Medi-Cal and Covered California
- Offer personalized responses and improve accessibility to healthcare information for all California residents
- Reduce the burden on government resources by automating common inquiries
- Frontend: React
- Backend: Node.js with Express
- RAG Implementation: Langchain
- Database: PostgreSQL
-
Clone the repository:
git clone https://github.com/seneyu/rag-chatbot.git cd rag-chatbot
-
Install dependencies for both client and server directories:
cd client && npm install cd ../server && npm install
-
Set up environment variables:
- Create a
.env
file in the server directory - Add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
- Create a
-
This project uses Supabase for storing and retrieving embeddings. Follow these steps to set up your own Supabase instance:
- Create a Supabase account at supabase.com
- Create a new project in Supabase
- Set up your database schema
- Generate embeddings:
- Navigate to /server/createEmbeddings.js
- Review the
createAndStoreEmbeddings()
function at line 44 - If you need to generate new embeddings, ensure the function call is uncommented:
createAndStoreEmbeddings()
. Run the script:node creaetEmbeddings.js
. - If embeddings are already generated, ensure the function call is commented out to prevent accidental recreation. You can skip running this script.
- Add Supabase configuration to your
.env
file:
SUPABASE_URL=your_supabase_project_url SUPABASE_KEY=your_supabase_api_key
-
Navigate to the server directory and start the server with:
cd server npm run start
-
Open your browser and navigate to
http://localhost:5173
(or the port specified by Vite).
- Add reference citations to AI's answers
- Language support
- Expand the knowledge base to cover more specific health programs
This chatbot utilizes information from the California Health Care Services (HCS) and Covered California websites. While I strive to provide accurate and up-to-date information, some content may not be current. This chatbot is not an official service of HCS or Covered California and should not be considered a substitute for professional advice or assistance.