Architecture Overview
A comprehensive visual guide to the Mini's World AI agent platform — systems, data flows, security layers, and every API endpoint.
System Overview
Three-tier architecture: Browser client, Express server, and external service integrations connected via HTTP, WebSocket, SSE, and webhooks.
Workflow State Machine
Workflows progress through a deterministic state machine with revision caps, timeout gates, and human review checkpoints.
Tool System
Three-tier tool routing: mcpClient.js dispatches to local executors first, then API tools with per-user credentials, then MCP servers.
mcpClient.js — Tool Router
Memory & RAG Pipeline
User messages are embedded into 1536-dimensional vectors, searched by cosine similarity, and injected into the system prompt with layered context.
Trigger & Schedule Flow
Event sources feed into the trigger matching system, which auto-creates workflows and dispatches output actions.
Security Architecture
Concentric defense layers from infrastructure hardening through authentication to encrypted data and AI safety nets.
Chat Data Flow
Complete sequence from user input through embedding, memory search, prompt building, tool execution loop, and SSE streaming response.
Agent Roster
15 specialized AI agents, each with unique personality, knowledge base, voice configuration, and tool assignments.
Environment Variables
All configuration options grouped by service. Click a group to expand.
Data Storage Map
Per-user file-based persistence. All data isolated under users/<userId>/.
data/
users/
<userId>/
workflows.json — all workflows for this user
memories.json — agent memories + embeddings
tool-assignments.json — per-company per-Mini tool config
triggers.json — event-based triggers
schedules.json — cron-like schedules
companies.json — company metadata
contacts.json — CRM contacts
trading-settings.json — Alpaca credentials + risk rules
websites.json — hosted website configs
campaigns.json — marketing campaigns
feedback.json — user feedback entries
chat-history/
<companyId>_<agentId>.jsonl — append-only chat logs
images/
*.png — DALL-E generated images
documents/
*.html — generated documents
studio/
*.json — studio project files