GitHub - simstudioai/sim: Open-source platform to build and deploy AI agent workflows.
Key Points
- 1Sim is an open-source platform enabling visual construction and deployment of AI agent workflows, offering features like Copilot assistance and seamless integration with vector databases for grounded responses.
- 2It supports diverse self-hosting methods including NPM, Docker Compose (with configurations for production, Ollama, and vLLM), and manual setup, accommodating both local and external AI models.
- 3Core requirements for self-hosting involve Bun, Node.js v20+, and PostgreSQL with the pgvector extension, utilizing a modern tech stack centered on Next.js, Drizzle ORM, and Socket.io for real-time functionality.
Sim is an open-source platform designed to facilitate the building and deployment of AI agent workflows. Its core methodology revolves around providing a visual, canvas-based interface for designing complex agent interactions, complemented by AI-powered assistance and robust integration capabilities for various model and data sources.
The platform's primary functionality includes:
- Visual Workflow Design: Users can visually construct agent workflows by connecting distinct "agents," "tools," and "blocks" on a graphical canvas. This visual paradigm allows for intuitive composition and orchestration of AI behaviors, making the design process accessible and manageable.
- Copilot Integration: To enhance productivity and streamline development, Sim incorporates a Copilot feature. This AI assistant leverages natural language processing to generate workflow nodes, identify and rectify errors within the flow, and enable iterative refinements directly from textual prompts. This suggests a symbiotic relationship where human intent is rapidly translated into executable workflow components.
- Vector Database Grounding: Sim provides capabilities to integrate with vector databases, specifically utilizing PostgreSQL with the
pgvectorextension. This integration enables agents to ground their responses and actions in specific, user-provided content. By uploading documents to a vector store, the platform facilitates semantic search and retrieval augmented generation (RAG) paradigms, ensuring agents can answer questions based on a curated knowledge base rather than general pre-training data. This requires thepgvectorextension for efficient storage and querying of high-dimensional vector embeddings, critical for semantic similarity searches.
Sim offers multiple deployment and self-hosting options, catering to diverse technical environments and requirements:
- Cloud-hosted: Available as a managed service at
sim.ai. - Self-hosted via NPM Package: A quick start option using
npx simstudio, which automatically sets up a local Docker environment, requiring Docker to be installed and running. Users can specify a custom port with--port. - Self-hosted via Docker Compose:
- Production Deployment: Utilizes
docker-compose.prod.ymlfor a production-ready setup, accessible athttp://localhost:3000. - Local Models with Ollama: Integrates with Ollama for running local AI models without external API dependencies. This involves
docker-compose.ollama.yml, supporting GPU (--profile setup) or CPU-only (--profile cpu --profile setup) configurations. It automates the download of models likegemma3:4band allows for pulling additional models (e.g.,llama3.1:8b) viadocker compose exec ollama ollama pull. - External Ollama Instance: For Ollama instances running on the host machine outside Docker, the
OLLAMA_URLenvironment variable must be configured. In Docker Desktop (macOS/Windows),OLLAMA_URLis set tohttp://host.docker.internal:11434. For Linux, this requires using the host's actual IP address or addingextra_hosts: ["host.docker.internal:host-gateway"]to thesimstudioservice in the Docker Compose file, due to Docker's network isolation wherelocalhostwithin a container refers to the container itself. - vLLM Support: The platform also supports self-hosted models via vLLM, which exposes an OpenAI-compatible API. This requires setting
VLLM_BASE_URL(e.g.,http://your-vllm-server:8000) and optionallyVLLM_API_KEY. Similar to Ollama, if vLLM is on the host,host.docker.internalis used forVLLM_BASE_URLwithin the Docker environment.
- Production Deployment: Utilizes
- Self-hosted via Dev Containers: Provides a streamlined development environment setup using VS Code's Remote - Containers extension, allowing the project to be opened directly within a Docker container.
- Self-hosted Manual Setup: Requires specific prerequisites: Bun runtime, Node.js v20+, and PostgreSQL 12+ with the
pgvectorextension.- PostgreSQL with pgvector: This is a crucial technical requirement for Sim's AI embedding features, enabling knowledge bases and semantic search. Users can either run a
pgvector/pgvector:pg17Docker image for PostgreSQL or perform a manual installation of PostgreSQL and thepgvectorextension. - Environment Configuration: Involves copying
.env.exampleto.envinapps/simandpackages/dbdirectories. Key variables to configure includeDATABASE_URL(e.g.,postgresql://postgres:your_password@localhost:5432/simstudio),BETTER_AUTH_SECRET(generated viaopenssl rand -hex 32),BETTER_AUTH_URL,NEXT_PUBLIC_APP_URL, andENCRYPTION_KEY. - Database Migration: After configuring the database URL, migrations are applied using
bunx drizzle-kit migrate --config=./drizzle.config.tsfrompackages/db. - Server Execution: The application can be started using
bun run dev:fullfrom the project root, which concurrently launches both the Next.js application and the essential Socket.io-based realtime socket server. Alternatively, they can be run separately.
- PostgreSQL with pgvector: This is a crucial technical requirement for Sim's AI embedding features, enabling knowledge bases and semantic search. Users can either run a
- Copilot API Keys: For self-hosted instances, integrating the Copilot feature requires obtaining a
COPILOT_API_KEYfromsim.aiand setting it as an environment variable.
The technical stack underpinning Sim is robust and modern, including Next.js (App Router) for the framework, Bun as the runtime, PostgreSQL with Drizzle ORM for database management, Better Auth for authentication, Shadcn and Tailwind CSS for the UI, Zustand for state management, ReactFlow for the flow editor, Turborepo for monorepo management, Socket.io for realtime communication, Trigger.dev for background jobs, and E2B for remote code execution.
Sim is licensed under the Apache License 2.0, promoting open collaboration and usage.