How thevirtualkrishnaaa/alpha-district-agent works
Alpha District is a scheduled Instagram content-generation and publishing agent with a Telegram review gate. Its documented workflow generates branded captions and images, stores posts for review, and publishes approved content; the sampled webhook also supports immediate publishing on approval. The graph distinguishes generation, review, publishing, and token maintenance. Source excerpts show the main orchestration and integrations, though the README describes some planned behavior and unsampled modules remain uncertain.
Main entry points: index.ts Scheduled and webhook entrypoints · generate.ts Generation pipeline · claude.ts Caption generation · instagram.ts Instagram publishing
Components 19
Content design
- Brand voice
functions/src/brand.ts - Content pillars
functions/src/pillars.ts
Post generation
- Runtime config
functions/src/config.ts - Generation pipeline
functions/src/generate.ts - Caption generation
functions/src/lib/claude.ts - Image provider
functions/src/lib/image.ts - Image composition
functions/src/lib/compose.ts - Image storage
functions/src/lib/storage.ts
Review workflow
- Scheduled and webhook entrypoints
functions/src/index.ts - Approval messaging
functions/src/lib/telegram.ts
Publishing and state
- Post queue
functions/src/lib/firestore.ts - Instagram publishing
functions/src/lib/instagram.ts - Post status model
functions/src/types.ts
Other components
- Cloud Scheduler
- Human reviewer
- Anthropic Claude
- OpenAI images
- Telegram
- Instagram Graph API
Connections 25
- Cloud Scheduler → Scheduled and webhook entrypoints: triggers schedules
functions/src/index.ts - Human reviewer → Telegram: decides post
README.md - Telegram → Scheduled and webhook entrypoints: sends callbacks
README.md - Scheduled and webhook entrypoints → Generation pipeline: runs generation
functions/src/index.ts - Generation pipeline → Caption generation: generates caption
functions/src/generate.ts - Generation pipeline → Image provider: generates image
functions/src/generate.ts - Generation pipeline → Image composition: composes image
functions/src/generate.ts - Generation pipeline → Image storage: uploads image
functions/src/generate.ts - Generation pipeline → Post queue: creates and updates
functions/src/generate.ts - Caption generation → Anthropic Claude: requests completion
functions/src/lib/claude.ts - Caption generation → Brand voice: uses voice
functions/src/lib/claude.ts - Caption generation → Content pillars: uses briefs
functions/src/lib/claude.ts - Generation pipeline → Content pillars: selects pillar
functions/src/generate.ts - Image provider → OpenAI images: requests image
- Scheduled and webhook entrypoints → Approval messaging: sends review
functions/src/index.ts - Approval messaging → Telegram: sends message
functions/src/lib/telegram.ts - Scheduled and webhook entrypoints → Approval messaging: parses decision
functions/src/index.ts - Scheduled and webhook entrypoints → Post queue: reads and updates
functions/src/index.ts - Scheduled and webhook entrypoints → Instagram publishing: publishes approved post
functions/src/index.ts - Scheduled and webhook entrypoints → Instagram publishing: refreshes token
functions/src/index.ts - Instagram publishing → Instagram Graph API: publishes media
functions/src/lib/instagram.ts - Instagram publishing → Post queue: reads token
functions/src/lib/instagram.ts - Scheduled and webhook entrypoints → Runtime config: uses schedules and secrets
functions/src/index.ts - Caption generation → Runtime config: uses model setting
functions/src/lib/claude.ts - Post queue → Post status model: stores post records
functions/src/lib/firestore.ts