How 100-hours-a-week/ktb4-17th-ai works
This is a FastAPI AI API for a dating application. Its central user journey is persona onboarding: interview a user, extract and confirm a profile, then use confirmed personas in simulations or streaming practice conversations. Separate profile-trust endpoints inspect primary photos and verify a live face against one. The graph preserves documented capabilities and substantial indexed modules; many feature implementations were not sampled, so their internal links are omitted unless the README, entry point, or source index supports them.
Main entry points: main.py FastAPI application · persona/service.py Onboarding workflow · face_verification/service.py Face verification · simulation/service.py Simulation workflow
Components 34
API and orchestration
- FastAPI application
app/main.py
Persona lifecycle
- Persona API
app/features/persona/api.py - Onboarding workflow
app/features/persona/service.py - Persona domain
app/features/persona/schemas.py - Persona agents
app/features/persona/agents.py - Persona repository
app/features/persona/repository.py - Extraction API
app/features/persona_extraction/api.py - Style extraction
app/features/persona_extraction/service.py - Style agent
app/features/persona_extraction/agents.py
AI conversations
- Simulation API
app/features/simulation/api.py - Simulation workflow
app/features/simulation/service.py - Simulation agent
app/features/simulation/agents.py - Matching report
app/features/simulation/report.py - Migration API
app/features/simulation_migration/api.py - Run manager
app/features/simulation_migration/manager.py - Run graph
app/features/simulation_migration/graph.py - Run repository
app/features/simulation_migration/repository.py - Practice API
app/features/practice/api.py - Practice workflow
app/features/practice/service.py - Practice agent
app/features/practice/agents.py - Chat ending
app/features/chat_end/service.py - Ending agent
app/features/chat_end/agents.py
Profile trust
- Photo check API
app/features/primary_photo/api.py - Frontal photo check
app/features/primary_photo/service.py - Photo analyzer
app/features/primary_photo/analyzer.py - Synthetic check API
app/features/synthetic_detection/api.py - Synthetic detection
app/features/synthetic_detection/service.py - Face verification API
app/features/face_verification/api.py - Face verification
app/features/face_verification/service.py - Liveness detection
app/features/face_verification/liveness.py - Face matcher
app/features/face_verification/matcher.py
Shared platform
- Media handling
app/core/media.py - Guardrail engine
app/core/guardrail/engine.py
Other components
- API client
Connections 34
- API client → FastAPI application: sends requests
README.md - FastAPI application → Persona API: routes to
app/main.py - FastAPI application → Extraction API: routes to
app/main.py - FastAPI application → Simulation API: routes to
app/main.py - FastAPI application → Migration API: routes to
app/main.py - FastAPI application → Practice API: routes to
app/main.py - FastAPI application → Photo check API: routes to
app/main.py - FastAPI application → Synthetic check API: routes to
app/main.py - FastAPI application → Face verification API: routes to
app/main.py - Persona API → Onboarding workflow: handles onboarding
- Onboarding workflow → Persona agents: generates prompts
app/features/persona/service.py - Onboarding workflow → Persona repository: persists profiles
app/features/persona/service.py - Onboarding workflow → Persona domain: uses definitions
app/features/persona/service.py - Extraction API → Style extraction: starts jobs
- Style extraction → Style agent: extracts style
app/features/persona_extraction/service.py - Simulation API → Simulation workflow: starts simulation
README.md - Simulation workflow → Simulation agent: generates dialogue
app/features/simulation/service.py - Simulation workflow → Matching report: builds report
app/features/simulation/service.py - Migration API → Run manager: manages runs
- Run manager → Run graph: executes graph
app/features/simulation_migration/manager.py - Run manager → Run repository: persists run state
app/features/simulation_migration/manager.py - Practice API → Practice workflow: handles sessions
README.md - Practice workflow → Practice agent: generates replies
app/features/practice/service.py - Practice workflow → Guardrail engine: checks responses
app/features/practice/service.py - Chat ending → Ending agent: generates endings
app/features/chat_end/service.py - Photo check API → Frontal photo check: checks photos
README.md - Frontal photo check → Photo analyzer: analyzes image
app/features/primary_photo/service.py - Synthetic check API → Synthetic detection: checks authenticity
README.md - Face verification API → Face verification: verifies identity
README.md - Face verification → Liveness detection: checks liveness
app/features/face_verification/service.py - Face verification → Face matcher: compares faces
app/features/face_verification/service.py - Frontal photo check → Media handling: decodes uploads
app/features/primary_photo/service.py - Face verification → Media handling: reads media
app/features/face_verification/service.py - Synthetic detection → Media handling: reads uploads
app/features/synthetic_detection/service.py