This guide will help you develop, deploy, and invoke your first Agent in 5 minutes.
Table of Contents
Overview
The complete workflow consists of 4 steps:
- β
Integrate SDK - Add decorators to your Agent code
- β
Configure Agent - Generate configuration files using CLI
- β
Deploy Agent - One-click deployment to the cloud
- β
Invoke Agent - Call your Agent using SDK or CLI
Prerequisites
Ensure you have the following prerequisites:
- β
Python 3.9+ and Node.js 20+ installed
- β
Beta version Python SDK and Node.js CLI installed (see Installation Guide)
- β
Novita AI API Key obtained (from the Console)
- β
Docker installed
Step 1: Integrate SDK into Your Agent
1.1 Create Agent Code
Create app.py in your project directory:
1.2 Prepare Dependencies File
Ensure your project root has a requirements.txt file with the required dependencies:
1.3 Local Testing
Test locally before deployment:
In another terminal, test the endpoints:
Expected output:
Health check should return:
Agent invocation should return:
Step 2: Generate Configuration Files with CLI
Use CLI to interactively configure your Agent:
Follow the CLI prompts to configure the required information. When complete, the CLI will generate the following files in your project directory:
novita.Dockerfile - Docker build file
.dockerignore - Docker ignore file
.novita-agent.yaml - Agent configuration file
Step 3: Deploy to Novita AI with One-click
β οΈ Important: After successful deployment, an agent_id will be generated. This is the unique identifier for invoking your Agentβmake sure to save it.
3.1 Deploy Command
Deploy with one-click using CLI:
3.2 View Deployment Results
After successful deployment, the .novita-agent.yaml file will update the status field:
Record the agent_idβyouβll need it for subsequent invocations.
Step 4: Invoke Agent via CLI or SDK
Option 1: Quick Test with CLI
Quickly test your Agent using CLI:
Note: The CLI automatically reads the Agent ID from the status.agent_id field in .novita-agent.yaml.
Expected output:
Option 2: SDK Invocation (Recommended for Production)
Use the SDK to invoke your Agent in backend services:
Example Code
Q1: How do I get the Agent ID?
After successful deployment, the Agent ID is saved in the status.agent_id field of the .novita-agent.yaml file:
Q2: What if deployment fails?
- Check dependencies file: Ensure
requirements.txt contains all dependencies
- View detailed logs: Use the
--verbose flag
- Check network connection: Ensure you can access the Novita AI Sandbox domain (e.g.,
sandbox.novita.ai)
- Verify API Key: Confirm
NOVITA_API_KEY is correct
Q3: How do I update a deployed Agent?
Modify your code and redeploy:
Q4: Works locally but fails after deployment?
Possible causes:
- Environment variables not passed to sandbox instance
- Dependency package version inconsistencies
- File path issues
Solution:
Pass environment variables to the sandbox instance via the envVars parameter:
Last modified on November 27, 2025