Spaces:
Sleeping
MediShield AI Document Classifier β Diagrams & Architecture
Complete visual documentation of the MediShield Insurance document classification system. All diagrams are interactive and editable on Excalidraw.
π Diagram Index
1. System Architecture Overview
Best for: Technical presentations, README documentation, architecture reviews
- File: diagrams/1-system-architecture.excalidraw β drag-drop onto https://excalidraw.com to open
- What it shows:
- Frontend browser (drag & drop UI)
- FastAPI server with asyncio.gather
- Three-stage parallel processing pipeline
- Classification decision flow with outputs
- Cost/speed metrics per stage
Key takeaways:
- Stage 1 (Rules): <1ms, $0
- Stage 2 (OCR): 1-2s, cheap
- Stage 3 (LLM): 2-4s, full AI capability
2. Classification Pipeline Decision Tree
Best for: Business stakeholders, explaining the cascading logic, non-technical audiences
- File: diagrams/2-decision-tree.excalidraw β drag-drop onto https://excalidraw.com to open
- What it shows:
- Document upload trigger
- Three sequential decision nodes
- Stage-by-stage flow with success criteria
- LangSmith monitoring integration
- Pipeline statistics
Key statistics:
- ~70% documents caught at Stage 1
- ~20% caught at Stage 2
- ~10% reach Stage 3 (LLM)
- Target accuracy: 95%
3. LinkedIn-Ready Overview
Best for: Social media posts, executive summaries, pitch decks, elevator pitches
- File: diagrams/3-linkedin-overview.excalidraw β drag-drop onto https://excalidraw.com to open
- What it shows:
- Problem statement (manual ops, backlogs, errors)
- Solution overview (3-stage pipeline)
- Three-stage visual cards with metrics
- Business impact metrics
Perfect for:
- LinkedIn carousel posts
- Slide deck cover slide
- Twitter/X thread opening image
- Instagram story content
Impact highlights:
- β±οΈ <5 seconds per document
- π β₯95% accuracy target
- π° 70% cost savings vs manual
4. Data Flow & Technical Architecture
Best for: Engineers, technical deep-dives, implementation reviews
- File: diagrams/4-data-flow.excalidraw β drag-drop onto https://excalidraw.com to open
- What it shows:
- Frontend β FastAPI β asyncio β Thread Pool flow
- Concurrent execution with asyncio.gather
- Three parallel classification stages
- LangSmith tracing integration
- JSON response format
- UI rendering
Technical flow:
- Browser sends multipart/form-data
- FastAPI reads bytes
- asyncio.gather creates concurrent tasks
- run_in_executor delegates to thread pool
- Three stages process in parallel
- LangSmith captures spans + metrics
- Response JSON returned + UI rendered
5. CI/CD & Deployment Pipeline
Best for: DevOps documentation, deployment guides, release processes
- File: diagrams/5-cicd-pipeline.excalidraw β drag-drop onto https://excalidraw.com to open
- What it shows:
- GitHub push trigger
- GitHub Actions CI orchestration
- pytest (117 tests) gate
- Docker build pipeline
- Azure Container Registry
- Azure Container Apps deployment
- Monitoring endpoints
Deployment flow:
git push β CI/Actions β Tests (must pass) β Docker Build β
Azure Registry β Container Apps (0.5vCPU, 2GB, auto-scale 1-3) β
Live service with monitoring
Quality gates:
- β Tests MUST pass before deploy
- Automated on every push to main
- 117 comprehensive tests
6. Technology Stack & Integrations
Best for: Tech stack documentation, vendor/library justification, dependency reviews
- File: diagrams/6-tech-stack.excalidraw β drag-drop onto https://excalidraw.com to open
- What it shows:
- Frontend: HTML5, CSS3, JavaScript
- Backend: FastAPI, Python 3.12, Asyncio
- ML/AI: easyOCR, Gemini API, Regex patterns
- Monitoring: LangSmith, Azure Monitor
- Infrastructure: Docker, Azure Container Apps, ACR, Storage
- CI/CD: GitHub Actions, pytest
Complete tech stack:
- Language: Python 3.12
- Web: FastAPI 0.136
- ML: easyOCR, PyTorch, Gemini API (gemma-4-31b-it)
- Concurrency: asyncio, thread pool
- Monitoring: LangSmith + Azure Monitor
- Container: Docker + Azure Container Apps
- Registry: Azure Container Registry
- CI/CD: GitHub Actions + pytest (117 tests)
7. Performance Metrics & KPIs Dashboard
Best for: Executive dashboards, ROI presentations, stakeholder reports
- File: diagrams/7-metrics-dashboard.excalidraw β drag-drop onto https://excalidraw.com to open
- What it shows:
- Processing speed breakdown (<5s total)
- Accuracy targets by stage
- Cost efficiency analysis
- Business impact metrics
- QA coverage (117 tests)
- Real-time monitoring
- Service uptime (99.5%)
Key metrics:
- β‘ Speed: <5 seconds per document (Stage 1: <1ms, Stage 2: 1-2s, Stage 3: 2-4s)
- π― Accuracy: β₯95% target (Stage 1: 100%, Stage 2: 98%, Stage 3: 92%)
- π° Cost: 70% savings vs manual labor
- π Impact: 48hr β 2hr backlogs (24x faster), 6-8% β <1% errors (87% reduction)
- π₯ Staffing: 12 β 2 FTE operators (10 freed up for higher-value work)
- β Quality: 117 tests, real-time monitoring, 99.5% uptime
π¨ How to Export Diagrams as PNG
Option 1: From Excalidraw (Recommended)
- Click the diagram link above to open in Excalidraw
- Click "Download as PNG" in the menu (or use Shift+Ctrl+Ctrl+E)
- Save to your project folder
Option 2: Screenshot
- Open diagram in Excalidraw
- Use browser DevTools to zoom 150-200%
- Take screenshot (Ctrl+PrintScreen or Snip tool)
- Crop and save
Option 3: SVG Export
- Click diagram link to open Excalidraw
- Click menu β Export β SVG
- Save for editing in Adobe Illustrator or Figma
π Using Diagrams in Documentation
GitHub README
## Architecture
### System Overview
[Open diagram](https://excalidraw.com/#json=...)
### Classification Pipeline
[Open diagram](https://excalidraw.com/#json=...)
PowerPoint / Google Slides
- Export each diagram as PNG
- Insert into slides
- Add captions below each diagram
LinkedIn Posts
- Export LinkedIn overview diagram as PNG
- Upload directly to LinkedIn
- Use captions from "LinkedIn Content" section below
Confluence / Internal Docs
- Export as PNG
- Upload with alt-text describing the flow
- Link to live Excalidraw for edits
π LinkedIn Post Templates
Template 1: Problem-Solution Hook
Building AI that removes manual work from insurance claims processing.
Our MediShield Document Classifier automatically sorts bills, KYC docs,
prescriptions, and lab reports with 95% accuracy in under 5 seconds.
Three-stage intelligence pipeline:
β’ Rules Engine β Instant match (~70% of docs, <1ms)
β’ KYC OCR β Pattern detection (~20% of docs, 1-2s)
β’ Gemini LLM β Full AI classification (~10% of docs, 2-4s)
Results:
- 48-hour backlogs β 2 hours (24x faster) β‘
- 6-8% error rate β <1% (87% reduction) β
- 12 operators β 2 FTE (10 freed up) π₯
Cost-optimized pipeline: only 10% of documents reach the LLM.
#AI #InsurTech #Automation #MachineLearning
Template 2: Technical Achievement
Just shipped a cost-optimized ML pipeline for 1000s of insurance documents daily.
The secret? Smart cascading intelligence:
β’ 70% caught by regex rules (<1ms, $0)
β’ 20% by easyOCR pattern matching (1-2s, cheap)
β’ 10% need Gemini LLM (2-4s, full capability)
Stack:
- FastAPI + asyncio for concurrent processing
- easyOCR for document text extraction
- Gemini API (gemma-4-31b-it) for classification
- LangSmith for end-to-end tracing
- Azure Container Apps for auto-scaling
- 117 passing tests, 99.5% uptime
Real-time monitoring shows:
- <5s latency per document
- 95% accuracy target
- 70% cost savings vs manual ops
#BuildingInPublic #Backend #Python #MLOps
Template 3: Business Impact
Automated document classification just eliminated a 48-hour backlog.
Before: 12 manual operators, 6-8% error rate, 48-hour backlogs
After: AI pipeline, <1% errors, 2-hour turnaround
MediShield Insurance processes 1000s of health claims daily. Documents
were being sorted by handβcausing backlogs, burnout, and errors.
Our three-stage pipeline:
1. Rules (instant) β catches bills & common patterns
2. OCR (1-2s) β detects KYC documents
3. LLM (2-4s) β classifies complex cases
80% of documents are handled by Stage 1 or 2. Only 10% need the expensive LLM.
Result: 24x faster processing, 87% fewer errors, 10 operators freed up
for higher-value work.
#InsuranceAI #Automation #ProductLaunch
Template 4: Engineering Deep-Dive
How we built a cost-optimized document classifier that handles 95% accuracy
in <5 seconds using smart cascading stages.
The challenge: Process insurance documents fast + accurately + cheaply.
The solution: Three-stage pipeline with early exit optimization.
Stage 1 - Rules Engine (regex):
Input: Filename, metadata
Logic: bill_* pattern match
Output: ~70% of docs
Latency: <1ms | Cost: $0
Stage 2 - KYC OCR (easyOCR):
Input: Document image
Logic: Extract text β keyword matching
Output: ~20% of docs
Latency: 1-2s | Cost: $0.001/doc
Stage 3 - Gemini LLM (gemma-4-31b-it):
Input: Document + context
Logic: Full AI classification
Output: ~10% of docs (high-value)
Latency: 2-4s | Cost: $0.01/doc
Result: Only 10% of requests hit the expensive LLM.
80% resolved at Stage 1 or 2.
Pipeline utilization: optimal. Cost: 70% cheaper.
Tech: FastAPI + asyncio + easyOCR + Gemini API
Monitoring: LangSmith traces + Azure Monitor
Deployment: Docker + Azure Container Apps + GitHub Actions CI/CD
#LLMOps #CostOptimization #MLEngineering #Python
π Quick Reference: When to Use Each Diagram
| Audience | Diagram | Format | Use Case |
|---|---|---|---|
| Executives | Overview (3) or Metrics (7) | PNG/PDF | Board presentation, investor pitch |
| Product Managers | Decision Tree (2) or Overview (3) | PNG/Web | Roadmap, requirements, user stories |
| Engineers | Data Flow (4) + Stack (6) | Excalidraw/Web | Implementation, architecture reviews |
| DevOps | CI/CD (5) | PNG/Web | Deployment docs, runbooks |
| Overview (3) or Metrics (7) | PNG only | Social media posts | |
| Customers | Decision Tree (2) or Overview (3) | PNG/PDF | Demos, sales collateral |
π All Diagram Links
| # | Name | Purpose | Link |
|---|---|---|---|
| 1 | System Architecture | Technical reference | Excalidraw |
| 2 | Decision Tree | Business logic | Excalidraw |
| 3 | LinkedIn Overview | Social media | Excalidraw |
| 4 | Data Flow | Technical detail | Excalidraw |
| 5 | CI/CD Pipeline | DevOps | Excalidraw |
| 6 | Tech Stack | Dependencies | Excalidraw |
| 7 | Metrics Dashboard | KPIs | Excalidraw |
π‘ Tips for Sharing
Email / Slack
Here's the architecture overview:
β https://excalidraw.com/#json=cKXt7VHvUQ43F0PVmug_O,_Ny9KIaO5JERL3omWyak2w
(They can view, zoom, comment without editing)
Blog / Website

*[View interactive diagram](https://excalidraw.com/#json=...)*
GitHub Issues / PRs

CC @team for review
Presentations
- Export diagram as PNG (150% zoom)
- Insert into PowerPoint/Slides
- Add speaker notes from this document
- Include the interactive Excalidraw link in handouts
π How to Edit Diagrams
Each diagram is fully editable in Excalidraw:
- Click the diagram link
- Click "Edit diagram" (top-right)
- Make changes (add shapes, update text, recolor)
- Save to your library (auto-saves) or Copy link to share updated version
Changes you might make:
- Update technologies (new framework versions)
- Add new stages or workflows
- Customize colors for your brand
- Add your company logo
- Annotate with your notes
Generated: April 26, 2026 Last updated: [Auto-generated Excalidraw diagrams]