Your First Agent

Let’s create your first AI agent! In this guide, we’ll build a simple agent that can help with everyday tasks.

Prerequisites

Make sure you have:
  • Atlas installed and running (atlas daemon status)
  • An Anthropic API key set up
  • A workspace initialized (atlas init)

Step 1: Define Your Agent

Open your workspace.yml file and add your first agent:
version: "1.0"

workspace:
  name: "my-workspace"
  description: "My first Atlas workspace"

agents:
  assistant:
    type: "llm"
    model: "claude-3-5-sonnet-20241022"
    purpose: "A helpful AI assistant for various tasks"
    prompts:
      system: |
        You are a helpful AI assistant. You're friendly, concise, and focused on helping the user accomplish their goals.
        
        When asked to help with tasks:
        - Break down complex tasks into steps
        - Ask clarifying questions when needed
        - Provide clear, actionable responses

Step 2: Create a Signal

Signals trigger your agents. Add a CLI signal to your configuration:
signals:
  chat:
    provider: "cli"
    description: "Chat with the assistant"

Step 3: Create a Job

Jobs define how agents respond to signals:
jobs:
  chat-job:
    triggers:
      - signal: "chat"
    execution:
      strategy: "sequential"
      agents:
        - id: "assistant"
          input_source: "signal"

Step 4: Run Your Agent

Now you can chat with your agent! In your terminal:
# Trigger the agent with a message
atlas signal trigger chat --data '{"message": "Hello! What can you help me with?"}'

# Or use the interactive mode
atlas
# Then type: /signal trigger chat --data {"message": "Hello!"}

Step 5: Monitor the Session

Watch your agent work:
# List active sessions
atlas ps

# Stream logs from your session
atlas logs <session-id>

What’s Happening?

When you trigger the signal:
  1. Atlas receives the signal and finds the matching job
  2. The WorkspaceSupervisor creates a session
  3. The SessionSupervisor coordinates agent execution
  4. Your agent processes the input and responds
  5. The response is logged and the session completes

Next Steps

Now that you have a working agent:
  • Try giving it different prompts and purposes
  • Add tools to make it more capable
  • Create multiple agents that work together
  • Explore the ConversationAgent for interactive chats
Congratulations! You’ve created your first Atlas agent. 🎉