← Back to the FounderLoop post
Agent Switch

Build your own FounderLoop

How we wired FounderLoop to Switch, in the order we set it up. If you’re new to Switch, start with the quickstart: it gets one agent answering in a chat channel in about ten minutes.

  1. Run a Switch server

    Install Switch Console or run Switch’s published Docker Compose deployment. FounderLoop uses the standalone Docker server with its Gateway, because the Console-managed local server didn’t expose a registration key for an external agent.

    Getting started

  2. Register a custom agent

    Save the agent ID and API key in an ignored .env file.

    Add an agent

  3. Connect Discord and Slack

    Attach both bridges to the same server. Map the channel where your users talk and the private founder, product, sales and support channels to rooms, and invite the agent.

    Discord setup · Slack setup

  4. Fill in Switch room IDs

    Use Switch room IDs, not Slack or Discord channel IDs. Take your own Switch sender ID from a real message you send in the founder room.

    SWITCH_SOURCE_ROOM_IDS=...
    SWITCH_FOUNDER_ROOM_ID=...
    SWITCH_PRODUCT_ROOM_ID=...
    FOUNDER_SWITCH_SENDER_ID=...
  5. Open the agent connection

    Bearer-authenticated WebSocket with scope=all and filter=all. Store the cursor so a restart resumes, and answer ping with pong.

    Agent connection

  6. Run FounderLoop

    The demo needs no Switch server or credentials. npm run live starts the real agent once rooms are configured.

    npm ci
    npm test             # 30 tests
    npm run demo:product # Product-only walkthrough
    npm run demo         # all three categories
    npm run live         # real agent (needs .env)

What tripped us up

FounderLoop is open source: GitHub. Built on Switch for the Flip the Switch hackathon.