Architecture
MirQuadri.com is a personal-brand platform where AI agents help prepare essays, review drafts, and create companion content. Mir reviews and approves publication. This page describes the content studio at a public overview level; it is not a specification for every project hosted on the site.
Last reviewed: · Source-code review
Implementation and production verification are different. Status labels below reflect the shared fleet record, not a fresh end-to-end test of connected services.
Stack & Rationale
Package values come from the repository manifest. A range such as ^5.6.3 is a declared dependency range, not a claim about the exact installed version. Managed services do not have a package version here.
| Layer | Technology | Package / service | Purpose |
|---|---|---|---|
| Framework | Next.js | 16.2.6 | Pages, server rendering, and application routes. |
| UI library | React | 19.2.8 | Interactive interfaces. |
| Language | TypeScript | ^5.6.3 | Static type checking. |
| Data and identity | Supabase (PostgreSQL + Auth) | ^2.116.0 | Managed database and sign-in. Version shown is the client SDK, not the database server. |
| AI | Anthropic Claude | Configurable model | Text generation and rubric-based review. The code default is Sonnet 4.5; the deployed model can be overridden. |
| Styling | Tailwind CSS | ^3.4.15 | Shared styles and design tokens. |
| Resend | ^6.12.3 | Transactional and newsletter email workflows. | |
| Hosting | Vercel | Managed platform | Web hosting and scheduled jobs; agent handlers use the Node.js runtime. |
| Observability | Datadog | ^5.40.0 | Optional tracing instrumentation; collection depends on deployment configuration. |
| Avatar video | HeyGen | External API | Creates video from an approved script when configured. |
| Video assembly | Remotion / AWS Lambda | 4.0.526 | Separate assembly step for generated video. |
| Channel delivery | LinkedIn / YouTube | External APIs | Explicit publishing actions require the relevant account connection. |
System Flows
Read each flow from top to bottom. Each numbered card represents a step; conditional behavior is described within the step.
Request Flow: Visitor to Page Render
Open a page
A visitor requests a public page or opens the Studio.
Load the route
Next.js serves the page. Static and cached pages can be delivered without a fresh database read.
Read data when needed
Data-backed routes load the content they need. Studio access requires owner sign-in.
Display the page
The browser shows the content and activates interactive controls.
Agent Run Flow: Trigger to Published Essay
Start work
A manual action or scheduled job requests agent work. Scheduled jobs prepare material for review.
Track the run
The application records the queued run before returning its identifier. Work then continues in the background.
Draft and review
The agent saves its output. Writer drafts trigger Critic review; revision feedback can return to Writer in a bounded loop.
Review in Studio
Mir reviews the result. The recent-run feed refreshes approximately every three seconds.
Approve publication
An explicit approval action publishes an essay. Social posting and video delivery have their own actions and connection requirements.
How the Agent System Works
Run lifecycle
Runs are recorded as queued, running, then success, failure, or skipped. A successful drafting run means the requested work completed; it does not mean the content was published.
Token Counting & Estimated Cost
The shared AI-call helper accumulates input and output tokens and records an estimated model cost for the run. These estimates are not provider invoices and do not include separate video, email, hosting, or channel-service charges.
Background execution
The trigger returns a run identifier after recording the request, while execution continues in the background. Response time varies. This mechanism operates within the hosting platform’s execution limits; it is not a durable job queue.
Agent Chaining
Writer drafts trigger Critic scoring. When revision is needed and the required context is available, Critic can send feedback to Writer for another attempt. The loop is bounded and never substitutes for Mir’s approval.
Triggers: Manual & Scheduled
Manual Studio actions request work. A daily scheduled job conditionally replenishes topic and draft queues, prepares companion posts and video scripts, requests a weekly internal digest when due, and triages waiting sponsor inquiries. Scheduled preparation does not automatically publish that material.
The Agents
SCOUT-01 · Topic Sourcing
Proposes topic candidates for the writing queue.
WRITER-02 · Drafting
Drafts essays and can revise them using Critic feedback.
PRODUCER-03 · Video Scripts
Drafts video scripts from published essays. Avatar generation, assembly, and YouTube publishing are separate Studio actions.
CRITIC-04 · Scoring
Reviews drafts against a seven-axis rubric and can request revisions. A passing score is not publication approval.
PUBLISHER-05 · Channel Drafts
Drafts LinkedIn companion posts. Posting requires review and a connected account; manual copying is available otherwise.
MATCH-06 · Sponsor Triage
Scores sponsor inquiries for fit and suggests a reply angle. Mir decides how to respond.
ANALYTICS-07 · Weekly Report
Summarizes internal pipeline activity and estimated AI usage costs; it does not provide LinkedIn or YouTube audience analytics.
Key Decisions & Tradeoffs
Single Owner, Manual Approval
Content preparation is automated, while publication remains an explicit human action. This prioritizes editorial judgment over maximum throughput.
Passwordless Magic-Link Auth
Studio sign-in uses email links. This simplifies sign-in but depends on access to the owner’s mailbox and reliable email delivery.
Vercel Cron (Node.js Serverless) Over Polling
Scheduled server work uses Vercel Cron. Studio polling is a separate display function. Schedules and background execution remain subject to platform limits.
Managed Data and Identity
Supabase brings database and identity services together, reducing infrastructure to operate while creating a dependency on a managed provider.
Separate Media Stages
Script drafting, avatar generation, video assembly, and channel publishing are distinct steps. A completed script does not imply a completed or published video.
Operational Visibility
Run records provide status and estimated AI usage costs. Optional Datadog instrumentation adds tracing when configured. Scheduled stale-run reconciliation can request email alerts; this does not guarantee delivery or comprehensive monitoring.
What's Live & What's Not
Agent classifications are derived from the same fleet record used elsewhere on the site. “Live & Verified” records previously verified agent behavior; it is not a guarantee that every dependency is currently healthy.
✓ Live & Verified
- SCOUT-01: Proposes topic candidates for the writing queue.
- WRITER-02: Drafts essays and can revise them using Critic feedback.
- CRITIC-04: Reviews drafts against a seven-axis rubric and can request revisions. A passing score is not publication approval.
⚠ Built But Unverified
- PRODUCER-03: Drafts video scripts from published essays. Avatar generation, assembly, and YouTube publishing are separate Studio actions.
- PUBLISHER-05: Drafts LinkedIn companion posts. Posting requires review and a connected account; manual copying is available otherwise.
- MATCH-06: Scores sponsor inquiries for fit and suggests a reply angle. Mir decides how to respond.
- ANALYTICS-07: Summarizes internal pipeline activity and estimated AI usage costs; it does not provide LinkedIn or YouTube audience analytics.
Connection-dependent capabilities
LinkedIn posting, HeyGen generation, Remotion assembly, and YouTube publishing require their respective configuration and, where applicable, account authorization. Code presence alone does not confirm a successful production run. This public page does not inspect private connection health or assert that external apps are registered or unregistered.
Architecture Notes
This overview was checked against the content studio’s source code and shared fleet definitions. It does not certify the deployed database schema, current integrations, or operational availability. Deployment configuration and external-service behavior require separate runtime verification.
See Build Log for published progress and the Studio build story for context.