Diagram
Draw.io source:documentations/architecture/JobSim_Simple_Diagrams.drawio
Runtime Contract
| Step | Owner | Source |
|---|---|---|
| Message validation, persistence, unread counts, WebSocket broadcast, and async work scheduling | create_message_from_request | src/core/messages/message_create_service.py |
| Background branch for new messages vs thread replies | run_agent_processing | src/core/messages/message_background.py |
| Session logging, sender checks, storyline updates, dynamic service invocation, response delivery | AgentMessageMonitor | src/core/agents/agent_monitor.py |
| DB-driven character loading, tool assembly, Mongo memory, optional mem0 memory | DynamicAgentFactory | src/core/autogen/dynamic_agent_factory.py |
| Structured agent selection, DM policy, channel membership checks, pressure-aware routing | DynamicAgentRouter | src/core/autogen/dynamic_agent_router.py |
| Persona prompt, context blocks, tool loop, memory lookup, response text | DynamicNPCAgent | src/core/autogen/dynamic_npc_agent.py |
| Multi-responder follow-up burst | SelectorGroupChat | src/core/autogen/selector_group_chat.py |
| Agent-to-agent DM loop controls and audit stop reasons | InterAgentCommunicator | src/core/autogen/inter_agent_comm.py |
Key Behaviors
- Agents are DB-driven.
simulation_characterssupplies persona, role, channels, mention patterns, relationships, and storyline context. - Routing combines structured LLM selection with deterministic fallbacks, channel membership checks, DM routing policy, sensitive-topic policy, and workplace pressure signals.
- Prompt context merges conversation history, storyline state, relationship state, consequences, meetings, approvals, working memory, org policy, and optional cross-context snippets.
- Tool access is deterministic: common tools, task tools, and inter-agent tools are de-duplicated by tool name before agent creation.
- Selector bursts run when public routing selected multiple responders. Follow-up budget and repeat-speaker behavior come from orchestration policy and realism profile.
- Observability writes into
autogen-logs,simulation_audit_events, andai_usage_events; Mongo core indexes add TTL for agent logs and audit events.