Technical Documentation

System Architecture

A comprehensive look at the technical implementation, system design, and engineering decisions behind CuraSense's AI-powered healthcare platform.

Frontend

Next.js 14

Backend

FastAPI

AI Engine

Gemini Pro

Vector DB

ChromaDB

System Design

Layered Architecture

A modular, scalable architecture designed for reliability and maintainability

Presentation Layer

Next.js 14 Frontend

App Router with Server & Client Components
Tailwind CSS with custom design system
Framer Motion for fluid animations
Clerk Authentication integration
Real-time SSE updates for live diagnosis

API Layer

FastAPI Backend

High-performance async Python API
RESTful endpoints with OpenAPI docs
Server-Sent Events for streaming
Request validation with Pydantic
CORS and security middleware

Intelligence Layer

Multi-Agent AI System

CrewAI for agent orchestration
LangGraph for workflow management
Gemini Pro for text analysis
Gemini Vision for medical imaging
RAG pipeline with ChromaDB

Data Layer

Storage & Retrieval

ChromaDB vector database
Semantic search capabilities
PDF parsing and extraction
Session-based data isolation
15-minute TTL for HIPAA compliance
AI Orchestration

Multi-Agent Workflow

Specialized AI agents working in concert to deliver accurate medical insights

1

Document Analyzer

Extraction & Parsing

Extracts text, tables, and structured data from uploaded PDFs and images

2

Medical Expert

Clinical Interpretation

Provides expert-level medical interpretation and analysis

3

Drug Interaction

Safety Analysis

Checks for medication conflicts and provides safety recommendations

4

Report Generator

Output Synthesis

Compiles findings into comprehensive, readable reports

Implementation

Processing Pipeline

document_processing.py
async def process_medical_document(file: UploadFile):
    """Process uploaded medical document through AI pipeline."""

    # Step 1: Extract content from PDF/Image
    content = await extract_document_content(file)

    # Step 2: Initialize multi-agent crew
    crew = MedicalAnalysisCrew(
        agents=[
            document_analyzer,
            medical_expert,
            drug_interaction_checker,
            report_generator
        ],
        verbose=True
    )

    # Step 3: Stream results via SSE
    async for update in crew.execute_async(content):
        yield ServerSentEvent(update)
Technologies

Built With Modern Stack

Frontend

Next.js 14
TypeScript
Tailwind CSS
Framer Motion
Radix UI

Backend

Python
FastAPI
CrewAI
LangGraph
Pydantic

AI/ML

Gemini Pro
Gemini Vision
LangChain
RAG Pipeline

Infrastructure

Vercel
Railway
ChromaDB
Clerk Auth
Security & Performance

Enterprise Grade

HIPAA-Compliant Design

Session-based data isolation with 15-minute TTL ensures patient data privacy

Sub-30s Response Time

Optimized pipeline delivers comprehensive analysis in under 30 seconds

Real-time Streaming

Server-Sent Events provide live updates during AI processing

98.5% Accuracy

Multi-agent validation ensures high accuracy in medical analysis

Ready to explore more?

Check out the source code or try the live demo