← Back to all playbooks

Ryan

RYAN CARSON: AMP infinite loop agent
Start: 01:30:04
Sketch note for Ryan's session
TL;DR

Shift from manual feature planning to an autonomous 'Compound Product' loop that analyzes database metrics, generates PRDs, and executes code changes via non-interactive Bash scripts.

Key Insights

Non-Interactive Agent Spawning via CLI

01:38:45

Use CLI flags like 'amp -x' to trigger agents from Bash scripts. This allows you to run multiple background instances without manual oversight, bypassing the bottleneck of interactive chat interfaces.

Tiered Memory Architecture for Agents

01:50:53

Manage agent context using three layers: Long-term (model weights), Medium-term (agents.md for repo-wide rules), and Short-term (progress.txt for current session gotchas). This prevents agents from repeating mistakes within a single feature build.

Direct Postgres-to-Prompt Pipelines

01:40:40

Automate product management by having a script pull raw Postgres data directly into an LLM prompt. The agent acts as a 'VP of Product,' identifying funnel leaks and writing its own implementation tickets.

Atomic Task JSONs for State Management

01:49:51

Convert PRDs into JSON files containing tasks with boolean 'completed' flags. This allows a Bash loop to track progress across multiple agent restarts and ensures clear acceptance criteria for autonomous verification.

Systems

Compound Product Loop

  1. Run a midnight cron job to pull acquisition/retention data from Postgres.
  2. Generate a Markdown report using Opus 4.5 to identify the #1 product priority.
  3. Use a Bash script to analyze the report and generate an analysis.json file.
  4. Spawn an agent to create a feature branch and write a PRD with atomic user stories.
  5. Execute a 'Ralph Loop' that iterates through tasks.json, implementing and committing code.
  6. Use 'Agent Browser' to autonomously verify browser-based acceptance criteria.
  7. Push the final PR for human review.
Tools: AMP, Postgres, Agent Browser, Claude Code, Opus 4.5

Tools

AMPClaude CodePostgresAgent BrowserOpus 4.5GitHub