RecordAnalysis is a Streamlit-based AI assistant designed to act as a virtual doctor, answering user questions based on a given medical context. It leverages Google's Gemini (Generative AI) via LangChain to provide detailed, relevant medical answers, and clearly handles irrelevant or ambiguous queries with predefined responses.
- 🩺 AI Doctor Assistant: Interprets and responds to health-related queries using Google’s Generative AI.
- 📄 PDF Medical Document Support: Users can upload documents (e.g., patient reports, research papers) to serve as context.
- 💬 Natural Language Understanding: Built on LangChain + Gemini API for coherent, context-aware answers.
- ✅ Context-Aware Behavior:
- If the query is unrelated to medicine, the model responds:
Context is not related to medical. - If the answer isn't found in the given context, it responds:
I CAN'T GET IT! Please Rephrase the question.
- If the query is unrelated to medicine, the model responds:
| Component | Description |
|---|---|
| 🐍 Python | Primary language |
| 📦 Streamlit | Frontend web UI framework |
| 🤖 Google Generative AI | For intelligent and contextual responses |
| 🧠 LangChain | Manages prompt templates and context chaining |
| 📚 PyPDF2 | Parses uploaded PDFs for analysis |
| 🧠 ChromaDB + FAISS | Vector store for fast context retrieval |
| 🔐 python-dotenv | Loads API keys and env variables securely |
| 📋 streamlit-option-menu | Sidebar navigation and UI interactions |
Clone the repository:
git clone https://github.com/akayg/RecordAnalysis.git
cd RecordAnalysisInstall dependencies:
pip install -r requirements.txtCreate a .env file in the root
Clone the repository:
git clone https://github.com/akayg/RecordAnalysis.git
cd RecordAnalysisInstall dependencies:
pip install -r requirements.txtCreate a .env file in the root directory and add your Google API key:
GOOGLE_API_KEY=your_google_api_key_herestreamlit run app.pyRecordAnalysis/
├── .vscode/ # VS Code settings (launch configs, etc.)
├── colab_files_to_train_models/ # Training scripts/notebooks for model training (Google Colab specific)
├── dataset/ # Dataset files used for training/testing
├── faiss_index/ # Saved FAISS index for vector search
├── saved_models/ # Pretrained or fine-tuned ML/AI models
│
├── Dockerfile # Docker configuration for containerizing the app
├── README.Docker.md # Docker-specific setup and usage instructions
├── compose.yaml # Docker Compose file (multi-container setup, services, etc.)
│
├── acne.pdf # Sample PDF used for testing/analysis
├── prompt.txt # Prompt templates or example prompts for the AI assistant
│
├── dbts.py # Handles database-related logic (if applicable)
├── main.py # Main entry point for running the Streamlit app
├── pdfs.py # Logic for handling and parsing PDF documents
├── requirements.txt # Python dependencies for the project
- Upload a medical document (PDF).
- Ask a question related to the document.
- Get a contextual and medically detailed answer.
🧠 Example Prompt:
“What are the common symptoms of Type 2 Diabetes mentioned in the uploaded report?”
✅ Response (if found in context):
“According to the document, common symptoms include increased thirst, frequent urination, fatigue…”
❌ If the question is off-topic:
Context is not related to medical.
❓ If question is unclear or no match:
I CAN'T GET IT! Please Rephrase the question.
Contributions are welcome!
- Fork this repo
- Create a new branch (
git checkout -b feature-name) - Commit your changes (
git commit -am 'Added new feature') - Push to the branch (
git push origin feature-name) - Open a Pull Request
This project is licensed under the MIT License.
- GitHub: @akayg
- Email: *email@abhishekgore.com