Example Agent
See the reference implementation on GitHub
Quick Deploy
Set Environment Variables
In the Convex dashboard, add your environment variables:
Environment Variables
Required
| Variable | Description |
|---|---|
OPENROUTER_KEY | LLM API key from OpenRouter |
TICK_TOKEN | Auth token for tick endpoint (generate with openssl rand -hex 32) |
Optional
| Variable | Default | Description |
|---|---|---|
GEMINI_API_KEY | - | Google AI key for embeddings (free tier) |
WRITE_TOKEN | Same as TICK_TOKEN | Auth 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 inconvex/crons.ts and deploy automatically:
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
/tickendpoint requiresTICK_TOKENauthentication