A specialized Discord bot that provides medical information assistance using Mistral AI, with support for patient records, insurance information, and medical data retrieval.
-
RAG (Retrieval Augmented Generation)
- FAISS-powered similarity search
- Intelligent chunking of insurance information
- Cached embeddings for performance
-
Medical Data Access
- Patient information retrieval
- Allergy information
- Diagnostic reports
- Medical conditions
- ICD-10 code assistance
-
Caching System
- Redis caching for responses (1-hour TTL)
- File-based caching for embeddings and chunks
- Efficient response retrieval
-
FHIR Integration
- Epic FHIR API client
- Secure JWT authentication
- Comprehensive medical data parsing
- Python 3.8+
- Redis server
- Conda package manager
- Clone the repository:
git clone <repository-url>
cd <repository-directory>- Create and activate conda environment:
conda env create -f local_env.yml
conda activate discord_bot- Create a
.envfile with your credentials:
DISCORD_TOKEN="your-discord-token"
MISTRAL_API_KEY="your-mistral-api-key"
EPIC_TOKEN_URL="your-epic-token-url"
PRIVATE_KEY_PATH="path-to-your-private-key"
- Create a new Discord application at https://discord.com/developers
- Enable required intents:
- Presence Intent
- Server Members Intent
- Message Content Intent
- Copy the bot token to your
.envfile
- Sign up at https://console.mistral.ai
- Generate an API key
- Add the API key to your
.envfile
- Start the bot:
python bot.py- The bot will respond to messages in channels it has access to
- Medical data queries will automatically retrieve relevant information
- Insurance information is processed using RAG for accurate responses
bot.py: Main Discord bot implementationagent.py: Mistral AI integration and RAG systempython/:patient_info_parser.py: FHIR patient data parserinsurance_parser.py: Insurance information parserepic_fhir_client.py: Epic FHIR API clientparse_diagnostic_data.py: Diagnostic report parsercondition_parser.py: Medical condition parserallergy_parser.py: Allergy information parser
- JWT-based authentication for EPIC FHIR API
- Environment variables for sensitive credentials
- Redis TTL for cached responses
- Secure private key handling
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
For support, please open an issue in the repository or contact Olivia Beyer Bruvik or Neel Narayan.