An intelligent healthcare chatbot with appointment scheduling, Q&A capabilities, and RAG-enhanced responses.
cd /Users/arvindrangarajan/PythonLab/Carely-AI
./start_all.shThis starts both server and client automatically!
Terminal 1 - Server:
cd /Users/arvindrangarajan/PythonLab/Carely-AI/server
bash run_server.shTerminal 2 - Client:
cd /Users/arvindrangarajan/PythonLab/Carely-AI/client
npm run dev| Service | URL | Description |
|---|---|---|
| Client App | http://localhost:5173 | Main web interface |
| Server API | http://localhost:8000 | Backend API |
| API Docs | http://localhost:8000/docs | Interactive API documentation |
| Health Check | http://localhost:8000/api/v1/health | Server health status |
Carely-AI/
βββ server/ # FastAPI Backend
β βββ app/
β β βββ agents/ # AI Agents (Routing, QnA, Appointment)
β β βββ api/ # API endpoints
β β βββ core/ # Configuration & security
β β βββ db/ # Database models & session
β β βββ models/ # SQLAlchemy models
β β βββ schemas/ # Pydantic schemas
β βββ RAG/ # RAG implementation (medical knowledge base)
β βββ venv/ # Python virtual environment
β βββ requirements.txt # Python dependencies
β βββ run_server.sh # Server startup script
β
βββ client/ # React + Vite Frontend
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Page components
β β βββ utils/ # API utilities
β βββ node_modules/ # Node dependencies
β βββ package.json # Node dependencies config
β βββ vite.config.ts # Vite configuration
β
βββ start_all.sh # Launch both server & client
βββ HOW_TO_RUN.md # Detailed running instructions
- Routing Agent: Intelligently routes queries to scheduling or Q&A
- Appointment Agent: Handles appointment booking, cancellation, rescheduling
- QnA Agent: Answers medical questions with RAG support
- Book appointments with specific doctors
- View all appointments
- Cancel appointments
- Reschedule appointments
- Available time slot suggestions
- Natural language conversations
- Context-aware responses
- Conversation history
- Multi-turn dialogues
- Retrieval-Augmented Generation for accurate medical information
- Pinecone vector database integration
- Hospital-specific knowledge base
Create .env file in server/ directory:
# Required
OPENAI_API_KEY=sk-proj-your-key-here
# Optional (for RAG)
PINECONE_API_KEY=your-pinecone-key-here
RAG_ENABLED=true
# Application
SECRET_KEY=your-secret-key
DEBUG=True
DATABASE_URL=sqlite:///./carely.db
# CORS
BACKEND_CORS_ORIGINS=["http://localhost:3000","http://localhost:5173"]| Document | Description |
|---|---|
| HOW_TO_RUN.md | Complete guide to running server & client |
| server/README.md | Server-specific documentation |
| server/QUICK_START.md | Quick server setup guide |
| server/TEST_GUIDE.md | Testing documentation |
| server/API_KEY_AUDIT.md | API key configuration audit |
| server/RAG_SETUP_GUIDE.md | RAG integration guide |
- Framework: FastAPI
- AI/ML: OpenAI GPT-4o-mini
- Database: SQLite (SQLAlchemy ORM)
- Authentication: JWT tokens
- NLP: NLTK (for intent classification)
- RAG: Pinecone (vector database)
- Framework: React 18
- Build Tool: Vite
- UI Library: Shadcn/ui (Radix UI + Tailwind CSS)
- Routing: React Router
- State Management: React Query
- HTTP Client: Axios
cd server
source venv/bin/activate
# Run all tests
bash run_tests.sh
# Test RAG integration
python test_rag_integration.py
# Test API key loading
python test_openai_key.pycd client
npm run lint"OPENAI_API_KEY not configured"
# Check .env file
cat server/.env | grep OPENAI_API_KEY
# Add if missing
echo "OPENAI_API_KEY=your-key" >> server/.env"Port 8000 already in use"
lsof -ti:8000 | xargs kill -9"Cannot connect to server"
- Ensure server is running on http://localhost:8000
- Check CORS settings in server
.env
"Port 5173 already in use"
lsof -ti:5173 | xargs kill -9See full troubleshooting guide: HOW_TO_RUN.md
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Root endpoint |
| GET | /ping |
Health check |
| GET | /api/v1/health |
Detailed health status |
| POST | /api/v1/auth/login |
User login |
| POST | /api/v1/auth/register |
User registration |
| POST | /api/v1/chat |
Send chat message |
| GET | /api/v1/patients/me |
Get current user |
| GET | /docs |
Interactive API documentation |
Full API documentation: http://localhost:8000/docs
Built as part of a healthcare AI project.
See LICENSE file for details.
- First time? See HOW_TO_RUN.md for setup
- Want to test? See server/TEST_GUIDE.md
- Need RAG? See server/RAG_SETUP_GUIDE.md
- API details? Visit http://localhost:8000/docs after starting
Ready to start?
./start_all.shπ Enjoy using Carely-AI!