Verified by the sovseal team

Deploy Self-Hosted

Deploy the v2-agent-state edge function and Postgres schema.

Overview

The sovseal edge replication backend is open-source and self-hostable. It is designed to run as a Deno/Hono edge function targeting your own Supabase project, or via a Docker container stack.


Deployment Option A: Supabase Edge Functions (Deno + Hono)

This option deploys the replication service into your own Supabase instance.

Prerequisites

  • Supabase CLI installed locally (brew install supabase/tap/supabase on Mac).
  • A Supabase Project created in the Supabase Dashboard.
  • PostgreSQL 15+ with the pgvector extension enabled.

Step 1: Initialize Supabase Locally

Log in to your Supabase CLI and link it to your remote project:

supabase login
supabase link --project-ref your-project-ref

Step 2: Apply Database Migrations

Run the SQL schema script located under the supabase/migrations/ directory to create the agent_state_snapshots table and setup Row-Level Security (RLS) policies:

supabase db push

Step 3: Deploy the Edge Function

Deploy the v2-agent-state Deno Hono handler:

supabase functions deploy v2-agent-state --project-ref your-project-ref

Step 4: Configure Edge Environment Variables

Set the following environment secrets in your remote Supabase instance:

supabase secrets set JWT_SECRET="your-long-jwt-secret"
supabase secrets set OPENAI_API_KEY="your-openai-api-key"

Deployment Option B: Docker Compose

For environments running outside Supabase, use our Docker Compose configuration to deploy the replication engine and dashboard on your virtual machine.

Prerequisites

  • Docker & Docker Compose installed.
  • Open ports 8888 (API server) and 3000 (web dashboard).

Step 1: Copy Environment Template

Create .env file from the example in the server folder:

cp server/.env.example server/.env

Fill in the mandatory variables:

  • OPENAI_API_KEY: Sourced for embedding extraction.
  • JWT_SECRET: For signing API keys.
  • ADMIN_API_KEY: Shared static admin key for fallback.

Step 2: Start the Stack

Boot the containers (API server, Postgres/pgvector db, and Dashboard app):

cd server
make up

CORS & Security Settings

By default, the server allows cross-origin requests from http://localhost:3000. In production, restrict requests by setting:

DASHBOARD_URL="https://dashboard.yourdomain.com"

Verification

To verify that your self-hosted instance is correctly running and accepting connections, test the endpoint with a local client:

import { MemoryClient } from "@sovseal/sdk";

const client = new MemoryClient({
  apiKey: "your-api-key",
  // Point the SDK to your self-hosted endpoint
  endpoint: "https://your-project-ref.supabase.co/functions/v1/v2-agent-state"
});

// Test verification status
const testRes = await client.getSyncStatus();
console.log("Self-hosted connection status:", testRes.state);

On this page