Installation Guide¶
Get RxFlow Pharmacy Assistant up and running in your environment with this comprehensive installation guide.
📋 Prerequisites¶
Before installing RxFlow, ensure you have the following prerequisites:
System Requirements¶
- Python 3.8+ (Python 3.9+ recommended)
- pip package manager
- Git for version control
- Linux: Ubuntu 18.04+, CentOS 7+, Debian 9+
- macOS: 10.14+ (Mojave or newer)
- Windows: 10+ with WSL2 (recommended) or native
- RAM: 4GB minimum, 8GB recommended
- Storage: 2GB available space
- Network: Internet connection for API services
API Keys Required¶
API Configuration
RxFlow requires the following API keys for full functionality:
- OpenAI API Key - For LLM processing (GPT-4)
- RxNorm API - For medication verification (free NIH service)
- Optional: GoodRx API - For prescription pricing
🚀 Quick Installation¶
1. Clone the Repository¶
# Clone the repository
git clone https://github.com/zarreh/rxflow-pharmacy-assistant.git
cd rxflow-pharmacy-assistant
2. Set Up Python Environment¶
3. Configure Environment Variables¶
# Copy example environment file
cp .env.example .env
# Edit the configuration file
nano .env # or use your preferred editor
Required Configuration:
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
# Application Settings
APP_NAME=RxFlow Pharmacy Assistant
LOG_LEVEL=INFO
# Optional: Database Configuration
# DATABASE_URL=postgresql://user:pass@localhost/rxflow
# Optional: External APIs
# GOODRX_API_KEY=your_goodrx_key_here
4. Verify Installation¶
Navigate to http://localhost:8501
to verify the installation.
🔧 Advanced Installation Options¶
Docker Installation¶
For containerized deployment:
# Build the Docker image
docker build -t rxflow-pharmacy-assistant .
# Run the container
docker run -p 8501:8501 \
-e OPENAI_API_KEY=your_key_here \
rxflow-pharmacy-assistant
Development Installation¶
For contributors and developers:
# Install with development dependencies
poetry install --with dev
# Install pre-commit hooks
pre-commit install
# Run development server with auto-reload
streamlit run app.py --server.runOnSave=true
🛠️ Dependencies Overview¶
Core Dependencies¶
Package | Version | Purpose |
---|---|---|
streamlit |
^1.28.0 | Web interface framework |
langchain |
^0.0.350 | AI agent orchestration |
openai |
^1.0.0 | LLM integration |
pydantic |
^2.0.0 | Data validation |
requests |
^2.31.0 | HTTP client for APIs |
Optional Dependencies¶
Package | Version | Purpose |
---|---|---|
pandas |
^2.1.0 | Data analysis and reporting |
plotly |
^5.17.0 | Interactive visualizations |
python-dotenv |
^1.0.0 | Environment management |
📊 Installation Verification¶
After installation, verify everything is working:
1. Check System Health¶
Expected output:
✅ Python version: 3.9.x
✅ Dependencies installed
✅ API keys configured
✅ Mock data loaded
✅ All systems operational
2. Test Core Functionality¶
# Test conversation manager
python -c "
from rxflow.workflow.conversation_manager import ConversationManager
cm = ConversationManager()
print('✅ Conversation manager initialized')
"
# Test patient tools
python -c "
from rxflow.tools.patient_history_tool import PatientHistoryTool
tool = PatientHistoryTool()
result = tool.get_medication_history('omeprazole')
print('✅ Patient tools working:', result.get('success', False))
"
3. Access the Web Interface¶
- Start the application:
streamlit run app.py
- Open browser to
http://localhost:8501
- Try the quick action: "I need to refill my medication"
- Verify you receive an AI response
🚨 Troubleshooting¶
Common Issues¶
Getting Help¶
If you encounter issues:
- Check Logs: Look in
logs/
directory for error details - GitHub Issues: Report bugs
- Documentation: Review troubleshooting guide
⚡ Performance Optimization¶
For Production Deployment¶
# Install production dependencies
pip install gunicorn uvicorn
# Optimize Python
export PYTHONOPTIMIZE=1
# Configure logging
export LOG_LEVEL=WARNING
For Development¶
# Enable debug mode
export LOG_LEVEL=DEBUG
# Use development server
streamlit run app.py --server.runOnSave=true --server.address=0.0.0.0
🎉 Next Steps¶
Once installation is complete:
- Quick Start Guide - Learn basic usage patterns
- Configuration Guide - Customize your setup
- User Guide - Master the interface
- API Reference - Explore the APIs
Installation Complete!
You're ready to start using RxFlow! Head to the Quick Start Guide to begin your first prescription refill workflow.