BossPaws AI Engine
A 2,055-line multi-model orchestrator.
The BossPaws AI Engine is the central nervous system of the AI layer — a
2,055-line orchestrator that routes every request to the right model based on input type.
Text conversations are reasoned over by Claude Sonnet.
Videos pass through Gemini Flash for exhaustive observation before Sonnet writes the clinical assessment. Photos are
classified and analyzed directly by Sonnet Vision. PDFs are rendered to images by CloudConvert,
then read by Sonnet Vision. Background memory and curation runs on Claude Haiku.
Why it matters: Before a single token is generated, the engine performs
parallel fetches — BossRadar health context, curated memory profile, and owner
name — so every response is contextually aware of the pet’s breed, age,
weight, conditions, medications, allergies and personality. Emergency detection scans
every response for critical keywords (bleeding, unconscious, difficulty breathing) and
triggers a 3-tier severity alert. Response length adapts dynamically: longer for health
queries, tighter for casual conversation.
Dynamic Prompt System
Seven intelligence layers assembled per response.
Every AI request is built fresh by the Dynamic Prompt System using seven layers assembled
in strict order: (1) Identity Core — personality, expertise
boundaries, species knowledge; (2) Response Intelligence —
diagnostic logic, accuracy guardrails, anti-repetition; (3) Emergency
Protocol — three severity tiers with context-aware detection;
(4) Engagement Rules — follow-up question generation, tone
control, product recommendations; (5) Conversation Protocol —
greeting behavior, memory usage rules ("use silently, never announce");
(6) Pet Context — name, species, breed, age, weight, sex,
location, seasonal awareness; (7) Memory Context — top memories
by importance, silently integrated.
Why it matters: Static prompts waste tokens on irrelevant context and
miss the slices that matter for the current question. The system detects query type
(health vs casual via 30+ medical keywords), adjusts the token budget accordingly, and
ensures every user gets the right context at the right cost — scaling model
quality without scaling cost linearly.
BossRadar Context Engine
Priority-scored real-time health injection — allergies pinned first for safety.
BossRadar is the in-house context engine that surgically injects each pet’s medical
reality into every Claude prompt. Every item on the pet’s record is priority-scored: chronic conditions
score 100 (always injected), diagnosed conditions 50, new concerns 25, behavior items
10 — with modifiers for severity (+5), recency (+3 if under 30 days), and
medication association (+2). The output is constrained to a strict 320–670 token
budget per request, with guaranteed inclusion of ALL chronic conditions, backfill to
six ongoing items, the three most recent resolved items, ALL active medications and
ALL allergies.
Why it matters: Allergies are injected first — a
deliberate safety design using the primacy effect so the AI reads allergy data before
anything else, even under tight budgets. Generic AI hallucinates because it has no idea
which animal you’re talking about. BossRadar gives Claude the exact medical
context for this pet at this moment, before a single token of the
response is generated.
Memory Architecture
Three-phase learning system — extraction, curation, and a living profile that evolves with every conversation.
Phase 1 — Extraction. At messages 5, 10, 15 and 19 of every
conversation, Claude Sonnet extracts up to five owner-stated facts categorized across eight memory categories
(training, behavior, nutrition, environment, social, exercise, bonding, health history).
Message 10 runs a dual-duty call — extracting memories AND generating a 200–300
word conversation summary. The AI can emit memory flags to correct contradictions via
fuzzy-match handling; importance decays automatically for low-value facts.
Phase 2 — Curation. A five-task pipeline powered by Claude Haiku runs three times a week on Vercel Cron:
health keyword purge → importance decay → health history summary →
merge & deduplication → curated profile generation. Phase 3 — Profile. The output is a single curated profile document
covering personality, daily life, nutrition, training, social, exercise, owner bond and
health history — sized at 400 tokens on Boss Pro and 600 tokens on Boss Super,
injected silently as context into every future conversation. The AI uses this knowledge
without ever announcing “I remember.”
Why it matters: Most chatbots have zero memory between sessions. BossPaws
AI extracts, compacts, merges and curates long-term memory into a living profile that
evolves with every conversation — so the AI gets smarter about your pet
the longer you use it.
Video Analysis
The crown jewel — 30 seconds of video, dual-pipeline veterinary observation.
No pet health app in the world analyzes video. BossPaws uses a dual-pipeline
architecture: Google Gemini Flash produces an exhaustive veterinary observation report covering animal identification,
body condition (coat, skin, eyes, ears, nose), movement and gait (limping, balance,
coordination), breathing (rate, effort, chest rise and fall), posture (stance,
weight-bearing, body tension), behavior (alertness, pain indicators, energy) and
environment (context, hazards). Gemini’s instruction is explicit:
“Be exhaustive — describe everything you observe, never diagnose.” Then Claude Sonnet generates a clinical-grade assessment adapted by purpose — health-focused,
training-focused, behavior-focused, or appearance-focused.
Why it matters: Thirty seconds of your pet walking, playing, or breathing
gives the AI clinical-grade observations that would normally require a vet visit. The
Gemini observation is cached in the database — reusable for multiple analyses
without re-processing. Cost-optimized: Gemini handles heavy multimodal lifting, Sonnet
handles clinical reasoning. Limits: 30 seconds maximum, 50 MB maximum, Boss Pro
6/week, Boss Super 12/week.
Multimodal Document Intelligence
Photos, PDFs, vet records, lab panels — analyzed with full health context. No Gemini — Sonnet Vision throughout.
Pet owners upload everything: phone photos of paper lab results, blurry medication
labels, scanned x-rays, prescription PDFs, vet discharge instructions. Multimodal
Document Intelligence splits into two clean paths, neither of which involves Gemini. Images: Claude Sonnet Vision first classifies each upload into one of four content types — pet photo,
vet document, medical image, or non-pet — with confidence scoring that rejects
non-pet content and low-confidence detections. Type-specific analysis follows: body
condition for pet photos, lab value interpretation for vet documents, severity
assessment for medical images. PDFs: CloudConvert (Poppler engine) renders up to six pages into 1024×1024 pixel JPEGs at 300 DPI;
Sonnet Vision then reads all pages together, maintaining context across the full document.
Text documents are processed directly (UTF-8, UTF-16, Latin-1).
Why it matters: Every analysis receives the pet’s full profile
plus BossRadar health context — conditions, medications, allergies. Upload a blood
panel and the AI reads it, flags abnormals, compares to your pet’s known health
baseline, and suggests questions for your vet — all while knowing the pet’s
breed, age, medications and allergies. Critical lab values trigger emergency alerts
automatically.
Six additional proprietary systems run in production on every BossPaws account. Each handles a
distinct surface of the pet-health lifecycle — from weekly insight generation to long-horizon
life tracking:
Weekly AI Insights
A 4-engine proactive system — Health Insight, Popular Topics, Breed Intelligence, and Weight Monitoring — that generates personalized weekly intelligence per pet. Temporally weighted toward recent memories (60% / 25% / 15%), cached for 7 days, deduplicated week-to-week.
Weight Intelligence
AI-powered dynamic weight lookup instead of hardcoded tables. Claude Sonnet determines the healthy weight range for any of the 319 supported breeds at any age on demand, returning min/max/confidence. Seven-day cache, graceful fallback for mixed breeds.
PawAlert Intelligence Engine
A full scheduling engine — 10 alert categories, 17 pre-built templates, a conflict-detection engine that auto-resolves overlaps, and native alarm integration (Android AlarmManager foreground service + iOS Time Sensitive). Free for all users. Pure business logic — runs offline, no AI dependency.
FileDesk
Secure document vault for pet health records — JPEG, PNG, HEIC, WebP, MP4, WebM, MOV, PDFs, text. Stored in Supabase with Row-Level Security. Every file can be re-analyzed in full pet context, and video observations are cached for reuse.
PetLife Dashboard
Interactive visual pet character driven by 4 core stats (Happiness, Appetite, Health, Energy on a 1–5 scale). A weighted overall score (Health 30%, others 20% each) auto-recalculates on any stat change. Species-specific UI for dogs vs cats, plus a Recharts weight chart with an AI-determined breed range overlay.
FlexPilot Points & Badges
Five-tier gamification: Certified (50 BP) → Advanced (500) → Premier (1,500) → Elite (3,000) → Legend (5,000). Species-specific badge artwork, streak multipliers (3-day = 1.3x, 7-day = 1.7x), server-controlled point values, immutable audit trail, shareable badges exportable to social. No AI — pure engagement design.