Get your first agent running in under 2 minutes. Let’s create an agent that streams back the message “hi”. This will introduce you to the fundamental concepts of local development with Cycls.
Prerequisites: Python 3.8 or higher

1. Installation

Get started by installing Cycls using pip.
pip install cycls

2. Build Your Agent

Create a file named agent.py and add the following code:
import cycls

# Initialize the agent
agent = cycls.Agent()

# Decorate your function to register it as an agent
@agent()
async def hello(context):
    yield "hi"

# Run your agent locally
agent.run()

3. Run Your Agent

Now let’s test your agent locally. Run the file from your terminal:
python agent.py
This starts a local development server. You’ll see output similar to this:
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
Open your browser to http://127.0.0.1:8000. You’ll see a ready-to-use web UI where you can interact with your agent instantly.

Next Steps

Congratulations! You’ve successfully built and tested your first agent locally. Here are suggested next steps to enhance your agent:

Build an LLM Agent

Learn how to integrate OpenAI’s GPT models to create intelligent conversational agents that can understand context and provide helpful responses.

Configure Your Agent

Explore agent configuration options including dependencies, authentication, deployment settings, and custom UI themes.

Work with Context & User Data

Learn how to access conversation history, user information, and build more sophisticated agents that remember previous interactions.

Deploy to the Cloud

Push your agent to Cycls cloud to make it available worldwide with authentication, and scaling capabilities.

Troubleshooting

If you encounter issues during the setup process, check these common troubleshooting solutions: