GitHub - harshhh28/hia: Hia (Health Insights Agent) - AI Agent to analyze blood reports and provide detailed health insights. (original) (raw)

AI Agent to analyze blood reports and provide detailed health insights.

Features |Tech Stack |Installation |Project Structure |Contributing |Author

Usage Demo

🌟 Features

🛠️ Tech Stack

🚀 Installation

Requirements 📋

Getting Started 📝

  1. Clone the repository:

git clone https://github.com/harshhh28/hia.git cd hia

  1. Install dependencies:

pip install -r requirements.txt

  1. Required environment variables (in .streamlit/secrets.toml):

SUPABASE_URL = "your-supabase-url" SUPABASE_KEY = "your-supabase-key" GROQ_API_KEY = "your-groq-api-key"

  1. Set up Supabase database schema:

The application uses three tables: users, chat_sessions, and chat_messages. Use the SQL script at public/db/script.sql to create them.

database schema

(You can turn off email confirmation on signup in Supabase: Authentication → Providers → Email → Confirm email.)

  1. Run the application:

streamlit run src\main.py

📁 Project Structure

hia/
├── requirements.txt
├── README.md
├── src/
│   ├── main.py                 # Application entry point; chat UI and session flow
│   ├── auth/
│   │   ├── auth_service.py     # Supabase auth, sessions, chat message persistence
│   │   └── session_manager.py # Session init, timeout, create/delete chat sessions
│   ├── components/
│   │   ├── analysis_form.py    # Report source (upload/sample), patient form, analysis trigger
│   │   ├── auth_pages.py       # Login / signup pages
│   │   ├── footer.py           # Footer component
│   │   ├── header.py           # User greeting
│   │   └── sidebar.py          # Session list, new session, daily limit, logout
│   ├── config/
│   │   ├── app_config.py       # App name, limits (upload, pages, analysis, timeout)
│   │   ├── prompts.py          # Specialist prompts for report analysis
│   │   └── sample_data.py      # Sample blood report for "Use Sample PDF"
│   ├── services/
│   │   └── ai_service.py       # Analysis + chat entry points; vector store caching
│   ├── agents/
│   │   ├── analysis_agent.py   # Report analysis, rate limits, knowledge base, in-context learning
│   │   ├── chat_agent.py       # RAG pipeline (embeddings, FAISS, query contextualization)
│   │   └── model_manager.py   # Groq multi-model cascade and fallback
│   └── utils/
│       ├── validators.py       # Email, password, PDF file and content validation
│       └── pdf_extractor.py   # PDF text extraction and validation
├── public/
│   └── db/
│       ├── script.sql          # Supabase schema (users, chat_sessions, chat_messages)
│       └── schema.png          # Schema diagram

👥 Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on how to submit pull requests, the development workflow, coding standards, and more.

We appreciate all contributions, from reporting bugs and improving documentation to implementing new features.

👨‍💻 Contributors

Thanks to all the amazing contributors who have helped improve this project!

Avatar Name GitHub Role Contributions PR(s) Notes
harshhh28 avatar Harsh Gajjar harshhh28 Project Creator & Maintainer Core implementation, Documentation N/A Lead Developer
gaurav98095 avatar Gaurav gaurav98095 Contributor DB Schema, bugs #1, #5, #6, #7 Database Design, bugs

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙋‍♂️ Author

Created by Harsh Gajjar