Maintenance and Updates › Setting Up a Development Environment
AI Agent HandbookAll chapters Maintenance and Updates › Setting Up a Development EnvironmentOne section · Sections in this chapter4 / 19 ↓
The foundation of safe updates is having a separate environment where you can test changes without affecting users. This is called a development environment (or dev environment).
Your setup should include at least two versions of your agent:
Production: The version users interact with. This runs on your deployment platform and handles real requests. You only update production after thoroughly testing changes.
Development: Your testing version. This runs locally or on a separate server. You make changes here first, test them, and only promote to production when you're confident they work.
Many teams also have a third environment:
Staging: A middle ground between development and production. Staging uses the same infrastructure as production (same database, same deployment platform) but isn't exposed to real users. You deploy to staging to test that everything works in a production-like environment before the final deployment.
Here's how this typically works:
Make changes → Test in development → Deploy to staging → Test again → Deploy to productionEach step gives you a chance to catch problems before they reach users.
Keeping Environments in Sync
For this workflow to work, your environments need to be similar enough that testing in development actually predicts how production will behave. This means:
- Use the same Python version across environments
- Use the same versions of dependencies
- Use similar data (production uses real user data, but development should have realistic test data)
- Use the same configuration structure (environment variables, etc.)
You can use tools like Docker to ensure consistency. A Docker container packages your agent with all its dependencies, and the same container can run in development, staging, and production.