Skip to content

Repository files navigation

Labmate · Lab Report Reader

Labmate is an AI-powered medical report reader that extracts key metrics from your lab reports and explains them in simple, plain English with natural lifestyle recommendations.

🔗 Live Demo (Update with actual live URL if different)

⚠️ Disclaimer: This tool provides general educational information based on AI analysis. It is not medical advice, diagnosis, or treatment. Always consult a qualified doctor before making any health decisions.

Features

  • Upload PDF: Securely upload your blood tests, lipid panels, or other medical reports.
  • Extract Text: Automatically extracts text from the PDF (Note: PDF must be text-searchable. Scanned images without OCR will not work).
  • Groq Structured Extraction: Uses open-source models via Groq (like Llama 3.1 and GPT-OSS) to parse the text and structure the data.
  • Report UI: Beautiful, easy-to-read interface showing status (high/low/normal) and lifestyle-only suggestions.

Tech Stack

Technology Description
Next.js 16 React framework (App Router)
pdf-parse Extracts text from PDF files
Groq AI Blazing fast AI inference for structured extraction (using Llama 3.1 / GPT-OSS)
Tailwind CSS Utility-first styling
Recharts For potential future data visualization
Framer Motion UI animations

Getting Started

Local Run

  1. Clone the repository and install dependencies:

    npm install
  2. Set up your environment variables by copying the example file and adding your Groq API key:

    cp .env.example .env.local

    Note: Without a valid GROQ_API_KEY, the application will return mock data for testing the UI.

  3. Start the development server:

    npm run dev
  4. Open http://localhost:3000 with your browser to see the result.

Architecture

The application follows a simple edge-compatible flow. For a detailed breakdown and sequence diagrams, please read ARCHITECTURE.md.

Quick Overview

  1. upload -> User uploads a PDF.
  2. POST /api/parse-pdf -> The backend parses the PDF text locally, truncates it to fit token limits, and sends it to the Groq API for structured extraction.
  3. report/[id] -> The structured data is presented to the user on a visual dashboard, saved to localStorage.
  4. POST /api/chat -> The user can ask questions; the context (raw text + JSON) is passed to the AI for a secure, lifestyle-focused response.

About

Labmate — medical lab-report reader: upload PDFs, parse with pdf-parse + Groq, plain-language explanations. Next.js. Not medical advice.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages