Research agent scrapes and summarizes sources → Writer agent drafts → Editor agent revises → Publisher agent posts. One complete blog post produced per heartbeat cycle.
A fully autonomous content production company that publishes two blog posts per week on AI topics without human intervention (except approval gates for final publishing).
Company: AI Content Co
Monthly budget: $40
Agents:
1. Trend Spotter ($6) — Monitors Hacker News & Reddit for trending AI topics
2. Topic Planner ($4) — Selects 2 topics/week, avoids duplication
3. Researcher × 2 ($8×2) — Parallel deep-dive research per topic
4. Writer × 2 ($5×2) — Drafts 1000-word articles from research
5. Editor ($3) — Quality, tone, and fact-checking review
6. Publisher ($1) — Formats and pushes to CMS via API
DO $$
DECLARE
cid uuid;
BEGIN
INSERT INTO companies (name, slug, monthly_budget_usd)
VALUES ('AI Content Co', 'ai-content-co', 40.00)
ON CONFLICT (slug) DO NOTHING
RETURNING id INTO cid;
IF cid IS NULL THEN SELECT id INTO cid FROM companies WHERE slug = 'ai-content-co'; END IF;
INSERT INTO agents (company_id, name, role, system_prompt, adapter_type, monthly_budget_usd, status)
VALUES
(cid, 'Trend Spotter', 'Market Research Analyst',
'You monitor AI trends. Given the current date, list 10 trending AI topics from Hacker News, Reddit r/MachineLearning, and arXiv. Output JSON: {"topics": [{"title": "...", "source": "...", "why_trending": "..."}]}',
'claude-code', 6.00, 'active'),
(cid, 'Topic Planner', 'Editorial Planner',
'You select 2 topics for this week''s blog posts from a provided list. Avoid topics already covered (provided as history). Output JSON: {"selected": [{"title": "...", "angle": "...", "target_audience": "..."}]}',
'claude-code', 4.00, 'active'),
(cid, 'Researcher A', 'Research Analyst',
'You research a single AI topic in depth. Produce a structured research note: summary (3 sentences), 7 key facts with sources, 3 expert perspectives, and a "further reading" list. Output JSON.',
'claude-code', 8.00, 'active'),
(cid, 'Researcher B', 'Research Analyst',
'You research a single AI topic in depth. Produce a structured research note: summary (3 sentences), 7 key facts with sources, 3 expert perspectives, and a "further reading" list. Output JSON.',
'claude-code', 8.00, 'active'),
(cid, 'Writer A', 'Content Writer',
'You write 1000-word blog posts from a structured research note. Style: educational, conversational, developer audience. Structure: hook intro, 3 H2 sections, key takeaways, CTA. Output markdown.',
'claude-code', 5.00, 'active'),
(cid, 'Writer B', 'Content Writer',
'You write 1000-word blog posts from a structured research note. Style: educational, conversational, developer audience. Structure: hook intro, 3 H2 sections, key takeaways, CTA. Output markdown.',
'claude-code', 5.00, 'active'),
(cid, 'Editor', 'Copy Editor',
'You review blog post drafts. Check: accuracy, clarity, grammar, tone consistency, and CTA effectiveness. Output the improved draft with 3-5 inline comments. If quality is poor, set {"needs_revision": true}.',
'claude-code', 3.00, 'active'),
(cid, 'Publisher', 'Content Publisher',
'You publish approved blog posts to the CMS. Format the markdown as HTML, generate a slug, set categories and tags from the topic. Call the CMS API and return {"published": true, "url": "..."}.',
'shell', 1.00, 'active');
END $$;
Set the heartbeat to run every 15 minutes:
UPDATE companies SET heartbeat_cron = '*/15 * * * *' WHERE slug = 'ai-content-co';
Seed the first Trend Spotter task (recurring weekly trigger):
-- Scheduled for every Monday 08:00 UTC
INSERT INTO issues (company_id, title, assigned_agent_id, due_at, priority, status)
SELECT
id,
'Weekly trend scan: ' || to_char(now(), 'YYYY-MM-DD'),
(SELECT id FROM agents WHERE name = 'Trend Spotter' AND company_id = companies.id),
date_trunc('week', now() + interval '1 week') + interval '8 hours',
'high',
'open'
FROM companies WHERE slug = 'ai-content-co';
Set up database triggers to auto-create downstream issues:
-- When Trend Spotter resolves → create Topic Planner issue
-- When Topic Planner resolves → create 2 Researcher issues (parallel)
-- When each Researcher resolves → create corresponding Writer issue
-- When Writer resolves → create Editor issue
-- When Editor approves → create Publisher issue (or Approval Gate first)
(Full trigger SQL is in /db/content_company_triggers.sql in the companion repo.)
-- Weekly production dashboard
SELECT
date_trunc('week', i.created_at) AS week,
COUNT(*) FILTER (WHERE a.role = 'Content Writer' AND i.status = 'resolved') AS articles_written,
COUNT(*) FILTER (WHERE a.role = 'Content Publisher' AND i.status = 'resolved') AS articles_published,
SUM(ce.cost_usd) AS weekly_cost
FROM issues i
JOIN agents a ON a.id = i.assigned_agent_id
LEFT JOIN cost_events ce ON ce.issue_id = i.id
WHERE i.company_id = (SELECT id FROM companies WHERE slug = 'ai-content-co')
GROUP BY week ORDER BY week DESC;