---
title: "Best Practices"
description: "Always test agents locally before deploying to edge. Edge deployments have their own cost structure. Monitor via the dashboard. Enable Durable Objects for agents that need persistent state at the edge. Configure routes t"
resource: https://www.aiagents.nexus/docs/manual/edge-deployment/best-practices
generated: { by: "process:nexus-agent-assets", at: 2026-09-07T09:13:03Z }
status: stable
---

# Edge Deployment Best Practices

## 1. Test Locally First

Always test agents locally before deploying to edge.

## 2. Monitor Costs

Edge deployments have their own cost structure. Monitor via the dashboard.

## 3. Use Durable Objects for State

Enable Durable Objects for agents that need persistent state at the edge.

## 4. Set Up Routes

Configure routes to direct traffic to the right agents:

```yaml
edge:
  routes:
    - pattern: "api.example.com/research/*"
      agent: researcher
    - pattern: "api.example.com/analyze/*"
      agent: analyzer
```

## 5. Monitor Latency

Check regional latency in the dashboard to ensure good performance globally.
