Component overview
| Component | Type | Memory | Timeout | Role |
|---|---|---|---|---|
| WebhookHandler | Lambda (Node 20, ARM64) | 256 MB | 30s | Validate HMAC, invoke ReviewAgent (async) |
| ReviewAgent | Lambda (Node 20, ARM64) | 1024 MB | 300s | Fetch diff, invoke agents, post results |
| API Gateway | REST API | — | 29s | Receive webhook, proxy to Lambda |
| DynamoDB | On-demand tables | — | — | Installation config, review history |
| SSM Parameter Store | SecureString | — | — | Encrypted credentials |
Architecture diagram
DynamoDB tables
mergewatch-installations
mergewatch-installations
Primary key:
installationId (partition key)GSI: accountId-index on accountIdStores GitHub App installation records and per-repo settings. Each item represents one GitHub App installation and includes:- GitHub account/org information
- List of enabled repositories
- Per-repo configuration overrides (model, skip rules, custom instructions)
- Installation status and timestamps
mergewatch-reviews
mergewatch-reviews
Primary key:
installationId#repoFullName (partition key), reviewId (sort key)GSI: createdAt-index on createdAtTTL: 90 days (automatically expires old review records)Stores all review records including:- Raw agent findings (security, logic, style, summary)
- Orchestrator output (deduplicated findings, severity rankings)
- Merge readiness score
- Timing data (per-agent latency, total duration)
- GitHub metadata (PR number, commit SHA, check run ID)
Concurrency model
WebhookHandler invokes ReviewAgent asynchronously via the AWS Lambda Invoke API (
InvocationType.Event). There is no queue between the two functions, so there is no built-in per-PR serialization.- PR #1 in
acme/apiand PR #2 inacme/apitrigger independent ReviewAgent invocations that run in parallel. - Two rapid pushes to PR #1 each trigger a separate ReviewAgent invocation. Both run concurrently — there is no queuing or ordering guarantee.
- Each ReviewAgent invocation edits the same summary comment on the PR. If two invocations overlap, the last one to finish overwrites the summary (last write wins). Inline review comments are additive and are not affected by concurrency.
Latency breakdown
Typical end-to-end timing from webhook receipt to comments appearing on the PR:| Step | Duration |
|---|---|
| GitHub → API Gateway | <100ms |
| WebhookHandler Lambda | 200–500ms |
| ReviewAgent startup (cold) | 5–10s |
| GitHub diff fetch | 200–800ms |
| 5x parallel Bedrock calls | 8–20s |
| Orchestrator | 3–8s |
| GitHub comment posting | 200–500ms |
| Total (warm) | ~15–35s |
| Total (cold start) | ~25–50s |
Next steps
Deployment Models
Understand the differences between self-hosted, BYOC, and SaaS deployments.
SAM Template Reference
Explore the full SAM template parameters, resources, and outputs.