| Layer | Role |
|---|---|
| Web client | Next.js 14 app in frontend/ for learners and administrators. |
| API | FastAPI app (src/main.py): REST and WebSockets under /api/v1. |
| Agents | AutoGen-style agents and orchestration in src/core/autogen/. |
| Data | MongoDB for primary state; Qdrant for vectors; optional mem0 integration where configured. |
Multi-tenant model
Each organization has isolated data and simulation settings. Authentication and route dependencies attach organization context to requests. Administrative capabilities are split between organization admins (one tenant) and platform (super) admins (cross-org), as implemented per route.End-to-end request flow (simplified)
- A browser or API client calls FastAPI with valid authenticated credentials.
- Routers authenticate the caller and resolve
organization_idwhen the route requires it. - Services and repositories read or write data: messages, tasks, simulation settings, and related state.
- Agents run on user-driven actions or background work (scheduler, heartbeat, channel chatter), depending on the feature.
Role boundaries
| Role | Access pattern |
|---|---|
| Learner | Data and actions scoped to their organization only. |
| Org admin | Configuration for one organization (settings, policies, and product-exposed assets such as characters). |
| Super admin | Cross-org operations where the API allows (support, health, restricted fixes). |
Related
- Roles and product surfaces — Who uses chat vs admin dashboard and how APIs gate access
- Frontend surface ownership map — Canonical ownership for admin/org-admin/user routes and component lanes
- System design — Deeper flow from UI to agents and storage
- Memory overview — How MongoDB, Qdrant, and mem0 divide responsibility