Skip to content

System Architecture ​

OpenZess follows a clean three-layer architecture optimized for real-time AI agent interaction.

High-Level Overview ​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Browser (React)                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ Chat β”‚ β”‚Sessionsβ”‚ β”‚Matrix β”‚ β”‚WarRoom β”‚ β”‚Tavernβ”‚ β”‚
β”‚  β””β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”¬β”€β”€β”€β”˜ β”‚
β”‚     β”‚         β”‚         β”‚          β”‚          β”‚      β”‚
β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚                    β”‚ HTTP / WebSocket                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              FastAPI Server (server.py)                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ OpenzessAgentβ”‚ β”‚MCP Manager β”‚ β”‚Background Workersβ”‚ β”‚
β”‚  β”‚  (agent.py) β”‚ β”‚(mcp_mgr.py)β”‚ β”‚ (cron/watchdog)  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚         β”‚              β”‚                  β”‚            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   LiteLLM   β”‚ β”‚ MCP Serversβ”‚ β”‚  Plugin Loader   β”‚ β”‚
β”‚  β”‚ (10+ models)β”‚ β”‚(Stitch etc)β”‚ β”‚  (hot-loading)   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  PostgreSQL  β”‚ β”‚  ChromaDB   β”‚ β”‚  Xvfb + X11    β”‚ β”‚
β”‚  β”‚   (Neon)     β”‚ β”‚(Memory Vaultβ”‚ β”‚ (Matrix View)  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Component Breakdown ​

Frontend (frontend/) ​

  • Framework: React 19 + Vite 8
  • Styling: Tailwind CSS with custom design tokens
  • Animations: Framer Motion
  • Routing: React Router v7

Key Pages (21 total):

PagePurpose
Chat.tsxPrimary AI chat interface with voice control
MatrixViewer.tsxReal-time X11 desktop streaming
WarRoom.tsxMulti-agent swarm debate interface
DebateArena.tsxStructured AI debate with turns
Tavern.tsxPersona-based roleplay chat
Sessions.tsxChat session history browser
KnowledgeBase.tsxPersonal notes & canvas
Skills.tsxAgent skill management
Channels.tsxTelegram/Discord bot configuration
CronJobs.tsxBackground task scheduler
MCP.tsxMCP server connection manager
Marketplace.tsxPlugin marketplace browser
Companion.tsxVRM 3D avatar companion

Backend (backend/) ​

FileResponsibility
server.pyFastAPI application with 30+ REST endpoints
agent.pyCore LLM agent with tool execution loop
database.pySQLAlchemy ORM for Neon PostgreSQL
mcp_manager.pyMCP client connection manager
plugin_loader.pyDynamic Python plugin hot-loader
swarm_manager.pyMulti-agent parallel execution engine
background_workers.pyCron scheduler and filesystem watchdog
tavern_parser.pyTavernAI character card importer
telegram_worker.pyTelegram bot integration
discord_worker.pyDiscord bot integration

Data Flow ​

  1. User sends message β†’ Frontend POST /api/chat with SSE streaming
  2. Server creates session β†’ Stored in PostgreSQL via SQLAlchemy
  3. Agent processes β†’ LiteLLM routes to selected provider
  4. Tool calls detected β†’ Agent pauses, frontend shows approval dialog
  5. User approves β†’ POST /api/chat/approve executes tools in sandbox
  6. Results streamed β†’ SSE chunks flow back to the React UI
  7. Memory saved β†’ Important context stored in ChromaDB vector database

Released under the MIT License.