Skip to main content
Build and ship your first Autonomy application step-by-step. This walkthrough helps you understand how the parts of a simple Autonomy app fit together.
  1. Follow the initial instructions to Get Started with Autonomy.
  2. Then continue on to the following steps:

Step 1: Create a new directory

Create a new directory for your app.
All subsequent commands should be run from inside this hello directory.

Step 2: Create autonomy.yaml

Create a file named autonomy.yaml in the hello directory with the following content:
autonomy.yaml
This configuration file defines a zone in the Autonomy Computer. Think of a zone as your app’s dedicated infrastructure. The Autonomy Computer provisions everything needed to run it.
  • name: hello - The zone’s name (must be ≤ 10 characters, using only a to z and 0 to 9).
  • pods - List of pods to create in this zone (a pod is a group of containers that run together).
  • public: true - Serve the HTTP server on port 8000 of this pod on a public address over HTTPS.
  • containers - List of containers in the main-pod.
  • image: main - Create the main container using the image defined in images/main.

Step 3: Create the image directory

Create the directory structure for your container images:
Your project structure now looks like:

Step 4: Create a Dockerfile

Create images/main/Dockerfile with the following content:
images/main/Dockerfile
  • The base image is pre-installed with Python and the Autonomy Framework.
  • Copy all files from images/main/ into the container.
  • Run main.py when the container starts.

Step 5: Create the application code

Create images/main/main.py with the following content:
images/main/main.py
This Python module:
  1. Imports modules from the Autonomy Framework - Agent, Model, and Node
  2. Defines an async main function that:
    • Starts an agent named “henry”
    • Gives it instructions to act as a legal assistant
    • Configures it to use Claude Sonnet 4 model
  3. Starts an Autonomy Node - This creates the actor runtime that hosts your agent. It also starts an HTTP server on port 8000 with a set of built-in APIs to interact with your agent.
Built-in tools: Your agent automatically has access to a set of built-in tools:
  • get_current_time_utc - Get current time in UTC.
  • get_current_time - Get current time in any timezone.

Step 6: Create a web interface

Create images/main/index.html with the following content:
images/main/index.html
This HTML file creates a simple chat interface that:
  1. Displays an input text area where users type messages.
  2. Calls the agent’s streaming API at /agents/henry?stream=true.
  3. Shows responses using a typewriter effect character by character.
  4. Handles streaming JSON responses from the agent.
The Autonomy Node’s default HTTP server automatically serves index.html at the root of the pod’s URL. The complete code structure now looks like:

Step 7: Enroll with your cluster

Connect your workstation to your cluster in Autonomy Computer:
This command:
  1. Displays a code.
  2. Opens your browser for authentication.
  3. Completes enrollment once you sign in.
You only need to do this once per workstation.

Step 8: Deploy your app

Deploy your zone to the Autonomy Computer:
This command:
  1. Builds the container image.
  2. Pushes the image to your cluster.
  3. Deploys the zone with its pods and containers.
The deployment takes a couple of minutes to fully start.

Step 9: Your zone’s URL

Your zone’s URL follows this pattern:
To find your cluster and zone names, run:
For example, if your cluster is a25bff50 and zone is hello, your URL is:

Step 10: Test the Agent API

Test that your agent is responding to API calls: Non-streaming request:
Streaming request:
Replace ${CLUSTER} and ${ZONE} with your actual cluster and zone names.

Step 11: Open your app in a browser

Open your web interface:
You should see the chat interface. Try asking Henry questions like:
  • “What are the key elements of a contract?”.
  • “What is consideration in contract law?”.
  • “Explain breach of contract.”.

Step 12: View logs (optional)

To view logs from your deployed zone, create a private encrypted portal to the logs server in your zone:
This creates a private link to the logs server on localhost and displays the address http://127.0.0.1:32101. Open it in your browser to see streaming logs for all containers in the zone.

Common Issues and Solutions

Zone names must be 10 characters or less, using only a to z and 0 to 9. Edit autonomy.yaml and change the name field to something shorter.
Start Docker Desktop or your Docker daemon. Verify with docker ps.
Run source "$HOME/.autonomy/env" to add the command to your PATH.
Wait a couple of minutes after deployment.
Check the logs using the portal method shown in Step 12. Look for errors in the pod startup or agent initialization.
Verify that index.html is in images/main/ and was included in the container build. Redeploy with autonomy zone deploy.

Update Your App

To make changes to your app:
  1. Edit your files (e.g., change the agent instructions in main.py).
  2. Redeploy with autonomy zone deploy.
  3. Wait a couple of minutes for the new version to be ready.
  4. Test your changes.
Each deployment creates a new version of your zone and replaces the old version.

Delete the zone

When you’re done experimenting, delete your zone to free up resources:

Learn More

Agents

Create deep work agents.

Tools

Give agents the ability to take actions.