The First Match

Inspiration

Every year, over 400,000 children sit in the U.S. foster care system — and nearly 50% of placements disrupt. Caseworkers juggling 20+ cases rely on gut instinct and spreadsheets to make life-altering matches.

Nikhil has extensive experience in developmental therapy through his startup SportsMind, working intensively with high-performing athletes on psychological resilience. Julio has worked in Ed and now EdTech, specifically with students from marginalized contexts. In a conversation about one of Julio's previous students, the foster care system came up — how flawed the matching process is. Julio saw firsthand the severity that a familial mismatch could lead to: behavioral regression, broken trust, and a child who becomes harder to place with every failed attempt. They decided to build the solution themselves.

What It Does

Sunny, the AI Counselor — Children talk to a warm, live video avatar (HeyGen + Claude) instead of filling out clinical forms. Sunny adapts to the child's age, extracts 30+ psychosocial dimensions and 6 safety flags from a natural 5-minute conversation. No clipboards.

Family Profiling — Families complete guided onboarding capturing parenting style, emotional capacity, trauma training, cultural practices, and environment details.

Caseworker Note Intelligence — Caseworkers paste free-text notes; Claude extracts structured clinical metrics and cross-references them with the AI counselor's findings.

7-Layer Matching — Every child-family pair runs through a 1,142-line matching engine:

$$\text{MatchScore} = \sum_{i=1}^{7} w_i \cdot L_i(\text{child}, \text{family}, \text{context})$$

L1: Profile Normalization L2: Hard Constraints L3: 7 Weighted Dimensions (Personality, Emotional, Attachment, Cultural, Communication, Environment, Stability) L4: Cross-Dimensional Synergy L5: Contextual Reasoning (dual-source: AI transcripts + caseworker notes) L6: Bias Audit & Fairness L7: Stability Prediction & Risk Classification

Vector pre-filtering uses pgvector with custom 25-dimensional embeddings (cosine similarity) to narrow candidates before full reasoning.

How We Built It

  • Frontend: Flutter web, Provider state management, 10 screens
  • AI Counselor: Claude Sonnet 4.5 (7 conversation phases) + HeyGen Streaming Avatar (LiveKit/WebRTC) + speech-to-text/TTS with auto-listen
  • Backend: Supabase — PostgreSQL + pgvector, 6 tables, 3 Edge Functions (Deno)
  • Matching: 7-layer engine running server-side via Edge Function, local Dart fallback
  • Embeddings: 25-dim vectors encoding energy, attachment, trust, culture, environment, and 20 other factors

Challenges We Ran Into

  • Ordering problem: Transcripts saved before the child existed in DB, violating FK constraints. Had to restructure the entire UUID/save flow.
  • Client vs. server matching: Built the engine client-side first, then migrated to Edge Functions for database access while keeping local fallback.
  • Avatar + speech coordination: HeyGen video, STT, and TTS had to not step on each other — solved with state guards and auto-listen callbacks.
  • Trauma-informed prompting: 300+ line system prompt to make Claude genuinely warm with a 5-year-old while extracting clinical-grade metrics.
  • Algorithmic bias: Built Layer 6 specifically to correct for systematic biases against older children, cross-cultural matches, and special needs.

Accomplishments We're Proud Of

  • Sunny feels real — kids don't know they're being assessed
  • Every match has a full transparent audit trail — no black boxes
  • Dual-source validation between AI counselor and caseworker notes
  • Custom 25-dimensional embedding space purpose-built for adoption matching
  • 6 real-time safety flags monitored during every conversation

What We Learned

  • The foster care matching problem isn't lack of caring — it's lack of tools
  • Children reveal far more in natural conversation than in checkbox forms
  • Bias correction is core infrastructure, not a nice-to-have — it's literally Layer 6
  • LLMs can be trauma-informed with the right prompting architecture

What's Next for The First Match

  • Longitudinal outcome tracking to improve matching with real-world feedback
  • Multi-language support for Sunny
  • Agency partnerships to pilot against expert caseworker decisions
  • Mobile app for tablets in caseworker offices and group homes
  • Sibling group optimization — keeping siblings together

Built With

Share this project:

Updates