Code layout
| Area | Location | Purpose |
|---|---|---|
| Application entry | src/main.py | Builds the FastAPI app, browser cross-origin policy, exception handling, router includes. |
| HTTP routes | src/apis/ | Domain routers: auth, users, messages, tasks, simulation_admin, organizations, and others. |
| Domain logic | src/core/ | Scheduler, AutoGen, simulation behavior, and related services. |
| Persistence | src/memory/ | MongoDB access, repositories, Qdrant, mem0. |
Conventions
- Dependencies — Use FastAPI
Dependsfor database handles and auth; mirror patterns from neighboring routes when adding endpoints. - Data access — Prefer repository helpers in
src/memory/repositories.pyand related classes over ad hoc queries in routers. - Models — Shared Pydantic models live in
src/common/models.py; feature-specific models may live beside their module.
Background work
Scheduled and periodic tasks use the async scheduler, heartbeat modules, or related wiring (src/heartbeat/, src/core/scheduler.py). When you introduce new jobs, document trigger, idempotency, and what happens on failure.
Next
- FastAPI services and routers — Domain map and OpenAPI notes.
- Quick Help calling — Voice session lifecycle, auth checks, and endpoint contracts.
- AI usage and cost tracking — Events, pricing, collections, and admin reporting endpoints.
- Database — Collections and modeling conventions.