Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.
Python agent-orchestrationaiai-agentschatopsdiscordlangchainmcpmicrosoft-teamsmulti-agentopen-sourceopenaiself-hostedslack
# The operator dashboard, which switch-core serves on its own port beside the
# API (`GATEWAY_UI_DIR`), so a server has one address. The same build steps as
# Dockerfile.gateway, but run on the build host's own platform rather than
# under emulation for each target: the output is static files, the same for
# every architecture the image targets.
FROM --platform=$BUILDPLATFORM node:22-alpine@sha256:c610fcdfb1d5b4740dd70c284ed3cb16bb857e0f7166196e36a5501df7a3aa32 AS gateway-ui
WORKDIR /gateway
COPY gateway/package.json gateway/package-lock.json ./
RUN npm ci
COPY gateway/ .
RUN npm run build
FROM python:3.12-slim
# Pin uv and install exactly what uv.lock resolves, so the image matches what
# `uv sync` produces locally. Installing from pyproject.toml alone lets
# transitive deps (e.g. mcp/fastmcp) float on rebuild and silently change
# behaviour.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_PROJECT_ENVIRONMENT=/usr/local
# The Python project lives in core/; flatten it to /app in the image so
# the package installs as `switch_core` and alembic.ini resolves against /app.
COPY core/pyproject.toml core/uv.lock ./
# Install locked dependencies first (cached across source changes), without the
# project itself so this layer only busts when the lockfile changes.
RUN uv sync --frozen --no-install-project --no-dev
COPY core/switch_core/ switch_core/
# The session demo replays a recording that lives in the console tree, which is
# not in this image. Copied in beside the module that reads it so the demo works
# in a deployed server and not only in a checkout. Goes with the demo when the
# demo goes.
COPY console/packages/shared/src/session-v1/examples.activity.json \
switch_core/bridges/collaboration/session/
COPY core/alembic.ini .
# pyproject's readme field makes hatchling read README.md when it builds the
# project below, so it must be in the image context.
COPY core/README.md ./
RUN uv sync --frozen --no-dev
COPY --from=gateway-ui /gateway/dist /app/gateway-ui
ENV GATEWAY_UI_DIR=/app/gateway-ui
# The commit and repository this image was built from, reported with every
# metric and log so two builds of the same version can be told apart. Declared
# last so a new commit does not invalidate the layers above. Left empty, the
# server reports its commit as unknown.
ARG SWITCH_GIT_COMMIT=""
ARG SWITCH_GIT_REPOSITORY_URL=""
ENV SWITCH_GIT_COMMIT=${SWITCH_GIT_COMMIT} \
SWITCH_GIT_REPOSITORY_URL=${SWITCH_GIT_REPOSITORY_URL}
CMD ["python", "-m", "switch_core.main"]