This document provides a high-level introduction to the Sim platform, covering its purpose, architecture, technology stack, and deployment options. For detailed information about specific subsystems, refer to the child pages in this wiki.
Related Pages:
Sim is an open-source AI agent workflow platform that enables users to visually design, execute, and deploy agentic workflows. The platform provides a canvas-based editor for connecting AI agents, tools, and control flow blocks, with support for multiple LLM providers and real-time collaborative editing.
Key capabilities:
Sources: README.md1-199 package.json1-55 System Architecture Diagram 1
The following diagram shows the high-level architecture with actual code locations:
The architecture follows a layered approach:
Sources: package.json7-9 apps/sim/package.json1-214 apps/sim/next.config.ts1-331 turbo.json1-34 Diagram 1
| Category | Technology | Version | Purpose |
|---|---|---|---|
| Framework | Next.js | 16.1.0-canary.21 | Full-stack React framework with App Router |
| Runtime | Bun | >=1.2.13 | JavaScript runtime and package manager |
| Database | PostgreSQL | 12+ | Primary data store with pgvector for embeddings |
| ORM | Drizzle | ^0.44.5 | Type-safe database queries and migrations |
| UI Library | React | 19.2.1 | Component-based UI framework |
| Flow Editor | ReactFlow | ^11.11.4 | Visual workflow canvas |
| State Management | Zustand | ^4.5.7 | Client-side state management |
| Styling | Tailwind CSS | ^3.4.1 | Utility-first CSS framework |
| Real-time | Socket.IO | ^4.8.1 | WebSocket-based collaborative editing |
| Background Jobs | Trigger.dev | 4.1.2 | Long-running workflow execution |
| Authentication | Better Auth | 1.3.12 | Email, OAuth, and SSO authentication |
| AI Providers | Multiple | Various | OpenAI, Anthropic, Google, AWS, etc. |
Sources: package.json28-35 apps/sim/package.json25-169 README.md175-188 bun.lock1-327
Sim supports multiple deployment options, each with different configuration requirements:
| Deployment Method | Command | Requirements | Configuration File |
|---|---|---|---|
| Cloud | Visit sim.ai | None | N/A |
| NPX | npx simstudio | Docker | packages/cli |
| Docker Compose | docker compose -f docker-compose.prod.yml up | Docker | docker-compose.prod.yml |
| Ollama | docker compose -f docker-compose.ollama.yml --profile setup up | Docker + GPU | docker-compose.ollama.yml |
| Manual | bun run dev:full | Bun, Node 20+, PostgreSQL | .env.example |
| Dev Container | Open in VS Code | Docker, VS Code | .devcontainer/ |
Environment Variables: All deployments require configuration through environment variables. Key variables include DATABASE_URL, BETTER_AUTH_SECRET, ENCRYPTION_KEY, and provider API keys. See apps/sim/.env.example and Environment Variables for the complete list.
Sources: README.md41-151 package.json11-15 apps/sim/package.json10-14 docker-compose.prod.yml Diagram 3
Sim uses Turborepo to manage a monorepo with multiple applications and shared packages:
| Package | Purpose | Dependencies |
|---|---|---|
| apps/sim | Main Next.js application with workflow editor, execution engine, and API routes | @sim/db, @sim/logger, @sim/testing |
| apps/docs | Fumadocs-based documentation site | @sim/db, @sim/tsconfig |
| packages/db | Drizzle ORM schema definitions and migrations | drizzle-orm, postgres |
| packages/logger | Centralized logging utility with chalk formatting | chalk |
| packages/tsconfig | Shared TypeScript configurations (base, nextjs, library) | None |
| packages/testing | Vitest test utilities and helpers | vitest, nanoid |
| packages/ts-sdk | TypeScript SDK for programmatic workflow execution | node-fetch |
| packages/cli | simstudio CLI for self-hosted deployment via npx | commander, inquirer, chalk |
Build Pipeline: Turborepo orchestrates builds with task dependencies defined in turbo.json1-34 The pipeline ensures packages are built before dependent applications, with caching enabled for faster rebuilds.
Sources: package.json7-9 turbo.json1-34 apps/sim/package.json1-214 apps/docs/package.json1-43 packages/tsconfig/package.json1-13
The following table provides a brief overview of major subsystems in Sim. Each links to a dedicated wiki page for detailed documentation:
| Subsystem | Purpose | Key Components | Wiki Page |
|---|---|---|---|
| Workflow System | Create, edit, and execute workflows | useWorkflowStore, ExecutionEngine.ts, blocks/edges/subflows | Workflow System |
| Authentication | User authentication and authorization | Better Auth, API keys, workspace permissions | Authentication & Authorization |
| Real-time Collaboration | Multi-user editing with conflict resolution | Socket.IO server, operation queue, WebSocket events | Real-time Collaboration System |
| AI Integration | LLM provider abstraction and orchestration | providers/, PROVIDER_DEFINITIONS, tool execution | AI & LLM Integration |
| Execution Engine | DAG-based workflow execution | executor/ExecutionEngine.ts, streaming, loops/parallels | Workflow Execution Engine |
| Copilot | AI-powered workflow assistant | /api/copilot/*, context system, Sim Agent | Copilot System |
| Database | PostgreSQL schema and ORM | packages/db, Drizzle migrations, pgvector | Database Schema |
| Deployment | Workflow versioning and API exposure | /api/workflows/[id]/deploy, deployment versions | Deployment & Versioning |
| Block System | Extensible block types for workflows | blocks/blocks/*.ts, blocks/registry.ts | Workflows, Blocks & Edges |
| Tool Integration | External API and service integrations | tools/, tool registry, 200+ integrations | Tools & Integrations |
| Entry Point | Purpose | File Location |
|---|---|---|
| Main Application | Next.js app entry | apps/sim/app/layout.tsx1-230 |
| Workspace Canvas | Workflow editor UI | apps/sim/app/workspace/[workspaceId]/w/[workflowId]/canvas |
| Socket.IO Server | Real-time collaboration | apps/sim/socket/index.ts |
| CLI Tool | Self-hosted deployment | packages/cli/dist/index.js |
| API Routes | REST API endpoints | apps/sim/app/api/ |
| File | Purpose |
|---|---|
| next.config.ts1-331 | Next.js configuration with CSP, CORS, redirects |
| apps/sim/.env.example | Environment variable template |
| apps/sim/tsconfig.json1-41 | TypeScript configuration with path aliases |
| turbo.json1-34 | Turborepo build pipeline configuration |
| docker-compose.prod.yml | Production Docker Compose setup |
Sources: apps/sim/app/layout.tsx1-230 apps/sim/next.config.ts1-331 apps/sim/tsconfig.json1-41 README.md175-188
Sim employs several architectural patterns:
workflowBlocks, workflowEdges, and workflowSubflows tablesSources: Diagram 1, Diagram 2, Diagram 4, apps/sim/lib/core/utils/sse.ts1-96
For detailed information about any subsystem, refer to the corresponding section in this wiki's table of contents. The Getting Started page provides step-by-step instructions for deploying and using Sim.
Refresh this wiki
This wiki was recently refreshed. Please wait 7 days to refresh again.