How ianloe/ai-office works
TS-Office is a multi-agent AI back office. An office manager or incoming enquiry initiates work; the Orchestrator routes tasks through the Redis Streams runtime to specialist agents, which prepare business outputs and, where needed, request human approval before external actions through the MCP gateway. The distinct stages include enquiry handling, scheduling, CRM, finance, proposals, training operations, content, research, governance, and knowledge administration. Shared runtime services provide LLM access, budgets, quarantine, and audit. README statements describe several capabilities not verifiable in sampled agent implementations, so those branches are represented without speculative internal links.
Main entry points: base_agent.py Agent execution · mcp_gateway/app.py MCP tool gateway · approval_gateway/app.py Approval gateway · audit.py Immutable audit log
Components 29
Business agents
- Enquiry handling
agents/enquiry/agent.py - Task orchestration
agents/orchestrator/agent.py - Scheduling
agents/scheduler/agent.py - CRM management
agents/crm/agent.py - Finance operations
agents/finance/agent.py - Proposals and contracts
agents/proposals/agent.py - Training operations
agents/training_ops/agent.py - Content marketing
agents/content/agent.py - Research intelligence
agents/research/agent.py - Governance audit
agents/governance/agent.py - Knowledge administration
agents/knowledge/agent.py
Agent runtime
- Agent worker
agents/runner.py - Agent execution
libs/ts_agent_core/base_agent.py - Signed task bus
libs/ts_agent_core/bus.py - LLM client
libs/ts_agent_core/llm.py - Agent configuration
libs/ts_agent_core/config.py - Budget controls
libs/ts_agent_core/budgets.py - Input quarantine
libs/ts_agent_core/quarantine.py - Shared task models
libs/ts_agent_core/models.py - Structured logging
libs/ts_agent_core/logging.py - HTTP hardening
libs/ts_agent_core/http_hardening.py
Human and tool gateways
- MCP tool gateway
services/mcp_gateway/app.py - External connectors
services/mcp_gateway/connectors.py - Email integration
services/mcp_gateway/email_imap_smtp.py - Action tokens
services/mcp_gateway/tokens.py - Approval gateway
services/approval_gateway/app.py - Dashboard admin
services/dashboard/admin.py
Governance and records
- Immutable audit log
libs/ts_agent_core/audit.py
Other components
- Office manager
Connections 32
- Office manager → Enquiry handling: submits enquiry
README.md - Office manager → Task orchestration: assigns work
README.md - Task orchestration → Signed task bus: routes tasks
agents/orchestrator/main.py - Agent worker → Signed task bus: consumes tasks
agents/runner.py - Agent worker → Agent execution: runs agent
agents/runner.py - Enquiry handling → Agent execution: extends runtime
agents/enquiry/agent.py - Scheduling → Agent execution: extends runtime
agents/scheduler/agent.py - CRM management → Agent execution: extends runtime
agents/crm/agent.py - Finance operations → Agent execution: extends runtime
agents/finance/agent.py - Proposals and contracts → Agent execution: extends runtime
agents/proposals/agent.py - Training operations → Agent execution: extends runtime
agents/training_ops/agent.py - Content marketing → Agent execution: extends runtime
- Research intelligence → Agent execution: extends runtime
agents/research/agent.py - Governance audit → Agent execution: extends runtime
agents/governance/agent.py - Knowledge administration → Agent execution: extends runtime
agents/knowledge/agent.py - Agent execution → LLM client: requests completion
libs/ts_agent_core/base_agent.py - Agent execution → MCP tool gateway: calls tools
libs/ts_agent_core/base_agent.py - Agent execution → Approval gateway: requests approval
libs/ts_agent_core/base_agent.py - Agent execution → Immutable audit log: records events
libs/ts_agent_core/base_agent.py - Agent execution → Budget controls: checks limits
libs/ts_agent_core/base_agent.py - Agent execution → Shared task models: uses task models
libs/ts_agent_core/base_agent.py - Enquiry handling → Input quarantine: sanitizes input
agents/enquiry/agent.py - Research intelligence → Input quarantine: sanitizes input
agents/research/agent.py - MCP tool gateway → Action tokens: validates tokens
services/mcp_gateway/app.py - MCP tool gateway → External connectors: dispatches tools
services/mcp_gateway/app.py - MCP tool gateway → Email integration: dispatches email
services/mcp_gateway/app.py - Approval gateway → Action tokens: issues action tokens
services/approval_gateway/app.py - Office manager → Dashboard admin: reviews work
README.md - Dashboard admin → Approval gateway: submits decisions
README.md - Approval gateway → Immutable audit log: records decisions
services/approval_gateway/app.py - Governance audit → Immutable audit log: reviews chain
README.md - Dashboard admin → Immutable audit log: records controls
services/dashboard/app.py