01 · Product shape
Five phases, one growing avatar
Beeing Human is an AI-avatar coaching platform. Each user gets two avatars — Avatar 2 (a likeness of themselves) and Avatar 1, a "brain" that grows and accumulates memory as the user moves through a structured journey of 4 stages · 12 modules · 3 lessons each. The MVP proves the first two phases end-to-end.
Onboarding
Sign-up, plan/billing, avatar creation, assessments, growth plan, consents, uploads.
Orientation
Avatar-taught intro modules on stage, in-video Q&A, camera opt-in, chat rooms unlock.
Learning
Module videos, synthesis, avatar memory updates, engagement signals, pocket guide.
Interpreting
Skit sessions, micro-expression reading, peer grading, self-reporting.
Applying
Real-life use-cases, improv rooms, flag clearing, growth-plan-driven practice.
02 · Tech workflow
The two MVP flows, step by step
These are the user-facing sequences the MVP must support, annotated with the system responsibilities each step triggers. This is the spine the API contract and screens are built from.
Onboarding
- Sign upEmail or social · first/last name · phone. Auth via Cognito, JWT issued.
- Plan selection1 month free trial → $29.99/mo. Stripe customer + subscription created.
- B2B branchBusinesses / universities → org account + seat (stub in MVP, model now).
- ConsentsHIPAA / data-processing / camera consent captured & versioned before any PHI.
- Avatar creationCartoon avatar ("second life") → Avatar 2. Avatar 1 record initialized.
- AssessmentsSkill assessment (values, strengths, goals/obstacles); questions served by platform.
- Growth planValues & strengths + short/long-term goals populated, user reviews & edits.
- UploadsResume / PDF / linked accounts + self video/audio → S3 (KMS-encrypted).
- Privacy portalSettings to view, update, and delete everything (right to erasure).
Orientation
- Start orientationEntry screen; gates Learning until orientation is complete.
- Stage introTwo avatars "act out" what the product does — pre-recorded video track.
- Interactive modulesProduct overview, the 12-module map, relapse process, guidelines & principles.
- In-video Q&AType or talk questions any time; answered by LLM grounded in module content.
- Camera opt-inConsented webcam enables on-device emotion/face signals through the phase.
- Chat rooms unlockModule-based AI-coach room; live user rooms open as modules complete.
- CompletionProgress recorded → Learning phase unlocked. Avatar 1 memory seeded.
03 · Architecture
Target system architecture
A service-oriented backend on AWS, HIPAA-eligible services throughout, with a media/AI edge for avatar delivery and an AvatarProvider abstraction so the pre-recorded and future real-time engines are interchangeable.
flowchart TB
subgraph Clients
M["Flutter Mobile<br/>iOS · Android"]
W["Flutter Web<br/>user app"]
A["Next.js<br/>Admin Panel"]
end
subgraph Edge["AWS Edge"]
CF["CloudFront CDN"]
GW["API Gateway / ALB"]
COG["Cognito<br/>auth + BAA"]
end
subgraph Svc["FastAPI services · ECS Fargate (VPC)"]
ID["Identity and Billing"]
ON["Onboarding and Assessments"]
OR["Orientation and Progress"]
CH["Chat and Rooms"]
AV["Avatar / Memory"]
end
subgraph AI["AI and Media"]
BR["Bedrock<br/>Claude — chat/synthesis"]
AVP["AvatarProvider<br/>pre-rec then real-time"]
HG["HeyGen / D-ID<br/>video gen"]
SP["Transcribe / Polly"]
end
subgraph Data
PG[("RDS PostgreSQL<br/>+ pgvector")]
RD[("ElastiCache Redis")]
S3[("S3 + KMS<br/>media · PHI")]
Q["SQS · async jobs"]
end
ST["Stripe"]
M --> CF --> GW
W --> CF
A --> GW
M -.auth.-> COG
GW --> ID & ON & OR & CH & AV
ID --> ST
ON --> S3
CH --> BR
AV --> BR
AVP --> HG
OR --> AVP
CH --> SP
ID & ON & OR & CH & AV --> PG
CH --> RD
ON --> Q --> S3
AV --> PG
Emotion / micro-expression detection runs on-device (Flutter + MediaPipe / ML Kit) — only derived signals, never raw video, reach the backend, minimizing PHI transfer.
Why these edges
- On-device emotion detection keeps biometric video off our servers — smaller compliance surface and lower latency than Rekognition round-trips.
- Bedrock (Claude) for chat, in-video Q&A, and post-module synthesis — HIPAA-eligible under AWS BAA, no data leaves the account boundary.
- AvatarProvider interface — PrerecordedVideoProvider ships now; RealtimeProvider (Unreal/RPM stream) slots in for P3/P4 live phases with no caller changes.
- Async job queue (SQS) handles video/audio transcode, resume parsing, and avatar-video generation off the request path.
04 · Data model
Database schema
PostgreSQL is the system of record. The "growing avatar" is modeled as avatar_memory nodes with pgvector embeddings, so knowledge, questions, and confidence signals accrue over time and are queryable semantically. Entities below the fold are modeled now but built in later phases.
erDiagram
ORGANIZATION ||--o{ USER : "employs / enrolls"
USER ||--|| PROFILE : has
USER ||--o{ CONSENT : grants
USER ||--o| SUBSCRIPTION : holds
PLAN ||--o{ SUBSCRIPTION : defines
USER ||--o{ AVATAR : owns
USER ||--o{ ASSESSMENT : completes
ASSESSMENT ||--o{ ASSESSMENT_RESPONSE : contains
USER ||--o{ GROWTH_PLAN : has
GROWTH_PLAN ||--o{ GROWTH_PLAN_ITEM : contains
USER ||--o{ UPLOAD : submits
AVATAR ||--o{ AVATAR_MEMORY : accrues
PHASE ||--o{ MODULE : groups
MODULE ||--o{ LESSON : contains
USER ||--o{ ENROLLMENT : has
ENROLLMENT ||--o{ MODULE_PROGRESS : tracks
USER ||--o{ CHAT_MESSAGE : sends
CHAT_ROOM ||--o{ CHAT_MESSAGE : holds
USER ||--o{ FLAG : raises
USER ||--o{ AUDIT_LOG : generates
USER {
uuid id PK
uuid org_id FK
string cognito_sub
string email
string phone
string status
}
AVATAR {
uuid id PK
uuid user_id FK
enum kind "self | growing"
jsonb appearance
int growth_level
}
AVATAR_MEMORY {
uuid id PK
uuid avatar_id FK
enum kind "knowledge|gap|question|confidence"
text content
vector embedding
uuid source_module_id
}
GROWTH_PLAN_ITEM {
uuid id PK
uuid plan_id FK
enum type "value|strength|short_goal|long_goal"
text content
}
MODULE_PROGRESS {
uuid id PK
uuid enrollment_id FK
uuid module_id FK
enum state
jsonb engagement_signals
}
Entity inventory
| Domain | Tables | MVP |
|---|---|---|
| Identity | organizations · users · profiles · consents | Yes |
| Billing | plans · subscriptions · invoices (Stripe-mirrored) | Yes |
| Avatar | avatars · avatar_memory (pgvector) | Yes |
| Assessment | assessments · assessment_responses · growth_plans · growth_plan_items | Yes |
| Content | phases · modules · lessons · enrollments · module_progress | Orientation only |
| Media | uploads · session_recordings · avatar_video_assets | Uploads only |
| Social | chat_rooms · chat_messages · room_memberships | AI-coach room |
| Signals | engagement_signals · flags · pocket_guides | Modeled, later |
| Compliance | audit_logs · data_erasure_requests | Yes |
05 · Stack
Technology stack
Chosen for a small team moving fast to MVP, with every third-party under an AWS-signable BAA or kept clear of PHI. Shared type discipline via OpenAPI-generated clients into Flutter and the admin panel.
| Layer | Choice | Notes |
|---|---|---|
| Mobile | Flutter (Dart) | Single codebase iOS + Android; strong video/animation for avatar stage. |
| Web app | Flutter Web | Reuse mobile codebase for the logged-in user app. (Next.js is the fallback if SEO/marketing site is needed.) |
| Admin panel | Next.js + React (Refine) | Richer admin ecosystem — content/module management, user support, audit review. |
| Backend | FastAPI (Python 3.12) | Async, Pydantic v2, auto OpenAPI; best fit for the AI/ML pipeline. |
| Compute | ECS Fargate | Serverless containers, no cluster ops; scale per service. |
| Database | RDS PostgreSQL 16 + pgvector | Relational core + avatar-memory embeddings in one store. |
| Cache / Queue | ElastiCache Redis · SQS | Sessions, rate limits, chat presence; async media jobs. |
| Storage / CDN | S3 + KMS · CloudFront | Encrypted PHI/media; signed URLs; CDN for avatar video. |
| Auth | Amazon Cognito | Email + social; HIPAA-eligible; JWT to services. |
| LLM | Bedrock — Claude | In-video Q&A, synthesis, memory updates; inside the account boundary. |
| Avatar video | HeyGen / D-ID | Behind AvatarProvider; keep PHI out of prompts (verify BAA before any). |
| Emotion | MediaPipe / ML Kit (on-device) | Derived signals only leave the device. |
| Speech | Transcribe · Polly | Voice Q&A in / avatar TTS out. |
| Payments | Stripe | Trials, subscriptions, B2B seat billing. |
| IaC / CI | Terraform · GitHub Actions | Reproducible envs; per-service pipelines. |
| Observability | CloudWatch · Sentry | Metrics/logs/traces + app error tracking. |
06 · Compliance & risk
Flags to resolve before build
The boards mention "EHR certified", "HIPAA", "relapse process", universities, and webcam emotion reading. Each carries regulatory weight that must be pinned down in this sprint — they change hosting, vendor, and consent decisions.
"Relapse process" → substance-use records (42 CFR Part 2)
If Beeing Human handles addiction/recovery data, US 42 CFR Part 2 applies — stricter than HIPAA, with tight redisclosure limits. Must confirm the clinical scope before designing data flows and consents.
Vendor BAAs for any PHI path
No PHI may reach Stripe metadata, HeyGen/D-ID prompts, or any subprocessor without a signed BAA. Confirm AWS BAA scope and treat avatar-gen/analytics vendors as PHI-free by design.
Universities → FERPA (& possibly minors)
The B2B "universities" path can bring FERPA education-record obligations and, if any users are under 18, COPPA. Needs multi-tenant data isolation and per-org data agreements.
Biometric emotion reading → BIPA & consent
Webcam micro-expression/face analysis is biometric processing. Illinois BIPA and similar laws require explicit, specific consent. On-device processing + granular opt-in mitigates, but consent copy and retention policy must be reviewed.
What does "EHR certified" actually mean?
"EHR certified for potential audits" is ambiguous — clinical EHR certification (ONC) is a very different bar from "audit-ready wellness data." This single answer reshapes the compliance program.
07 · Plan of action
The requirements sprint — this week
Five days to turn the boards into a build-ready foundation. Each day has a clear output; the week ends with a prioritized, estimated backlog and a green-lit architecture.
Discovery workshop
Confirm personas, B2C-vs-B2B priority, phase scope, and success metrics for the thin slice. Walk every board with stakeholders.
Output: signed-off PRD skeleton + scope boundary.
Compliance deep-dive
Resolve the six risk flags with legal/clinical input. Define PHI inventory, consent matrix, retention & erasure rules, required BAAs.
Output: compliance checklist + data-classification map.
AI & avatar spike
POC: Bedrock/Claude Q&A grounding, HeyGen/D-ID pre-recorded pipeline + BAA check, on-device MediaPipe emotion feasibility.
Output: vendor decision + AvatarProvider interface spec.
Model & contract
Finalize the ERD, draft the OpenAPI contract for Onboarding + Orientation, and define non-functional requirements (latency, scale, uptime).
Output: ERD + OpenAPI v0 + NFR doc.
Architecture review & backlog
Threat-model the design, validate the diagram, break epics into stories, estimate, and sequence Sprint 0 (repos, IaC, CI/CD, skeletons).
Output: approved architecture + estimated backlog.
Sprint deliverables
Then — Sprint 0 (setup, week 2)
- Monorepo scaffold: /mobile (Flutter) · /admin (Next.js) · /api (FastAPI) · /infra (Terraform).
- AWS landing zone: VPC, KMS, RDS, Cognito, ECS, S3 buckets — encrypted, private-subnet, tagged.
- CI/CD pipelines + preview environments; OpenAPI client codegen into Flutter & admin.
- Auth + billing walking skeleton: sign-up → trial → authenticated "hello avatar" screen.