Build from Source
Building from source is ideal for scenarios where you need to develop and debug on the Server side.
Prerequisites
Section titled “Prerequisites”- Go 1.27+
- PostgreSQL 17+ (with pgvector extension) — recommend using the
pgvector/pgvector:pg17image - Redis 7+
- LLM API — Claude or OpenAI-compatible interface
1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/rtc-agent/server.gitcd server2. Start Infrastructure
Section titled “2. Start Infrastructure”Use the development Docker Compose to start PostgreSQL, Redis, etc.:
# Start dev dependencies (PostgreSQL:15432, Redis:16379, Jaeger, Mock OAuth2, etc.)go run main.go dev dependencies startOr start Docker manually:
docker compose -f etc/dev/docker-compose.yml up -d3. Configuration
Section titled “3. Configuration”Copy the config template and edit:
cp etc/config.example.yaml etc/config.local.yamlEdit etc/config.local.yaml, modifying at least the following fields:
database: dsn: "postgres://rtc_agent:rtc_agent@localhost:15432/rtc_agent?sslmode=disable"
redis: addr: "localhost:16379"
llm: provider: "claude" # or "openai" api_key: "${LLM_API_KEY}" # Injected via env var — set LLM_API_KEY before starting model: "claude-sonnet-4-20250514"Config merging: On startup, the Server automatically loads
etc/config.yaml(baseline) +etc/config.local.yaml(overrides).config.local.yamlis already in.gitignoreand will not be committed. Only write the diff items.🔐 API Key security:
api_keysupports${ENV_VAR}syntax to reference environment variables, avoiding plaintext keys in config files. Setexport LLM_API_KEY="your-key"before starting.
4. Build & Run
Section titled “4. Build & Run”# Buildgo build -o bin/rtc-agent .
# Database migration (first deployment)./bin/rtc-agent migrate
# Start the service./bin/rtc-agent serveThe service starts at http://localhost:8888.
5. Verify
Section titled “5. Verify”curl http://localhost:8888/healthz# {"status":"ok"}6. Embed Frontend
Section titled “6. Embed Frontend”After the Server is running, add the <rtc-agent> component to your web page:
<script type="module" src="https://cdn.example.com/rtc-agent/index.js"></script><rtc-agent></rtc-agent>See Web Component API for details.
Next Steps
Section titled “Next Steps”- Getting Started — Back to overview
- Distributed Cluster Deployment — Multi-Worker deployment
- Configuration Reference — Full configuration options