GitHub - simstudioai/sim: Open-source platform to build and deploy AI agent workflows.
Service

GitHub - simstudioai/sim: Open-source platform to build and deploy AI agent workflows.

simstudioai
2025.05.11
ยทGitHubยทby Anonymous
#AI Agent#Workflow#Platform#Open Source#LLM

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 pgvector extension. 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 the pgvector extension 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.yml for a production-ready setup, accessible at http://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 like gemma3:4b and allows for pulling additional models (e.g., llama3.1:8b) via docker compose exec ollama ollama pull.
    • External Ollama Instance: For Ollama instances running on the host machine outside Docker, the OLLAMA_URL environment variable must be configured. In Docker Desktop (macOS/Windows), OLLAMA_URL is set to http://host.docker.internal:11434. For Linux, this requires using the host's actual IP address or adding extra_hosts: ["host.docker.internal:host-gateway"] to the simstudio service in the Docker Compose file, due to Docker's network isolation where localhost within 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 optionally VLLM_API_KEY. Similar to Ollama, if vLLM is on the host, host.docker.internal is used for VLLM_BASE_URL within the Docker environment.
  • 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 pgvector extension.
    • 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:pg17 Docker image for PostgreSQL or perform a manual installation of PostgreSQL and the pgvector extension.
    • Environment Configuration: Involves copying .env.example to .env in apps/sim and packages/db directories. Key variables to configure include DATABASE_URL (e.g., postgresql://postgres:your_password@localhost:5432/simstudio), BETTER_AUTH_SECRET (generated via openssl rand -hex 32), BETTER_AUTH_URL, NEXT_PUBLIC_APP_URL, and ENCRYPTION_KEY.
    • Database Migration: After configuring the database URL, migrations are applied using bunx drizzle-kit migrate --config=./drizzle.config.ts from packages/db.
    • Server Execution: The application can be started using bun run dev:full from 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.
  • Copilot API Keys: For self-hosted instances, integrating the Copilot feature requires obtaining a COPILOT_API_KEY from sim.ai and 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.