Logo vun Ragtime

Ragtime

Communautéit
mattv8

Self-hosted, OpenAI-compatible RAG API + MCP server that plugs local knowledge into existing LLM clients.

Editeurmattv8
Repositoryragtime
SproochPython
Forks
9
Stären
34
Disponibel Tools
0
Transporttypstdio, streamable-http
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    Ragtime stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    34 Stären an 9 Forks aus dem verlinkte Repository.

Ragtime

Table of Contents

Overview

What Ragtime provides and how the main pieces fit together.

Features

  • Chat UI built in, with tool visualization, interactive charts, DataTables, and sandboxed HTML components: no external client required
  • Model providers: hosted APIs, subscription auth (OpenAI Codex, Claude Code), and local runtimes, all configurable in Settings
  • Workspaces with live previews run in isolated runtime sessions; shared links use clean public URLs (/{owner}/{slug}), with optional password-protected full-page access
  • MCP server (HTTP Streamable + stdio transports) exposing tools to Claude Desktop, VS Code Copilot, Cursor, and JetBrains IDEs with auth
  • OpenAI-compatible API /v1/chat/completions endpoint with streaming: works with OpenWebUI, Continue, and any OpenAI client
  • Dual vector store: Choose FAISS or pgvector for Upload/Git indexes; pgvector for schema/PDM and optional filesystem indexing (details)
  • Tool security: SQL injection prevention via allowlist patterns, LIMIT enforcement, Odoo code validation, optional write-ops flag

Model Providers

Configure LLM and embedding providers in the Settings UI. Chat (LLM) and embedding models can use different providers. Models are discovered live from each provider, and overlapping families (for example Anthropic API key vs Claude Code subscription) stay labeled by the provider serving them so token spend is clear.

ProviderAuthChat (LLM)Embeddings
OpenAIAPI keyYesYes
OpenAI CodexChatGPT subscription (OAuth device flow)YesYes
AnthropicAPI keyYes-
Claude CodeClaude Pro/Max subscription (CLI/OAuth)Yes-
OpenRouterAPI keyYesYes
GitHub CopilotOAuth device flow or PATYes-
OllamaLocal (self-hosted)YesYes
llama.cppLocal (self-hosted)YesYes
LM StudioLocal (self-hosted)YesYes
oMLXLocal (self-hosted)YesYes

Subscription-backed providers (OpenAI Codex, Claude Code) authenticate from the Settings UI without an API key. Claude Code uses the Claude Code CLI subscription and discovers the full Claude model family your plan serves.

Architecture

Quick Start

Prerequisites

  • Docker and Docker Compose
  • A .env file with your configuration

