Full end-to-end: create a company, hire one agent, seed 5 issues, trigger 3 heartbeats, and review the activity log. The first complete Paperclip workflow from blank slate to running agent.
A small but complete AI company with two agents, ten seeded tasks, and a working heartbeat — all running in local sandbox mode. By the end you will have watched end-to-end autonomous task completion.
Company: Demo Corp
Monthly budget: $15.00
Agent 1: Researcher
Role: Research Analyst
Adapter: claude-code
Budget: $8.00
Prompt: See below
Agent 2: Summariser
Role: Executive Summariser
Adapter: claude-code
Budget: $5.00
Prompt: See below
INSERT INTO public.companies (name, slug, monthly_budget_usd)
VALUES ('Demo Corp', 'demo-corp', 15.00)
ON CONFLICT (slug) DO NOTHING;
DO $$
DECLARE
cid uuid;
a1 uuid;
a2 uuid;
BEGIN
SELECT id INTO cid FROM companies WHERE slug = 'demo-corp';
INSERT INTO agents (company_id, name, role, system_prompt, adapter_type, monthly_budget_usd, status)
VALUES (cid, 'Researcher', 'Research Analyst',
'You are a Research Analyst. When given a topic, produce a clear 2-paragraph summary with 3 key facts.',
'claude-code', 8.00, 'active')
ON CONFLICT (company_id, name) DO NOTHING
RETURNING id INTO a1;
IF a1 IS NULL THEN SELECT id INTO a1 FROM agents WHERE company_id = cid AND name = 'Researcher'; END IF;
INSERT INTO agents (company_id, name, role, system_prompt, adapter_type, monthly_budget_usd, status)
VALUES (cid, 'Summariser', 'Executive Summariser',
'You are an Executive Summariser. Given a research note, distill it to exactly 3 bullet points for a busy executive.',
'claude-code', 5.00, 'active')
ON CONFLICT (company_id, name) DO NOTHING;
END $$;
DO $$
DECLARE
cid uuid;
a1 uuid;
BEGIN
SELECT id INTO cid FROM companies WHERE slug = 'demo-corp';
SELECT id INTO a1 FROM agents WHERE company_id = cid AND name = 'Researcher';
INSERT INTO issues (company_id, title, description, assigned_agent_id, priority, status)
SELECT cid, t.title, t.desc, a1, 'medium', 'open'
FROM (VALUES
('What is LangGraph?', 'Research the LangGraph library and its use cases.'),
('What is CrewAI?', 'Research CrewAI and compare it to LangGraph.'),
('What is AutoGen?', 'Research Microsoft AutoGen framework.'),
('What is Agency Swarm?', 'Research Agency Swarm and its agent role model.'),
('What is Llama Index?', 'Research LlamaIndex for RAG applications.'),
('What is Haystack?', 'Research deepset Haystack pipeline framework.'),
('What is LangSmith?', 'Research LangSmith for LLM observability.'),
('What is Weights & Biases?', 'Research W&B for ML experiment tracking.'),
('What is Helicone?', 'Research Helicone for LLM usage analytics.'),
('What is PromptLayer?', 'Research PromptLayer for prompt versioning.')
) AS t(title, desc)
ON CONFLICT DO NOTHING;
END $$;
for i in 1 2 3 4 5; do
curl -s -X POST http://localhost:3100/api/heartbeat/run \
-H "Content-Type: application/json" \
-d '{"company_id": "'${COMPANY_ID}'"}' | jq '.issues_resolved'
sleep 2
done
SELECT
i.title,
i.status,
LEFT(i.result, 120) AS preview
FROM issues i
JOIN companies c ON c.id = i.company_id
WHERE c.slug = 'demo-corp'
ORDER BY i.resolved_at DESC;
cost_events shows token usage per invocationModify the seed so the Summariser picks up resolved Researcher issues and produces executive bullets. You'll need to add a second pass that creates a new issue for each resolved Researcher result.