Architecture
Event-driven orchestration running on AWS. Claude reasons, Python orchestrates, humans approve. Here's everything that's actually deployed.
Design Principles
Event-Driven, Not Autonomous
Every action starts with an external event (Slack message, email, JIRA ticket, cron schedule). PAGE never acts on her own impulse โ deterministic Python workflows with Claude as the reasoning engine.
LLM as Brain, Not Orchestrator
Claude generates content and classifies intent, but control flow is always in Python code. No ReAct loops, no tool-calling chains. The orchestrator decides what to do; Claude decides how.
Graduated Autonomy
Every content output flows through Slack approval gates. As reliability is demonstrated over time, approval thresholds relax. Trust is earned incrementally, never assumed.
Auditable & Debuggable
Structured logging on every handler call. Full JIRA ticket lifecycle tracking. Every Claude API call logged with token counts. No black boxes โ every decision is traceable.
How a Task Flows Through PAGE
From external event to published content โ every step is deterministic, logged, and human-approved.
Intake
External event arrives via webhook or schedule
Slack message โ Lambda โ SQS, Gmail โ Lambda โ SQS, JIRA webhook โ Lambda โ SQS, EventBridge cron โ SQS
Queue
Message lands in the right SQS queue
6 task queues (content, community, feedback, growth, meeting, report) with DLQs for failed messages
Orchestrate
Orchestrator polls SQS, classifies intent
Intent classifier uses Claude to score confidence โ task rubric validates required fields โ dispatches to the right handler
Execute
Handler generates content via Claude
Blog drafts (800-1500 words), social posts (300 chars ร 3 platforms), email replies, code gists, Slack reports
Approve
Slack approval gate with approve/reject/revise
Content preview posted to Slack โ human clicks Approve, Reject, or Request Revision โ action recorded in JIRA
Publish
Approved content pushed to destination
Blog โ GitHub Actions rebuild โ S3 + CloudFront. Social โ Bluesky/LinkedIn/Threads APIs. Email โ Gmail API
Live Infrastructure
Everything below is deployed and running in AWS us-east-1. Managed by Terraform (10 modules, ~80 resources).
Compute & API
Core orchestrator, webhook router, blog API โ runs on ECS Fargate behind API Gateway
Content, Community, Feedback, Growth, Meeting, and Report workers โ each a dedicated task definition
Receives Slack interactions, JIRA webhooks, and scheduled events โ routes to SQS queues
Messaging & Events
content-tasks, community-tasks, feedback-tasks, growth-tasks, meeting-tasks, report-tasks โ each with a dead-letter queue
Fires scheduled tasks (daily reports, weekly summaries) into SQS queues
Data & Storage
Tasks, BlogPosts, content pipeline state, and 1536-dim embeddings for semantic memory and RAG
content-drafts (working artifacts), published-artifacts (final outputs), meeting-recordings (Recall.ai transcripts)
API keys for Claude, Slack, Gmail, JIRA, GitHub, Bluesky, LinkedIn โ rotated and encrypted at rest
Frontend & CDN
Main site โ features, architecture, about. Served from S3 via CloudFront with HTTP/2+3
Blog โ posts built at deploy time from PostgreSQL. Rebuilds automatically when a post is approved
PriceClass_100, TLS 1.2+, origin access control for S3. ACM cert covers both subdomains
A-alias records for both subdomains, MX for Gmail, ACM validation CNAMEs
CI/CD Pipeline
On push to main or workflow_dispatch โ build โ S3 sync โ CloudFront invalidation
Scoped to pages-code/PAGE main branch โ S3 put/delete + CloudFront invalidation only
Monitoring & Alerting
DLQ message alerts, RDS CPU/storage, API Gateway 5xx rate, ECS task failures
SQS queue depths, API latency, DB connections, Lambda invocations โ single-pane view
Integration Map
13+ external services connected via APIs, webhooks, and protocols.