Setup

  1. Create .env:

    Copy .env.example to .env. The expanded block below is CI-checked against .env.example, so future edits should go there instead of the README snippet:

    bash
    # =============================================================================
    # Ragtime RAG API - Environment Configuration
    # =============================================================================
    # Copy this file to .env and fill in your values
    
    # -----------------------------------------------------------------------------
    # Database Configuration
    # -----------------------------------------------------------------------------
    # PostgreSQL password (used by both database container and ragtime)
    POSTGRES_PASSWORD=changeme
    
    # -----------------------------------------------------------------------------
    # Authentication Configuration
    # -----------------------------------------------------------------------------
    # Local admin account credentials
    LOCAL_ADMIN_USER=admin
    LOCAL_ADMIN_PASSWORD=changeme_admin
    
    # Optional comma-separated OAuth callback URLs to trust in addition to built-in
    # loopback/IDE callback handling.
    # OAUTH_TRUSTED_REDIRECT_URIS=https://example-1/oauth/callback,https://example-2/oauth/callback
    
    # -----------------------------------------------------------------------------
    # Server Configuration
    # -----------------------------------------------------------------------------
    # API port (default: 8000)
    PORT=8000
    
    # CORS allowed origins (comma-separated)
    # Leave empty to allow loopback-only origins.
    # Example: https://ragtime.example.com,https://chat.example.com
    ALLOWED_ORIGINS=
    
    # Canonical public Ragtime origin (scheme + host, no trailing slash), for example:
    # https://ragtime.example.com
    # Set it only when Ragtime sees a different origin than users do
    # (for example behind TLS termination) or public URLs must stay fixed.
    # EXTERNAL_BASE_URL=https://ragtime.example.com
    
    # Optional preview base-domain override for userspace subdomain previews.
    # Leave unset to derive preview hosts from the current Ragtime origin
    # (for example https://ragtime.example.com -> https://<workspace>.ragtime.example.com).
    # Set this when previews should use a separate wildcard host family such as
    # example-userspaces.com. Wildcard DNS/TLS must route *.example-userspaces.com
    # back to Ragtime.
    # USERSPACE_PREVIEW_BASE_DOMAIN=example-userspaces.com
    
    # -----------------------------------------------------------------------------
    # Security Configuration
    # -----------------------------------------------------------------------------
    # API Key for OpenAI-compatible endpoint authentication (strongly recommended
    # for non-local deployments)
    # Generate with: openssl rand -base64 32
    API_KEY=
    
    # Ragtime manages its own encryption key at /data/.encryption_key.
    # Keep that managed file recoverable through your data backups if you need to
    # restore encrypted API keys and connection passwords later.
    
    # Optional GitHub OAuth App client ID for GitHub Copilot device auth flow.
    # If not set, Ragtime falls back to the built-in default client id.
    # Create your own OAuth app to control consent screen branding (e.g., app name "Ragtime").
    # Note: this is the Client ID only (not the Client Secret).
    # GITHUB_COPILOT_CLIENT_ID=Ovxxxxxxxxxxxxxxxxxx
    
    # Optional OAuth apps for SharePoint/OneDrive and Google Drive userspace mounts.
    # Microsoft client ID/secret: https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade
    # Microsoft tenant ID: use the Azure Directory (tenant) ID or primary tenant domain for single-tenant app registrations.
    # Microsoft Graph delegated permissions for read/write mounts: offline_access, User.Read, Files.ReadWrite.All, Sites.ReadWrite.All. Admin consent may be required.
    # Google client ID/secret: https://console.cloud.google.com/apis/credentials
    # Google API library: enable Google Drive API (drive.googleapis.com) for the same project as the OAuth client.
    # Google OAuth consent screen scopes for read/write mounts: https://www.googleapis.com/auth/drive and https://www.googleapis.com/auth/userinfo.email
    # CLOUD_MOUNT_MICROSOFT_CLIENT_ID=
    # CLOUD_MOUNT_MICROSOFT_CLIENT_SECRET=
    # CLOUD_MOUNT_MICROSOFT_TENANT_ID=
    # CLOUD_MOUNT_GOOGLE_CLIENT_ID=
    # CLOUD_MOUNT_GOOGLE_CLIENT_SECRET=
    
    # HTTPS: Enable built-in TLS with self-signed certificate (auto-generated on first run)
    # To use your own certs, place them at ./data/ssl/server.crt and ./data/ssl/server.key
    # ENABLE_HTTPS=true
    
    # Set to true if behind an HTTPS reverse proxy (nginx, Caddy, Traefik)
    # This marks cookies as Secure. Auto-enabled when ENABLE_HTTPS=true.
    SESSION_COOKIE_SECURE=false
    
    # -----------------------------------------------------------------------------
    # Runtime Configuration
    # -----------------------------------------------------------------------------
    
    # Base URL Ragtime uses for outbound calls to the runtime-manager API that
    # creates and controls userspace runtime sessions. In the default Docker setup,
    # this should stay pointed at the internal runtime service.
    # Set to blank/non-http to force local placeholder runtime mode.
    # RUNTIME_MANAGER_URL=http://runtime:8090
    
    # Internal Ragtime URL for User Space runtime workers.
    # Set only for remote/custom runtime networks where automatic discovery cannot reach Ragtime.
    # RUNTIME_BRIDGE_BASE_URL=http://ragtime:8000
    
    # Shared bearer token for Ragtime <-> runtime service calls. If unset, User
    # Space runtime features stay disabled and admins see a security warning in
    # the UI. Generate with: openssl rand -base64 32
    RUNTIME_AUTH_TOKEN=
    
    # Maximum concurrent runtime sessions in running/starting state (default: 12)
    # RUNTIME_MAX_SESSIONS=12
    
    # Optional override for concurrent workspace startup/bootstrap operations per
    # runtime worker. By default, the worker sizes this automatically from runtime
    # namespace isolation, CPU, memory, and session capacity.
    # RUNTIME_STARTUP_CONCURRENCY=
    
    # Chat web search uses the bundled internal SearXNG service by default.
    # Set TAVILY_API_KEY to use Tavily instead (get a key at https://app.tavily.com/home).
    # TAVILY_API_KEY=
    
    ############################################################
    # Developer Only - Typically do not modify below this line #
    ############################################################
    
    # Debug mode (enables verbose logging and hot-reload)
    DEBUG_MODE=false
    
    # Database URL (auto-configured by docker-compose, override for external DB)
    # DATABASE_URL=postgresql://ragtime:password@hostname:5432/ragtime
  2. Edit .env with your actual values.

  3. Create docker-compose.yml if you want the standalone self-hosted compose setup shown below:

    yaml
    # =============================================================================
    # Ragtime - Self-Hosted Docker Compose
    # =============================================================================
    # For self-hosted deployment. See README.md for setup instructions.
    #
    # Usage:
    #   1. Create .env file with your configuration
    #   2. docker compose up -d
    #   3. Access at http://localhost:${PORT:-8000}
    
    services:
      # PostgreSQL database for Prisma persistence
      ragtime-db:
        image: pgvector/pgvector:pg18
        container_name: ragtime-db
        restart: unless-stopped
        environment:
          POSTGRES_USER: ragtime
          POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
          POSTGRES_DB: ragtime
        volumes:
          - ragtime-db-data:/var/lib/postgresql
        networks:
          - ragtime-network
        healthcheck:
          test: ["CMD-SHELL", "pg_isready -U ragtime -d ragtime"]
          interval: 10s
          timeout: 5s
          retries: 5
    
      searxng:
        image: ghcr.io/searxng/searxng:latest
        container_name: searxng
        restart: unless-stopped
        environment:
          SEARXNG_BASE_URL: http://searxng:8080/
          SEARXNG_SECRET: ${SEARXNG_SECRET:-ragtime-internal-searxng}
        configs:
          - source: searxng-settings
            target: /etc/searxng/settings.yml
        volumes:
          - searxng-cache:/var/cache/searxng
        networks:
          - ragtime-network
        healthcheck:
          test:
            [
              "CMD",
              "python",
              "-c",
              "import urllib.request; urllib.request.urlopen('http://localhost:8080/healthz', timeout=5).read()",
            ]
          interval: 30s
          timeout: 10s
          retries: 5
          start_period: 10s
    
      # Ragtime RAG API
      ragtime:
        # For older CPUs without X86_V2 support, use the legacy tag:
        # image: hub.docker.visnovsky.us/library/ragtime:legacy
        image: hub.docker.visnovsky.us/library/ragtime:main
        container_name: ragtime
        restart: unless-stopped
        ports:
          - "${PORT:-8000}:8000"
        env_file:
          - .env
        environment:
          # Database connection (uses container network)
          DATABASE_URL: postgresql://ragtime:${POSTGRES_PASSWORD}@ragtime-db:5432/ragtime
          # Recommended defaults
          DEBUG_MODE: "false"
          RUNTIME_MANAGER_URL: ${RUNTIME_MANAGER_URL:-http://runtime:8090}
          RUNTIME_BRIDGE_BASE_URL: ${RUNTIME_BRIDGE_BASE_URL:-}
          # Shared Ragtime <-> runtime token. If unset, User Space runtime features
          # stay disabled and admins see a security warning in the UI.
          RUNTIME_AUTH_TOKEN: ${RUNTIME_AUTH_TOKEN:-}
          OBJECT_STORAGE_ENDPOINT: ${OBJECT_STORAGE_ENDPOINT:-http://runtime-s3:9000}
          OBJECT_STORAGE_CONTROL_URL: ${OBJECT_STORAGE_CONTROL_URL:-http://runtime-s3:9001}
          OBJECT_STORAGE_KEY_EXPORT_PATH: /run/ragtime-storage-key/.encryption_key
        volumes:
          # Data persistence (indexes, SSL certs, etc.)
          - ./data:/data
          - object-storage-key:/run/ragtime-storage-key
          # Optional: mount docker.sock only if you need Docker tool execution.
          # The Docker API can control the host even when the socket is mounted read-only.
          # - /var/run/docker.sock:/var/run/docker.sock:ro
        security_opt:
          - no-new-privileges:true
        # Uncomment below if using SMB/NFS mounting inside container (consider mounting via docker volume instead)
        # privileged: true
        # cap_add:
        #   - SYS_ADMIN
        networks:
          - ragtime-network
        depends_on:
          ragtime-db:
            condition: service_healthy
          runtime:
            condition: service_started
          searxng:
            condition: service_healthy
        healthcheck:
          test: ["CMD", "sh", "-c", "if [ \"$ENABLE_HTTPS\" = \"true\" ]; then curl -fsk https://localhost:8000/health; else curl -fs http://localhost:8000/health; fi"]
          interval: 30s
          timeout: 10s
          retries: 3
          start_period: 15s
    
      # Internal, persistent workspace S3 gateway. It waits for Ragtime's managed
      # encryption key and intentionally has no host-published ports.
      runtime-s3:
        image: hub.docker.visnovsky.us/library/ragtime-storage:main
        container_name: runtime-s3
        restart: unless-stopped
        environment:
          S3_PORT: "9000"
          STORAGE_CONTROL_PORT: "9001"
          STORAGE_ROOT: /data/_userspace/_object_storage
          STORAGE_KEY_FILE: /run/ragtime-storage-key/.encryption_key
        volumes:
          - ./data/_userspace/_object_storage:/data/_userspace/_object_storage
          - object-storage-key:/run/ragtime-storage-key:ro
        networks:
          - ragtime-network
        depends_on:
          ragtime:
            condition: service_healthy
    
      runtime:
        image: hub.docker.visnovsky.us/library/runtime:main
        container_name: runtime
        restart: unless-stopped
        environment:
          PORT: "8090"
          RUNTIME_SERVICE_MODE: manager
          # Shared Ragtime <-> runtime token. If unset, User Space runtime features
          # stay disabled and admins see a security warning in the UI.
          RUNTIME_AUTH_TOKEN: ${RUNTIME_AUTH_TOKEN:-}
          RUNTIME_WORKER_BASE_URL: ${RUNTIME_WORKER_BASE_URL:-http://runtime:8090}
          RUNTIME_WORKSPACE_ROOT: ${RUNTIME_WORKSPACE_ROOT:-/data/_userspace}
          RUNTIME_MAX_SESSIONS: ${RUNTIME_MAX_SESSIONS:-12}
          RUNTIME_STARTUP_CONCURRENCY: ${RUNTIME_STARTUP_CONCURRENCY:-}
          RUNTIME_LEASE_TTL_SECONDS: ${RUNTIME_LEASE_TTL_SECONDS:-3600}
          RUNTIME_RECONCILE_INTERVAL_SECONDS: ${RUNTIME_RECONCILE_INTERVAL_SECONDS:-15}
        volumes:
          - ./data:/data
        security_opt:
          - no-new-privileges:true
        # Uncomment below to enable full runtime sandbox isolation when the host
        # permits mount and PID namespaces (otherwise runtime falls back to chroot).
        # privileged: true
        # cap_add:
        #   - SYS_ADMIN
        networks:
          - ragtime-network
        healthcheck:
          test: ["CMD", "curl", "-fs", "http://localhost:8090/health"]
          interval: 30s
          timeout: 10s
          retries: 3
          start_period: 5s
    
    networks:
      ragtime-network:
        driver: bridge
    
    configs:
      searxng-settings:
        content: |
          use_default_settings: true
    
          search:
            formats:
              - html
              - json
    
    volumes:
      ragtime-db-data:
      searxng-cache:
      object-storage-key:

    Note: Ragtime configuration variables are loaded from the .env file via env_file. The ragtime.environment section only overrides values that should use the internal container network.

    Runtime mode compatibility: pivot_root with CAP_SYS_ADMIN is the preferred steady-state runtime mode. If the runtime starts without mount authority, Ragtime falls back to a chroot compatibility mode that mirrors workspace files into the sandbox. Switching an existing workspace fleet from chroot fallback to full isolation is supported, but should be treated as a one-time migration event. Transitioning between chroot and pivot_root can cause loss of snapshot history! It is recommended to take a full backup before transitioning.

  4. Start the application:

    bash
    docker compose up -d
  5. Access the application:

    Default credentials: admin / (set via LOCAL_ADMIN_PASSWORD in .env)

Post-Install Setup

After the stack is running, configure the capabilities Ragtime will expose.

Tool Configuration

Configure tools in the Ragtime web UI before connecting MCP clients. Enabled tools are available to chat; MCP exposure additionally applies heartbeat health filtering.

  1. Open the web UI at http://localhost:8000 and log in with your admin account.
  2. Navigate to the Tools tab.
  3. Click Add Tool and select the tool type (PostgreSQL, Odoo, SSH, filesystem indexer, etc.).
  4. Fill in connection details (hostnames, credentials, database names, paths) for each tool.
  5. Use the built-in test button to verify each tool connection.

Once the required tools are healthy, continue with MCP Integration.

Creating Indexes

The Indexer UI (http://localhost:8000, Indexes tab) supports multiple index types (see Vector Store Abstraction for backend details):

MethodVector StoreStorageUse Case
Upload (zip/tar)FAISS or pgvectorFAISS: data/indexes/<name>/pgvector: filesystem_embeddings tableStatic codebases, documentation snapshots
Git CloneFAISS or pgvectorFAISS: data/indexes/<name>/pgvector: filesystem_embeddings tableRepositories with optional private token auth
FilesystemFAISS or pgvectorFAISS: data/indexes/<name>/pgvector: filesystem_embeddings tableLive SMB/NFS shares, Docker volumes, local paths: incremental re-index
Schemapgvectorschema_embeddings tableAuto-generated from PostgreSQL/MSSQL/MySQL tools (enable in Tool Configuration)
PDMpgvectorpdm_embeddings tableConfiguration-aware checked-in SolidWorks PDM metadata via SQL Server, including per-value origin versions.

Jobs run async with progress streaming to the UI.

Preview DNS Setup (Reverse Proxy Deployments)

This step configures the wildcard DNS and proxy routing required for workspace live previews (see Workspaces for conceptual details).

  1. Choose a preview base domain: Ragtime defaults to prepending the workspace name to its public origin (e.g., https://ragtime.example.com -> https://<workspace>.ragtime.example.com). To use a separate wildcard domain, set USERSPACE_PREVIEW_BASE_DOMAIN=example-userspaces.com.
  2. Add a wildcard DNS record for the chosen domain pointing to your Ragtime entrypoint.
  3. Configure your reverse proxy to route these wildcard requests to Ragtime and ensure TLS certificates cover them.
  4. Update .env (only if needed):
bash
EXTERNAL_BASE_URL=https://ragtime.example.com
USERSPACE_PREVIEW_BASE_DOMAIN=example-userspaces.com

Notes:

  • Set EXTERNAL_BASE_URL only if Ragtime sees a different origin than users do (e.g., behind TLS termination), or to pin public URLs to a canonical host.
  • Keep SESSION_COOKIE_SECURE=true when traffic is HTTPS at the edge.
  • Forward Host and X-Forwarded-Proto headers through the proxy.
  • In local development (DEBUG_MODE=true), previews automatically use userspace-preview.lvh.me.

Concepts

Core concepts that affect how Ragtime is deployed and used.

Workspaces

Workspaces combine files, conversations, selected infrastructure tools, and an isolated runtime preview session in one agentic sandbox. They are Replit-like, but wired into Ragtime's tools and indexed context so agents can work against live systems.

  • Public sharing uses direct routes (/{owner}/{slug} and /shared/{token}) which launch shared previews.
  • Password-protected shares are handled server-side with a full-page prompt.
  • When the runtime lacks CAP_SYS_ADMIN, previews run in a chroot compatibility mode instead of full pivot_root isolation. Transitioning between chroot and pivot_root can cause loss of snapshot history! It is recommended to take a full backup before transitioning.

External Agent Collaboration

Workspace owners and admins can open Share Workspace, enable External Agent Access, and copy the generated instructions into Claude Cowork, Codex, ChatGPT, or another compatible agent to collaborate on the workspace.

Vector Store Abstraction

Ragtime uses two vector backends: FAISS (in-memory, loaded at startup) and pgvector (PostgreSQL, persistent). Upload, Git, and Filesystem indexes can use either backend.

See Creating Indexes for a detailed breakdown of index types and their storage backends.

FAISS indexes are loaded into memory at startup; pgvector indexes stay in PostgreSQL and use cosine similarity search. Embedding provider (OpenAI, Ollama, llama.cpp, or LM Studio) is configured once in Settings and applies to all index types. Swapping embedding model or dimensions after initial indexing requires a full re-index.

Integrations

How to connect external clients and coding assistants to Ragtime.

Model Context Protocol (MCP) Integration

Ragtime exposes its tools via the Model Context Protocol, allowing AI coding assistants to interact with your databases, execute shell commands, and search your indexed codebases.

By default, MCP is disabled until you enable it in Settings. If disabled, /mcp responds with HTTP 503. For security and authentication rules, see Network & Access.

Available MCP Tools

Tools are dynamically exposed based on what you configure in the UI. The schemas below list the primary fields; several tools also accept optional fields such as timeout.

Tool TypeInput Schema
postgres{query, reason}
mssql{query, reason}
mysql{query, reason}
influxdb{query, reason}
odoo_shell{code, reason}
ssh_shell{command, reason}
filesystem_indexer{query, max_results}
solidworks_pdmsearch_{tool}: {query, document_type}; Chat also provides lookup_{tool} for exact indexed-snapshot lookup.
knowledge_search{query, index_name}
schema_search{prompt, limit}
git_history{action, ...}

MCP Server Setup

HTTP Transport (Recommended)

Ragtime exposes an MCP endpoint at /mcp that supports the Streamable HTTP transport. Add this to your MCP client configuration:

json
{
	"servers": {
		"ragtime": {
			"url": "http://localhost:8000/mcp",
			"type": "http",
      // If you've enabled MCP authentication in the Ragtime Settings UI (Settings > MCP Configuration), add headers for your configured auth method.
      // Password mode supports either `MCP-Password` or `Authorization: Bearer <password>`:
			// "headers": {
      //   "MCP-Password": "your-mcp-password-here"
      //   // or: "Authorization": "Bearer your-mcp-password-here"
			// }
		}
	},
	"inputs": []
}

NOTE: For remote access, replace localhost:8000 with your server URL.

Stdio Transport (Alternative)

For local development or environments where HTTP isn't preferred, use stdio transport via Docker:

json
{
  "mcpServers": {
    "ragtime": {
      "command": "docker",
      "args": ["exec", "-i", "ragtime", "python", "-m", "ragtime.mcp"]
    }
  }
}

Replace ragtime with your container name if different (find it with docker ps).

Configuration file locations:

  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
  • VS Code / Copilot: User or workspace MCP settings
  • Cursor: .cursor/mcp.json
  • Windsurf: ~/.codeium/windsurf/mcp_config.json

Connecting to OpenWebUI

  1. In OpenWebUI, go to Settings > Connections > OpenAI API
  2. Add a new connection:
    • API Base URL: http://ragtime:8000/v1 (or http://localhost:8000/v1 if running locally)
    • API Key: Your configured API_KEY (see Network & Access) (or any value if not set)
  3. Select your server's model name (default: "ragtime", configurable in Settings > Server Branding)

Operations

Security, maintenance, and troubleshooting guidance for self-hosted deployments.

Security

Ragtime is designed for self-hosted deployment on trusted networks. Review these recommendations before exposing it beyond localhost:

Pushes to the beta and main branches trigger packaging workflows that build, sign, and publish images. The main-branch images are Cosign-signed and ship with an SPDX SBOM artifact (linked from the badges above and workflow runs) so you can verify what you pull from the registry. Pull requests run validation only and do not publish images.

Network & Access

  • Run behind a reverse proxy or firewall. Avoid exposing port 8000 directly to the public internet.
  • Set API_KEY to protect the /v1/chat/completions endpoint. When unset (the default), anyone with network access can call the chat API and invoke your configured tools.
  • Restrict ALLOWED_ORIGINS to trusted domains. The application default is loopback-only when unset; avoid using * in network-accessible deployments because it is permissive with allow_credentials=True.
  • Enable MCP route authentication via Settings UI if /mcp is network-accessible. MCP is disabled by default; when MCP is enabled, the default route is open unless you turn on route authentication.
  • MCP authentication supports password-based headers (including MCP-Password and bearer form) and OAuth2/client_credentials route modes.
  • Protect workspace external-agent URLs. These URLs contain revocable bearer tokens. Use them only in private sessions with trusted agents, keep them out of generated files and public issue trackers, and rotate or disable a URL when access is no longer needed.
  • Set a strong LOCAL_ADMIN_PASSWORD when deploying.
  • Review trusted external redirects carefully. OAuth callbacks and other external redirect allowlists should only include destinations you control. Redirecting users to third-party domains can expose authorization codes, tokens, or sensitive workflow context if those destinations are compromised or misconfigured.

Authentication Security

  • Encryption key is managed automatically on first startup and stored in the data volume as .encryption_key so sessions and encrypted settings survive restarts. Plain backups do not carry that file. If you need a backup that can restore encrypted API keys and connection passwords, create an encrypted backup with --include-secret so the managed key stays inside ciphertext, or otherwise preserve the .encryption_key file separately.
  • Rate limiting protects the login endpoint (5 attempts/minute per IP) to prevent brute-force attacks. In DEBUG_MODE=true, rate limiting is disabled for local testing.

Debug Mode Warning

Do not use DEBUG_MODE=true outside local development. When enabled, the /auth/status endpoint exposes your admin username and password in plaintext (including unauthenticated callers). This is intentional for self-hosted debugging but dangerous if the server is accessible to untrusted users.

SSH Connections

The SSH tool uses Paramiko with AutoAddPolicy, which accepts any host key without verification. This makes SSH connections vulnerable to man-in-the-middle attacks on first connect. Only use the SSH tool on trusted networks or with hosts you have verified out-of-band.

Tool Read-Only Mode

Tool read-only mode is a guardrail, not complete isolation. Validators reduce common write paths, but they cannot make broad database, SSH, shell, or Odoo credentials safe against every bypass or misconfiguration. Use least-privileged credentials, read-only database roles and transactions, OS/container sandboxing, restricted SSH users, timeouts, audit logs, and network/firewall boundaries for any tool reachable by agents.

Docker & Mounts

  • The default compose files include mounts for docker.sock and optional privileged flags to support advanced tool features (container exec, SSH tunnels, NFS/SMB mounts).
  • If you do not need these features, remove or comment out the corresponding lines in your compose file.
  • For NFS/SMB filesystem indexing, the container may require elevated privileges. Consider the security implications before enabling privileged: true or SYS_ADMIN capabilities.
  • Filesystem sources attached to User Space workspaces only need to be mounted into the runtime container (the ragtime container does not need to see the source). The runtime container also needs mount authority (privileged: true or cap_add: [SYS_ADMIN]) so it can bind-mount the source into the workspace sandbox without copying or changing source permissions. Filesystem sources used purely for indexing only need to be mounted into the ragtime container; mount them in both services if the same source is used for both indexing and User Space workspaces.
  • If a Docker bind source is itself a host-mounted SMB/NFS share, use bind propagation such as :rslave (for example /mnt/Accounting:/mnt/Accounting:rw,rslave) and make sure the host mount is active before starting the container. If the host share is mounted after the container starts, recreate the affected container; otherwise Docker can keep exposing the empty local mountpoint directory into User Space.

Third-Party Data Relay

Queries and tool calls may forward your data to external services you configure (OpenAI, Anthropic, Ollama, llama.cpp, LM Studio, PostgreSQL, MSSQL, SSH hosts). Only connect to services you trust with your data.

Updating

To update to the latest version:

bash
docker compose pull
docker compose up -d

Troubleshooting

SSH Tools Fail from Colima on macOS but Hosts Are Reachable

SSH checks run from inside the Colima VM, so macOS-reachable hosts may still fail if Colima's user-mode networking is stale. To confirm, test TCP connectivity from each layer:

bash
nc -vz -w 3 <HOST_IP> 22                                                                      # macOS
colima ssh -- bash -lc 'timeout 4 bash -lc "</dev/tcp/<HOST_IP>/22" && echo open || echo failed'  # Colima VM
docker exec ragtime-dev bash -lc 'timeout 4 bash -lc "</dev/tcp/<HOST_IP>/22" && echo open || echo failed'  # container

If only macOS can connect, restart Colima and the stack:

bash
colima stop && colima start
docker compose -f docker/docker-compose.dev.yml up --build

If the problem persists, kill stale Lima usernet helpers: ps ax | grep 'limactl usernet' and keep only the PID in ~/.colima/_lima/_networks/user-v2/usernet_user-v2.pid.

NumPy CPU Compatibility Error

If you see an error like:

RuntimeError: NumPy was built with baseline optimizations (X86_V2) but your machine doesn't support (X86_V2)

Your CPU lacks the X86_V2 instruction set required by modern NumPy binaries. Use the legacy image instead:

yaml
image: hub.docker.visnovsky.us/library/ragtime:legacy

This image pins CPU-sensitive native dependencies, including NumPy and FAISS, to versions compatible with older virtual CPU profiles.

Contributing

See CONTRIBUTING.md for development setup, making changes, and CI/CD details.

License

MIT: see LICENSE.

Installatioun

TypingMind
{
  "mcpServers": {
    "ragtime": {
      "command": "uvicorn",
      "args": [
        "ragtime.main:app",
        "--host",
        "0.0.0.0",
        "--port",
        "{{config.PORT}}"
      ]
    }
  }
}

Ragtime MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Ragtime verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dir kënnt MCP lokal op Ärem Apparat ausféieren oder Iech mat enger Remote-MCP-Server-URL verbannen.

Optioun 1: De lokale Connector benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Ragtime als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu Ragtime an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "ragtime": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu Ragtime. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu Ragtime.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Ragtime?
Ragtime
Jo. Ech hunn et gelies.
Dat hunn ech mat Ragtime fonnt.

Optioun 2: Eng MCP-Server-URL derbäisetzen

Benotzt dës Optioun, wann Ragtime scho remote gehost gëtt oder Är Ekipp ee gemeinsame Connector wëllt, op dee méi Benotzer kënnen zougräifen.

1

MCP-Connectoren opmaachen

Gitt an TypingMind op „Plugins“, maacht „MCP-Connectoren“ op a wielt dann „URL derbäisetzen“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Gitt op „Plugins“.
  3. Maacht „MCP-Connectoren“ op.
  4. Klickt op „URL derbäisetzen“.
TypingMind-Formulaire fir eng benotzerdefinéiert MCP-Server-URL derbäizesetzen
2

D'Server-URL apeschen

Gitt d'MCP-Server-URL vum Ubidder am Feld „Server-URL“ an. Setzt e Verbindungsnumm, eng Beschreiwung, e Symbol, benotzerdefinéiert HTTP-Headeren oder OAuth-Clientastellungen derbäi, wann de Server se erfuerdert.

  1. Pescht d'MCP-Server-URL vum Ubidder an d'Feld „Server-URL“.
  2. Gitt en Numm fir d'Verbindung mat Ragtime an.
  3. Setzt eng Beschreiwung an e Symbol derbäi, fir d'Verbindung méi einfach erëmzeerkennen.
  4. Setzt benotzerdefinéiert HTTP-Headeren oder OAuth-Clientdetailer derbäi, wann de Server eng Authentifizéierung erfuerdert.
3

D'Verbindung erstellen

Klickt op „Verbindung erstellen“, gitt dann zeréck op d'Plugin-Lëscht a kontrolléiert, ob déi nei MCP-Verbindung aktiv ass.

  1. Klickt op „Verbindung erstellen“.
  2. Gitt zeréck op d'Lëscht vun de MCP-Connectoren.
  3. Kontrolléiert, ob d'Verbindung mat Ragtime als aktiv ugewise gëtt.
  4. Aktualiséiert d'Plugin-Lëscht, wann d'Verbindung net direkt ugewise gëtt.
4

Modeller wiesselen ouni nei ze verbannen

Start e Chat mat Ärem bevorzugte Modell, aktivéiert d'Tools vu Ragtime ënner „Plugins“ a wiesselt bei Bedarf op en anere Modell. D'MCP-Verbindung bleift am TypingMind-Aarbechtsberäich disponibel.

  1. Start en neie Chat an TypingMind.
  2. Wielt de KI-Modell, deen Dir benotze wëllt.
  3. Aktivéiert d'Tools vu Ragtime ënner „Plugins“.
  4. Biet de Modell, den Tool ze benotzen, wann néideg.
  5. Wiesselt op en anere KI-Modell a benotzt déiselwecht MCP-Verbindung weider.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Ragtime?
Ragtime
Jo. Ech hunn et gelies.
Dat hunn ech mat Ragtime fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server Ragtime benotzt?

Ragtime ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Ragtime MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Ragtime mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat Ragtime MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Ragtime verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech Ragtime MCP mat TypingMind?

Dir kënnt Ragtime iwwer de lokale MCP-Connector oder iwwer d'URL vun engem Remote-MCP-Server mat TypingMind verbannen. Benotzt de lokale Connector, wann de Server Zougrëff op Fichieren, Apps oder privat Ressourcen op Ärem Apparat brauch, an eng Server-URL, wann de MCP-Server op Distanz gehost gëtt.

Wéi eng Tools stellt Ragtime MCP an TypingMind zur Verfügung?

Ragtime stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Ragtime MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Ragtime eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