Skip to main content
Get Dream Foundry up and running in minutes. This guide walks you through executing your first competitive AI agent forge from scratch.

What You’ll Build

You’ll run a complete Dream Foundry workflow where 5 AI agents compete to generate a weekly “AI Events in the Bay Area” Discord post. The agents use different strategies (speed vs. quality vs. insider knowledge), and the best implementation wins.
The Demo Scenario: Multiple agents scrape AI/ML events from lu.ma and Meetup.com, get scored on quality, speed, and reliability, and the winner’s output gets published to Discord.

Prerequisites

Before you begin, ensure you have:
  • Python 3.12+ installed
  • Basic familiarity with command line
  • (Optional) API keys for advanced features:
    • DAYTONA_API_KEY - For isolated sandbox execution
    • SENTRY_DSN - For error monitoring
    • DISCORD_WEBHOOK_URL - For publishing results
    • ELEVENLABS_API_KEY - For winner announcement narration

Installation

1

Clone and navigate to the project

git clone <repository-url>
cd dream-foundry
2

Install dependencies

pip install -r requirements.txt
This installs core dependencies:
  • streamlit - Demo UI
  • beautifulsoup4, selenium, requests - Web scraping
  • sentry-sdk - Error monitoring
  • python-dotenv - Environment management
3

Configure environment (optional)

For the basic demo, no API keys are required. For full features:
cp .env.example .env
# Edit .env with your API keys
Without API keys, the forge runs in local mode (no Daytona sandboxes, no Discord publishing). This is perfect for testing!

Your First Forge Run

Run the forge with the default objective:
python forge.py
python forge.py
# Uses: "Generate weekly 'AI Events in San Francisco' post for Discord"

What Happens During Execution

You’ll see a 5-phase workflow in your terminal:
1

Initialization

============================================================
DREAM FOUNDRY - Forge Loop
============================================================
Objective: Generate weekly 'AI Events in San Francisco' post for Discord
Candidates: 5
Execution: LOCAL
2

Running Candidates

Each of the 5 agents executes:
PHASE: Running Candidates
----------------------------------------

[Agent Alpha]
  [Run] Starting Agent Alpha...
  [Done] Output produced
  [Done] 4.2s

[Agent Beta]
  [Run] Starting Agent Beta...
  [Done] Output produced
  [Done] 28.5s

[Agent Gamma]
  [Gamma] Fetching from lu.ma and Meetup...
  [Gamma] Verified: Daytona HackSprint SF
  [Gamma] Verified: AI Makerspace Weekly Meetup
  [Gamma] Found 10 verified events
  [Done] 3.1s

[Agent Delta]
  [Error] Timeout after 60 seconds
  [Sentry] Error captured

[Agent Epsilon]
  [Done] Output produced
  [Done] 2.8s
3

Scoring

============================================================
PHASE: Scoring
----------------------------------------
Candidate     Success  Quality    Speed    TOTAL
----------------------------------------------
alpha        PASS     75.6       86.0     77.2
beta         PASS     91.5       5.0      61.9
gamma        PASS     94.4       89.7     94.4
delta        FAIL     0.0        0.0      0.0
epsilon      PASS     54.5       90.7     63.1

  Quality: 10/10 valid events, Hackathon: Yes
Scoring Breakdown:
  • Success (20%): Did it produce output without errors?
  • Quality (60%): Valid events, correct dates (Jan 24-31, 2026), hackathon included, proper URLs
  • Speed (20%): Faster execution = higher score
4

Winner Selection

============================================================
WINNER: gamma (score: 94.4)
============================================================

Scores written to: artifacts/scores.json
Winner written to: artifacts/winner.txt

Artifacts produced:
  - artifacts/alpha/discord_post.md [exists]
  - artifacts/beta/discord_post.md [exists]
  - artifacts/gamma/discord_post.md [exists]
  - artifacts/delta/discord_post.md [missing]
  - artifacts/epsilon/discord_post.md [exists]
  - artifacts/scores.json
  - artifacts/winner.txt

Inspect the Results

View the winning output:
cat artifacts/gamma/discord_post.md

Example Output

# AI Events in the Bay Area
## Week of January 24-31, 2026

**Daytona HackSprint SF**
- Date: Saturday, January 24, 2026
- Time: 9:00 AM - 6:00 PM
- Location: San Francisco, CA
- Type: hackathon
- [RSVP](https://lu.ma/kga3qtfc) (via lu.ma)

**AI Makerspace Weekly Meetup**
- Date: Wednesday, January 28, 2026
- Time: 6:00 PM - 9:00 PM
- Location: San Francisco, CA
- Type: meetup
- [RSVP](https://lu.ma/aimakerspace) (via lu.ma)

...

---
*Found 10 verified events | Generated by Agent Gamma (The Insider)*

Option 2: Streamlit UI (Interactive Demo)

For a visual, 9-phase interactive demo:
streamlit run app.py
This launches a browser-based UI at http://localhost:8501 with:
  1. The Dreamcatcher - Input your objective
  2. The Dream Factory - View candidate strategies
  3. The Arena - Watch agents compete in real-time
  4. Arena Results - See the scoreboard
  5. Forge Runoff - Polish - CodeRabbit improvements (simulated)
  6. Forge Runoff - Retest - Re-run with polished code
  7. The Podium - Final winner announcement
  8. Showcase - ElevenLabs narration + Discord publishing
The Streamlit UI includes simulated CodeRabbit and ElevenLabs features for demonstration purposes. The CLI mode (forge.py) runs the actual competitive scoring system.

Understanding the Candidates

Each agent uses a different strategy:

Agent Alpha

The Speed DemonFast HTTP scraping with BeautifulSoup. Can’t handle JavaScript-rendered content.
  • ⚡ ~4-5s execution
  • ❌ Misses JS pages

Agent Beta

The PerfectionistUses Selenium for full page loads. Sees everything a human would.
  • ✅ Handles JS
  • 🐌 ~25-30s execution

Agent Gamma

The Insider (Usually Wins)Uses verified event database + direct API calls. Fast and reliable.
  • ⚡ ~3s execution
  • ✅ 10/10 quality

Agent Delta

The CrasherIntentionally unstable to demonstrate Sentry error monitoring.
  • ❌ Crashes frequently
  • 📊 Errors captured by Sentry

Agent Epsilon

The HallucinatorGenerates plausible but unverified data. Fast but unreliable.
  • ⚡ Very fast
  • ❌ 0/5 valid events

Next Steps

Full Installation

Set up all API keys for Daytona sandboxes, Sentry monitoring, and Discord publishing

Architecture

Learn how the 5-phase Dream Foundry pipeline works

Scoring System

Understand how candidates are scored on success, quality, and speed

Custom Agents

Build your own competing agent implementations

Troubleshooting

Make sure you installed dependencies:
pip install -r requirements.txt
This usually means a network issue or rate limiting. Check:
  • Internet connection
  • Firewall settings
  • Rate limits on lu.ma/Meetup (wait 5 minutes and retry)
Sentry batches events asynchronously. The forge includes sentry_sdk.flush() to force immediate sending. Verify your SENTRY_DSN in .env.
Ensure:
  • DAYTONA_API_KEY is set in .env
  • You have an active Daytona account
  • Network allows connections to Daytona API
Fallback: Remove --daytona flag to run locally
Rate Limiting: The agents scrape public lu.ma and Meetup pages. If you run the forge repeatedly (>5 times in a minute), you may hit rate limits. Wait 5 minutes between runs or use the --daytona flag to isolate requests.

Build docs developers (and LLMs) love