Getting Started

Practical setup · copy-paste commands · Bun + TypeScript

Chat Agent Relay sits between your chat platform and your AI agent. This guide gets you from zero to a running server: install dependencies, wire Slack and OpenAI, start the process, verify with tests or Docker, and hit the HTTP API.

Prerequisites

Before you start, you need:

Clone the repo if you have not already:

terminal
$ git clone https://github.com/ChatAgentRelay/ChatAgentRelay.git $ cd ChatAgentRelay

Installation

Install all workspace dependencies from the repository root:

terminal
$ bun install

That pulls everything the monorepo needs so you can run the server and the full test suite.

Configuration

Create a .env for the server (start from .env.example in packages/server if the repo provides one). At minimum, set:

Optional tuning (only if you need them):

.env
# Required SLACK_BOT_TOKEN=xoxb-your-bot-token SLACK_APP_TOKEN=xapp-your-app-token OPENAI_API_KEY=sk-your-openai-key # Optional examples # OPENAI_BASE_URL=https://api.openai.com/v1 # OPENAI_MODEL=gpt-4o # CAR_API_PORT=3000

Running the server

Start Chat Agent Relay from the server package so Bun resolves the right entrypoint and env:

terminal
$ cd packages/server && bun run start

When it is up, the HTTP API is available on the configured port (typically localhost:3000). Use /api/health to confirm the process is live.

Testing

Run the full test corpus from the repository root to validate contracts and behavior across packages:

terminal
$ bun test --recursive # 222 tests across packages (run from repo root).

Use this after dependency upgrades or local changes to ensure nothing regressed at the boundaries.

Docker

To run with containers instead of a local Bun process:

terminal
$ docker compose up -d

Mount or inject the same environment variables your .env would provide so Slack and OpenAI credentials reach the container.

CLI: car-server

The server binary supports the usual operational flags:

terminal
$ car-server --check-config $ car-server --version

HTTP API

With the server listening (default http://localhost:3000), you can:

Replace :id with your conversation identifier from Slack or your channel adapter.

terminal
$ curl -s http://localhost:3000/api/health $ curl -s http://localhost:3000/api/conversations/C123456/events $ curl -s http://localhost:3000/api/conversations/C123456/audit

Connect your agent

If your agent has an HTTP endpoint, you can connect it without writing any adapter code. The built-in GenericHttpBackend supports:

For non-HTTP protocols or more advanced integration patterns:

← Back to home Repository