Skip to content

Repository files navigation

Post-Discharge Medical AI Assistant (POC)

This repository hosts a GenAI POC that satisfies the DataSmith AI GenAI Intern Assignment: a dual-agent chatbot for post-discharge nephrology care using RAG, patient lookup, web search fallback, and streaming UI.

Stack Overview

  • Backend: FastAPI orchestrates the receptionist/clinical agents, patient retrieval tool, logging, and exposure of helper endpoints.
  • Frontend: Streamlit hosts a lightweight UI with agent handoffs, conversation history, and required medical disclaimers.
  • RAG Pipeline: sentence-transformers + FAISS embeds the nephrology book (comprehensive-clinical-nephrology.pdf) for semantic retrieval with citations.
  • Web Search: SerpAPI integration provides up-to-date fallback data when the reference book does not suffice.
  • Patient Storage: Dummy discharge reports live in data/patients/ and are read via the patient retrieval tool.
  • Logging: All interactions, retrieval attempts, and handoffs are recorded in logs/system.log.

Getting Started

  1. Copy .env.example to .env and set the following values:
    • OPENAI_API_KEY (optional; fallback logic works without it)
    • SERPAPI_API_KEY (required for live web search)
  2. Install dependencies:
    python -m pip install -r requirements.txt
  3. Generate dummy patient data and the FAISS vector store:
    python scripts/generate_patients.py
    python scripts/build_vector_store.py
  4. Start the backend:
    uvicorn src.backend.app:app --reload
  5. Launch the Streamlit UI:
    streamlit run src/ui/app.py

Architecture Notes

  • The receptionist agent captures the patient name, fetches the discharge report, and asks targeted follow-up questions before routing clinical concerns.
  • The clinical agent uses FAISS-powered RAG (plus optional SerpAPI fallback) to craft answers with citations and explicit source tags.
  • A centralized logging utility timestamps every retrieval, tool call, handoff, and user response to satisfy the assignment’s audit requirements.

Deliverables

  • FastAPI + Streamlit POC
  • Scripts to generate patient data and rebuild the vector store
  • Logging and citations for referencing the nephrology textbook
  • Placeholder for SerpAPI-driven web search responses

Refer to scripts/ for ingestion utilities and src/ui/app.py for the UI layout.

genai-nephro-assistant

This assignment evaluates your ability to build a Proof of Concept (POC) multi-agent AI system for post-discharge patient care. You'll demonstrate core GenAI skills including RAG implementation, multi-agent orchestration, and medical data processing in a simplified but functional system.

About

This assignment evaluates your ability to build a Proof of Concept (POC) multi-agent AI system for post-discharge patient care. You'll demonstrate core GenAI skills including RAG implementation, multi-agent orchestration, and medical data processing in a simplified but functional system.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages