Back to Projects
Design EngineeringFull-StackAI AgentCofounder

Carelyze Platform

Designed and built an AI agent that autonomously executes healthcare SOPs — from the ReAct loop and context management to the landing page and email templates.

Carelyze Platform cover
Role
Design Eng. + Full-Stack + AI
Status
In Production
Duration
~2024 – Present
Tools
Figma, Next.js, Python, FastAPI, AWS, K8s

The Problem

Small independent clinics struggle to close care gaps and schedule preventive visits at scale. Manual outreach is slow, error-prone, and can't keep up with compliance requirements — HIPAA for patient data, TCPA for communications. Carelyze automates the entire patient engagement lifecycle, from intelligent outreach campaigns to AI-powered clinical operations, so clinics can focus on care, not admin.

What I Built

Carelyze is an AI-powered SaaS platform for healthcare operations. As cofounder, I worked across every surface: designed and built the AI agent architecture, contributed to the FastAPI backend (45+ API routes, 58 services), contributed to the Next.js frontend (91+ components), built the marketing website solo, designed all email templates, and learned DevOps to deploy everything on Kubernetes.

Dashboard & Case Management

Dashboard & Case Management

Visual Workflow Builder

Visual Workflow Builder

AI Agent with ReAct Loop

Autonomous agent that classifies tasks, generates plans from SOP templates, executes tools with policy-aware risk management, and maintains context via embeddings-based memory. Human-in-the-loop approval gates for high-risk actions.

Campaign Orchestration Engine

Graph-based state machine driving multi-step patient outreach (SMS + email) with condition branching, wait nodes, consent capture, and appointment scheduling via nanosites. TCPA/HIPAA compliance handled automatically.

Workflow Builder & SOP System

Visual ReactFlow-based designer where users define SOPs as descriptive blueprints. 20+ node types. The agent interprets these SOPs and adapts execution to context — a 5-step SOP can handle edge cases the author never anticipated.

Marketing Website (Solo Build)

Marketing Website (Solo Build)

Email Templates (Solo Design)

Email Templates (Solo Design)

Design Decisions

1

Workflows-as-SOPs, not executable automations

Instead of rigid executable workflows, we made workflows descriptive process blueprints. The agent interprets and adapts to context rather than blindly following steps. Core philosophy: trust the LLM to be intelligent — our job is to provide the right context, tools, and guidelines.

2

Policy-first tool execution with risk levels

Every tool has a risk level (LOW / MEDIUM / HIGH). The policy engine evaluates each invocation against org-specific thresholds before execution. You can't let an agent send SMS to 10,000 patients without a human gate, but you also can't make analysts approve every file read.

3

One ticket, many agent runs

A single WorkItem can have many AgentTask executions. For email chains, instead of creating a new ticket per email, all agent runs link to the same ticket. The human sees one coherent thread with full execution trace — dramatically reducing noise for healthcare analysts.

How I Built It

Frontend
Dashboard
Next.js 14 · 91+ comp
Workflow
ReactFlow · 20+ nodes
Landing
Next.js 15 · GSAP
Backend · Python / FastAPI
REST API
45+ routes · Pydantic
58 Services
Campaign orchestrator
Auth & Tenancy
JWT · RLS
AI Agent
ReAct Loop
5-phase orchestrator
Policy Engine
LOW / MED / HIGH risk
Memory
pgvector embeddings
Campaign Engine
State Machine
30s tick · APScheduler
7 Node Types
Graph-based flows
Nanosites
Consent · Scheduling
Infrastructure · K3s
PostgreSQL
pgvector ext.
RabbitMQ
Async jobs
Redis
Cache · SSE pub/sub
AWS
S3 · ECR · SES
CommsTwilio · SMS verifyInfobip · SMS deliverySES · Email
Domainsapi.carelyze.iocarelyze.iolink.carelyze.comcomm.carelyze.io
1

ReAct Agent Loop with Context Builder

Multi-phase agent (Clarify → Plan → Execute → Reflect → Report) in Python/FastAPI. ContextBuilder assembles phase-appropriate context from conversation history, SOP guidance, tool manifests, and pgvector memory. PolicyAwareReasoner scores decisions — heuristic shortcuts for deterministic steps, LLM reasoning for ambiguous ones.

2

Multi-Tenant Campaign State Machine

CampaignExecutionEngine processes enrollment state transitions every 30s via APScheduler. Graph-based campaigns with 7 typed nodes and conditional edges. Optimistic locking prevents concurrent processing. Organization-scoped via ContextVar-based tenant isolation with Row-Level Security.

3

Kubernetes Deployment on K3s

Full stack on K3s with NGINX Ingress, Let's Encrypt TLS, and automated ECR image update cron jobs. Six services across 4 domains. PostgreSQL with pgvector, RabbitMQ, and Redis with persistent volumes and resource limits.

AI Agent ReAct Loop

Task → Observe → Classify → Plan → Execute (with policy gates) → Reflect → Report → Save to memory

Trigger
Task Received
User request, email, or automated trigger
Perceive
ObservationBuilder
Immutable snapshot — attachments, memory, task context, spec health
Classify
TaskTypeClassifier
LLM + context → TaskType + confidence score
Plan
PlanGenerator
SOP template + LLM fill → PlanSnapshot with versioning & dependency tracking
Execute Loop — per plan step
PolicyAwareReasoner
Score candidate decisions per phase — heuristic shortcuts for deterministic steps, LLM reasoning for ambiguous ones
ToolCall
PolicyEngine → execute
RequestApproval
HIGH risk → gate
Reflect
Evaluate progress
Replan
Generate new plan
HumanTask
Delegate to human
Finish
Report via LLM
Report
LLM-Generated Summary
Structured output with execution trace and artifacts
Memory
Save to Long-Term Memory
Generate embeddings → store in pgvector for semantic search
Complete— publish event, notify requester

Outcome & Impact

Full-stack platform shipped to production End-to-end from agent architecture to Kubernetes deployment — 45+ API routes, 58 services, 91+ frontend components, 45+ database models, all running in production on K3s.

AP Pilot ready for clinic onboarding Two-campaign architecture (acquisition + reminders) with dual entry paths, compliance guardrails (TCPA/HIPAA), and automated appointment scheduling via nanosites.

Autonomous agent executing healthcare SOPs Agent classifies tasks, generates plans, executes tools with policy enforcement, and maintains long-term memory — with full audit trail for healthcare compliance.

Wore every hat Designed the agent architecture, built frontend views, contributed to backend services, created the marketing site and all email templates, and deployed infrastructure — cofounder doing whatever it takes to ship.