Skip to content

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Carely-AI Healthcare Assistant

An intelligent healthcare chatbot with appointment scheduling, Q&A capabilities, and RAG-enhanced responses.


πŸš€ Quick Start

Option 1: One Command (Easiest)

cd /Users/arvindrangarajan/PythonLab/Carely-AI
./start_all.sh

This starts both server and client automatically!

Option 2: Manual (Two Terminals)

Terminal 1 - Server:

cd /Users/arvindrangarajan/PythonLab/Carely-AI/server
bash run_server.sh

Terminal 2 - Client:

cd /Users/arvindrangarajan/PythonLab/Carely-AI/client
npm run dev

🌐 Access Points

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

πŸ“ Project Structure

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

✨ Features

πŸ€– AI Agents

  • 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

πŸ“… Appointment Management

  • Book appointments with specific doctors
  • View all appointments
  • Cancel appointments
  • Reschedule appointments
  • Available time slot suggestions

πŸ’¬ Chat Interface

  • Natural language conversations
  • Context-aware responses
  • Conversation history
  • Multi-turn dialogues

πŸ“š RAG (Optional)

  • Retrieval-Augmented Generation for accurate medical information
  • Pinecone vector database integration
  • Hospital-specific knowledge base

πŸ”§ Configuration

Server Environment Variables

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"]

πŸ“š Documentation

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

πŸ› οΈ Technology Stack

Backend

  • Framework: FastAPI
  • AI/ML: OpenAI GPT-4o-mini
  • Database: SQLite (SQLAlchemy ORM)
  • Authentication: JWT tokens
  • NLP: NLTK (for intent classification)
  • RAG: Pinecone (vector database)

Frontend

  • Framework: React 18
  • Build Tool: Vite
  • UI Library: Shadcn/ui (Radix UI + Tailwind CSS)
  • Routing: React Router
  • State Management: React Query
  • HTTP Client: Axios

πŸ§ͺ Testing

Test Server

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.py

Test Client

cd client
npm run lint

πŸ› Troubleshooting

Server Issues

"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

Client Issues

"Cannot connect to server"

"Port 5173 already in use"

lsof -ti:5173 | xargs kill -9

Common Issues

See full troubleshooting guide: HOW_TO_RUN.md


πŸ“Š API Endpoints

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


πŸ‘₯ Development Team

Built as part of a healthcare AI project.


πŸ“„ License

See LICENSE file for details.


🎯 Next Steps

  1. First time? See HOW_TO_RUN.md for setup
  2. Want to test? See server/TEST_GUIDE.md
  3. Need RAG? See server/RAG_SETUP_GUIDE.md
  4. API details? Visit http://localhost:8000/docs after starting

Ready to start?

./start_all.sh

πŸŽ‰ Enjoy using Carely-AI!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages