README last updated: March 9, 2026
CareGuide AI is an intelligent system that extracts text from prescription images and automatically identifies medicines using OCR and NLP technologies.
- OCR (Optical Character Recognition): Extracts text from prescription images using Tesseract or EasyOCR depending on configuration, or optionally by calling an Amazon Bedrock multimodal model when
provider=awsis selected.- You can force a specific engine by setting
OCR_ENGINEenvironment variable (pytesseract,easyocr, orauto) - Preprocessing pipeline includes denoising, contrast enhancement, CLAHE, deskewing, and morphological filtering
- EasyOCR often provides better results on messy handwritten prescriptions
- You can force a specific engine by setting
- Medicine Detection: Identifies medicine names from extracted text using pattern matching and spaCy NER locally, or utilises a Bedrock Agent connected to a medical Knowledge Base for AWS workflows
- Image Preprocessing: Advanced image enhancement for better OCR accuracy
- FastAPI Backend: RESTful API for prescription processing
- Modern Frontend: Next.js-based user interface
CareGuide_AI/
├── backend/ # Python FastAPI backend
│ ├── app/
│ │ ├── main.py # FastAPI application
│ │ ├── models.py # Database models
│ │ ├── database.py # Database configuration
│ │ ├── routers/ # API routes
│ │ │ └── prescription.py
│ │ └── services/ # Business logic
│ │ ├── ocr_service.py # Tesseract OCR integration
│ │ └── nlp_service.py # Medicine detection
│ └── requirements.txt # Python dependencies
│
└── careguide-frontend/ # Next.js frontend
├── app/
├── components/
└── public/
-
Install Tesseract OCR:
- Download from: https://github.com/UB-Mannheim/tesseract/wiki
- Default install path:
C:\Program Files\Tessract_OCR\
-
Install Python Dependencies:
cd backend pip install -r requirements.txt python -m spacy download en_core_web_sm -
Install OpenCV (for advanced image processing):
pip install opencv-python
cd careguide-frontend
npm install
npm run devcd backend
python -m uvicorn app.main:app --reload --host 127.0.0.1 --port 8000Access the API documentation at: http://127.0.0.1:8000/docs
cd careguide-frontend
npm run dev- Endpoint:
POST /upload-prescription - Content-Type:
multipart/form-data - Parameter:
file(image file) - Response:
{ "extracted_text": "...", "medicines_detected": ["aspirin", "paracetamol", ...] }
- FastAPI: Modern Python web framework
- Tesseract OCR: Optical character recognition
- Spacy: NLP for entity recognition
- SQLAlchemy: ORM for database operations
- OpenCV: Advanced image processing
- Next.js: React framework
- TypeScript: Type-safe JavaScript
- Tailwind CSS: Utility-first CSS framework
If Tesseract is installed in a custom location, set the environment variable:
$env:TESSERACT_PATH = "C:\Program Files\Tessract_OCR\tesseract.exe"- Cloud storage integration for prescriptions
- Document management system
- User authentication and profiles
- Prescription history tracking
- Export reports (PDF, CSV)
- Mobile app support
This project has seen a major update on March 9, 2026 which included:
- Added comprehensive AWS documentation and setup guides (
AWS_*.md). - Introduced new backend services:
aws_service.pyfor AWS interactions.aws_lambda_handler.pyfor Lambda deployment.- Updated OCR service and prescription router logic.
- Included SQLite database placeholder (
careguide.db) and CloudFormation template (template.yaml). - Expanded frontend with authentication, dashboard, and diet-plan pages.
- Added Tailwind configuration for styling.
- Added various helper scripts for AWS setup and knowledge-base ingestion.
- Added design and requirement specifications under
specs/.
These additions bring AWS deployment, improved UI features, and a more structured development workflow.
MIT License - feel free to use this project for personal or educational purposes.
Sohail (@sohail9972)
For issues, questions, or suggestions, please open an issue on GitHub.
If you have a specialized OCR model (for example, a trained Tesseract language pack or a deep
learning model), you can integrate it by modifying backend/app/services/ocr_service.py.
The code already supports an OCR_ENGINE environment variable and will use EasyOCR by default
if available. Feel free to supply your model code here and I can help wire it in.