Skip to main content
ClarkOS agents run on Convex serverless infrastructure. This guide covers deploying your agent backend and optional frontend.

Example Agent

See the reference implementation on GitHub

Quick Deploy

1

Deploy to Convex

You’ll get a production URL like https://your-project.convex.cloud
2

Set Environment Variables

In the Convex dashboard, add your environment variables:
3

Verify Deployment

Test the health endpoint:
That’s it. Your agent is now running with scheduled ticks via Convex crons.

Environment Variables

Required

VariableDescription
OPENROUTER_KEYLLM API key from OpenRouter
TICK_TOKENAuth token for tick endpoint (generate with openssl rand -hex 32)

Optional

VariableDefaultDescription
GEMINI_API_KEY-Google AI key for embeddings (free tier)
WRITE_TOKENSame as TICK_TOKENAuth for write operations

Frontend Deployment (Optional)

If you build a web frontend for your agent, deploy it to Vercel:
The example agent includes a terminal UI built with Ink. A web frontend is not required—the agent runs autonomously via the Convex backend.

Scheduled Ticks

Crons are defined in convex/crons.ts and deploy automatically:
Verify crons are running in the Convex dashboard under Schedules.

Manual Tick

Trigger a tick manually:

Monitoring

View logs and metrics in the Convex dashboard:
  • Logs - Real-time function execution logs
  • Data - Browse your agent’s state, memories, and knowledge
  • Schedules - Monitor cron job execution

Health Check

Security

  • Generate secure tokens: openssl rand -hex 32
  • Never commit tokens to git
  • Use Convex environment variables for secrets
  • The /tick endpoint requires TICK_TOKEN authentication

Next Steps

Testing

Test your agent locally

Custom Plugins

Extend agent capabilities