Hello World Tutorial

Welcome to Atlas! In this tutorial, you’ll create your first AI agent and see it in action. This takes about 5 minutes.

Prerequisites

Before starting, ensure you have:
  • Atlas installed (Installation Guide)
  • Atlas daemon running (atlas daemon start)
  • An Anthropic API key set (export ANTHROPIC_API_KEY="your-key")

Step 1: Create a Workspace

Create a new directory for your project:
mkdir hello-atlas
cd hello-atlas
Initialize an Atlas workspace:
atlas init "Hello World"
This creates a workspace.yml file. Let’s look at it:
cat workspace.yml
You’ll see a basic structure:
version: "1.0"

workspace:
  name: "Hello World"
  description: "AI-powered workspace for Hello World"

agents: {}
signals: {}
jobs: {}

Step 2: Add Your First Agent

Edit workspace.yml to add a friendly agent:
version: "1.0"

workspace:
  name: "Hello World"
  description: "My first Atlas workspace"

agents:
  greeter:
    type: "llm"
    model: "claude-3-5-haiku-20241022"
    purpose: "Greet people warmly"
    prompts:
      system: |
        You are a friendly greeter. When someone says hello,
        respond warmly and ask them about their day.
        Keep responses brief and cheerful.

signals:
  hello:
    provider: "cli"
    description: "Say hello to the agent"

jobs:
  greet:
    triggers:
      - signal: "hello"
    execution:
      agents:
        - id: "greeter"
          input_source: "signal"

Step 3: Test Your Agent

Trigger your agent:
atlas signal trigger hello --data '{"message": "Hello!"}'
You should see output like:
[INFO] Signal 'hello' triggered successfully
[INFO] Job 'greet' started with session ID: abc-123-def
[INFO] Agent 'greeter' executing...
[INFO] Response: Hello there! 👋 How wonderful to meet you! How has your day been treating you so far?
[INFO] Job completed successfully

Step 4: Make It Interactive

Let’s add more personality. Update your agent:
agents:
  greeter:
    type: "llm"
    model: "claude-3-5-haiku-20241022"
    purpose: "Greet people warmly"
    prompts:
      system: |
        You are a friendly greeter. When someone says hello:
        1. Greet them warmly
        2. Make a positive observation
        3. Ask an engaging question
        
        If they provide their name, use it in your response.
        Keep responses under 50 words.
Now try with a name:
atlas signal trigger hello --data '{"message": "Hello, I'm Alice!"}'

Step 5: Add Another Agent

Let’s create a multi-agent workflow. Update your workspace.yml:
agents:
  greeter:
    type: "llm"
    model: "claude-3-5-haiku-20241022"
    purpose: "Greet people warmly"
    prompts:
      system: |
        You are a friendly greeter. Greet the person warmly
        and pass along any interesting details about them.
  
  fortune-teller:
    type: "llm"
    model: "claude-3-5-haiku-20241022"
    purpose: "Give fun fortunes"
    prompts:
      system: |
        You are a whimsical fortune teller. Based on someone's
        greeting, give them a fun, positive fortune for their day.
        Be creative and encouraging! Keep it under 30 words.

jobs:
  greet-and-fortune:
    triggers:
      - signal: "hello"
    execution:
      strategy: "sequential"
      agents:
        - id: "greeter"
          input_source: "signal"
          task: "Greet this person warmly"
        
        - id: "fortune-teller"
          input_source: "previous"
          task: "Give them a fortune based on their greeting"
Test the workflow:
atlas signal trigger hello --data '{"message": "Hello, I'm feeling lucky today!"}'

Step 6: Monitor Your Sessions

See what’s happening in real-time:
# List active sessions
atlas ps

# View session logs
atlas logs <session-id>

# Or use interactive mode
atlas
In interactive mode, you can:
  • See live logs in the right panel
  • Use /signal trigger hello to test
  • Navigate with vi-style keys (j/k)

Step 7: Add a Schedule

Make your agent greet you every morning. Add to signals:
signals:
  hello:
    provider: "cli"
    description: "Say hello to the agent"
  
  morning-greeting:
    provider: "schedule"
    description: "Morning greeting"
    config:
      schedule: "0 9 * * *"  # 9 AM daily
      timezone: "America/New_York"
      data:
        message: "Good morning! Time to start the day!"
Update your job to handle both signals:
jobs:
  greet-and-fortune:
    triggers:
      - signal: "hello"
      - signal: "morning-greeting"
    execution:
      # ... same as before

What You’ve Learned

Congratulations! You’ve just:
  • ✅ Created an Atlas workspace
  • ✅ Defined AI agents with personalities
  • ✅ Set up signals to trigger workflows
  • ✅ Built multi-agent workflows
  • ✅ Monitored agent execution
  • ✅ Added scheduled automation

Next Steps

Now that you understand the basics:
  1. Explore Agent Types: Try the ConversationAgent for interactive chats
  2. Add Tools: Give agents tools like web search
  3. Build Something Real: Try the Chat Assistant Tutorial
  4. Learn Patterns: Explore Multi-Agent Workflows

Complete Code

Here’s the final workspace.yml:
version: "1.0"

workspace:
  name: "Hello World"
  description: "My first Atlas workspace"

agents:
  greeter:
    type: "llm"
    model: "claude-3-5-haiku-20241022"
    purpose: "Greet people warmly"
    prompts:
      system: |
        You are a friendly greeter. Greet the person warmly
        and pass along any interesting details about them.
  
  fortune-teller:
    type: "llm"
    model: "claude-3-5-haiku-20241022"
    purpose: "Give fun fortunes"
    prompts:
      system: |
        You are a whimsical fortune teller. Based on someone's
        greeting, give them a fun, positive fortune for their day.
        Be creative and encouraging! Keep it under 30 words.

signals:
  hello:
    provider: "cli"
    description: "Say hello to the agent"
  
  morning-greeting:
    provider: "schedule"
    description: "Morning greeting"
    config:
      schedule: "0 9 * * *"
      timezone: "America/New_York"
      data:
        message: "Good morning! Time to start the day!"

jobs:
  greet-and-fortune:
    triggers:
      - signal: "hello"
      - signal: "morning-greeting"
    execution:
      strategy: "sequential"
      agents:
        - id: "greeter"
          input_source: "signal"
          task: "Greet this person warmly"
        
        - id: "fortune-teller"
          input_source: "previous"
          task: "Give them a fortune based on their greeting"
Happy building with Atlas! 🚀