Skip to main content
This tutorial is for developers new to Cycls. You will build a research agent that searches the web, writes files into the user’s workspace, and shows the result on the canvas. It takes about fifteen minutes. Prerequisites
  • Python 3.10 or newer
  • Docker running, for the local step
  • CYCLS_API_KEY from Cycls Cloud
  • ANTHROPIC_API_KEY
1

Set up the directory

Create two env files. The first stays on your machine, the second ships inside the container.
.env
.providers.env
2

Write the agent

atlas.py
Four declarations and a body. image describes the container, chats is where conversations and files live, web configures the interface and sign-in, and llm configures the model.
3

Run it

The first build takes a minute or two. When it finishes, open http://localhost:8080 and ask a question. Saving the file rebuilds and reloads.
4

Add tools

Replace the llm block:
Save, then ask for something that needs work, for example:
Compare the three largest Saudi banks by total assets and write the result to banks.md.
The agent searches, writes the file into the workspace, and opens it on the canvas. Each tool carries its own prompt guidance, so nothing else is needed.sandbox(network=False) removes network access from the bash tool. Web search still works, because it runs outside the sandbox.
5

Brand it

The name and description appear on the empty chat screen. Add logo="./icon.svg" once you have an icon.
6

Track cost

Prices are USD per million tokens. With them set, every turn logs its cost and cycls cost atlas reports spend.
7

Limit the free tier

context.prod is False under cycls run, so your local loop is never blocked.
8

Deploy

Check it is live, then watch it:

The finished file

atlas.py

Where to go next

Add a custom tool

Call your own API from the agent.

Query a data warehouse

Parquet on a volume, read with DuckDB.