Skip to main content

Backend Setup Guide

This guide covers how to set up and run the AgentOps backend services from the /app directory. The backend includes the API server, dashboard, database services, and observability infrastructure.

Architecture Overview

The AgentOps backend consists of several interconnected services:
  • API Server (api/) - FastAPI backend with authentication, billing, and data processing
  • Dashboard (dashboard/) - Next.js frontend for visualization and management
  • Supabase - Authentication and primary PostgreSQL database
  • ClickHouse - Analytics database for traces and metrics
  • OpenTelemetry Collector - Observability and trace collection
  • Redis (optional) - Caching and session storage

Prerequisites

Before setting up the backend, ensure you have the following installed:

Required Software

External Services

You’ll need accounts and setup for these external services:

Quick Start

1. Clone and Navigate

2. Environment Setup

Copy and configure environment files:

3. Install Dependencies

4. Configure External Services

Update your .env files with your service credentials. See External Services Configuration below.

5. Start Services

6. Verify Setup

External Services Configuration

Supabase Setup

  1. Create a new project at supabase.com
  2. Go to Settings → API to get your keys
  3. Run the database migrations:
  4. Update your .env files with:

ClickHouse Setup

  1. Sign up for ClickHouse Cloud or self-host
  2. Create a database and get connection details
  3. Run the ClickHouse migrations:
  4. Update your .env files with:

Stripe Setup (Optional)

For billing functionality:
  1. Create a Stripe account
  2. Get your API keys from the dashboard
  3. Update your .env files with:

Additional Services (Optional)

  • Sentry: Error monitoring
  • PostHog: Analytics

Development Workflow

The justfile provides convenient commands for development:

Manual Development

If you prefer running services manually:

Service Configuration

API Server Configuration

Key environment variables for the API server (api/.env):

Dashboard Configuration

Key environment variables for the dashboard (dashboard/.env.local):

Troubleshooting

Common Issues

Port conflicts:
Database connection issues:
  • Verify your Supabase and ClickHouse credentials
  • Check network connectivity to external services
  • Ensure database migrations have been applied
Docker issues:
Dependency issues:

Logs and Debugging

Next Steps

Once your backend is running:
  1. Create an account at http://localhost:3000
  2. Generate an API key in the dashboard
  3. Install the AgentOps SDK and start tracking your AI agents
  4. Explore the dashboard to view traces and analytics
For production deployment, see our Deployment Guide.