End-to-End Architecture

The Delivery Funnel.

From first visit to delivered solution — every stage of the AaaS autonomous execution pipeline.

Full Technical Spec (930 lines) →
01
Entry Point

Any AaaS Domain

User Experience

The journey starts when a visitor lands on any of 14+ AaaS-owned domains. Each surface serves a specific role in the AaaS product architecture. Four core domains define the account and activation model: aaas.name (personal account), aaas.company (company account), aaas.select (agent activation via email + database), and aaas.builders (build and publish agents). The remaining domains are specialized views within the same Canvas platform.

aaas.blog aaas.select aaas.boutique aaas.builders aaas.business aaas.company aaas.diy aaas.forum aaas.pics aaas.quest aaas.today platform
Technical Layer
  • Firebase Hosting — static export targets per domain
  • Next.js (output: "export" or SSR via Cloud Run for blog)
  • Shared @aaas/auth-core package across all apps
  • Shared @aaas/ui design system — tokens, components
  • Turborepo monorepo — 15 apps, 4 packages, 1 service
# Deploy all hosting targets firebase deploy --only \ hosting:platform,hosting:blog,\ hosting:select,hosting:boutique
02
Identity

Firebase Authentication

User Experience

Sign up with Google or email — single click for most users. The system immediately begins building a behavioral profile. A persona label is detected from the first few interactions, shaping every subsequent touchpoint.

developer researcher executive agent-builder enterprise
Technical Layer
  • Firebase Auth — Google OAuth + Email/Password
  • packages/auth-core/src/auth-provider.tsx
  • packages/auth-core/src/sign-in-panel.tsx
  • User document created in Firestore on first sign-in
  • Anonymous sessions planned for frictionless entry
// Anonymous Session Flow No login required — UUID session token in localStorage Full journey: Research → Offer → Payment → Delivery → Corrections Stripe Guest Checkout (no account needed) Email required at payment → recovery link sent 30-day TTL → "Register to keep your projects" email Migration: all anonymous projects → user account on signup
// users/{uid} Firestore doc { uid: "abc123", email: "user@example.com", persona: "developer", createdAt: serverTimestamp() }
02b
Account Level

Personal & Company

User Experience

Every signup creates an aaas.name personal account — your identity, profile, preferences, and billing. For solo users, aaas.name and aaas.company are identical — one person, one workspace. The moment a second employee joins, aaas.company activates as a shared context layer: team management, shared projects, and unified billing across multiple aaas.name accounts.

Technical Layer
  • Firestore: accounts/{uid} (personal) + organizations/{orgId} (company)
  • Solo threshold: when org.members.length === 1, aaas.company mirrors aaas.name
  • Multi-employee: shared context layer with team roles and project visibility
  • All domains route auth through aaas.name (personal account)
// Account routing logic if (org.members.length === 1) { // solo: company mirrors personal redirect("aaas.name") } else { // team: shared context layer loadOrgContext(orgId) }
03
Intelligence

Context Engine — Behavioral Profiling

User Experience

Invisible to the user, the system learns what they care about through article views, search terms, and channel follows. The 14-dimensional user vector grows more precise with every action, enabling hyper-personalized email and content.

14 dimensions tracked: 6 entity-type frequencies, search activity, channel engagement, and 5 persona one-hot labels. Cosine similarity powers collaborative recommendations.

Technical Layer
  • apps/blog/src/lib/behavior.ts — localStorage event tracking
  • apps/blog/src/lib/collaborative.ts — 14D user vectors
  • Cosine similarity for nearest-neighbor recommendations
  • Firestore user_behavior collection
  • Context pipeline: functions/src/contextPipeline.ts
// 14D vector structure vector: [ articleViews, toolViews, // entity agentViews, templateViews, // entity caseViews, reportViews, // entity searchActivity, // behavior channelEngagement, // behavior ...personaOneHot[5] // identity ]
04
Activation

First Email — Agent Activation via aaas.select

User Experience

At the right moment, the user receives a personalized email inviting them to describe their challenge. The subject line is tailored to their detected persona. Weekly digests keep them engaged with curated content matching their interest vector.

aaas.select is the agent activation domain. Email {agent-id}@aaas.select to activate a specific agent directly — no sign-up required for the initial trigger.

Example subject lines by persona:

  • "Build your first agent — no infra required" (developer)
  • "Automate your research pipeline" (researcher)
  • "Your competitive brief, written overnight" (executive)
Technical Layer
  • Resend API with RFC 8058 one-click unsubscribe headers
  • functions/src/lib/email-templates/ — template library
  • Cloud Functions v2 — scheduled + triggered sends
  • Firestore subscriptions collection
  • digest-email-agent — weekly vector-matched digests
// Resend send call — agent activation via aaas.select await resend.emails.send({ from: "{agent-id}@aaas.select", to: user.email, subject: persona.subjectLine, react: ChallengeInviteTemplate, headers: rfcUnsubscribeHeaders })
05
Intake

Challenge Prompt — Project Creation

User Experience

The user describes what they need in plain language. No forms, no templates — just a prompt. The system creates a project immediately and a conversation thread is opened for any follow-up questions from the agent.

Example inputs:

  • "Build me a landing page for my SaaS"
  • "Analyze my top 5 competitor positioning"
  • "Write and send my weekly newsletter"
  • "Set up a Python data pipeline for my CSV exports"
Technical Layer
  • POST /api/projects on Cloud Run API service
  • services/api/src/routes/projects.ts
  • Creates projects/{id} in Firestore
  • Creates conversations/{id} thread
draft
// Security Gates (before A0 dispatch) File upload: max 10MB/file, 50MB total Allowed types: .txt .md .pdf .csv .json .png .jpg .svg ClamAV malware scan via Cloud Function (<5s) Prompt injection check: "ignore previous", "SYSTEM:", "###OVERRIDE" All user input tagged as <user_input>...</user_input> Rate limits: Anonymous 3 projects / Auth 5 concurrent
// projects/{id} doc { userId: uid, prompt: "Build me...", status: "draft", createdAt: serverTimestamp() }
06
Planning

Estimation & Planning — Agent Zero Research

User Experience

Agent Zero kicks off an autonomous research and planning phase. It breaks down the challenge, identifies required tools and resources, and produces a numbered execution plan with a credit estimate. The user reviews and approves before any billable work begins.

draft estimating offer_ready
Technical Layer
  • GCE VM provisioned: services/api/src/services/vm-provisioner.ts
  • Docker container with persistent disk (data-root on PD)
  • A0 dispatched via agent-zero-dispatch.ts
  • Plan steps → projects/{id}/plan_steps/ subcollection
  • Ubuntu 24.04 VMs — Docker CE installed on boot
// CAPO Pricing Model (Cost-per-Accepted-Outcome) Not raw tokens × multiplier — learned from history Start: estimated CAPO × 6.0 margin Per-type calibration: simple (7.8×), medium (9.6×), complex (12.6×) FinOps guardrails: loop limit 5, tool-call cap 200, token budget 500K Budget tracking: soft limit 150%, hard limit 200% of paid amount
// VM dispatch (hybrid) SHORT (<60s): sync POST → A0 → response LONG (>60s): fire-forget → A0 works... → on_completion plugin → agentZeroCallback CF → Firestore → WebSocket
07
Execution

Autonomous Agent Pipeline

User Experience

Once approved, the agent executes — working through plan steps one by one. Users can watch real-time progress in the ZUI canvas: each step lights up as it completes. The agent has full access to 50+ built-in tools — web search, code execution, email, payments, and more.

approved running review
Technical Layer
  • GCE Ubuntu VM + Docker CE + persistent disk state
  • A0 plugin executors: functions/src/lib/foundry/tool-executors.ts
  • Tools: Resend, Stripe, Tavily, GCS, Vertex AI + 45 more
  • Deliverables stored in GCS with signed URLs
  • WebSocket updates: Cloud Run → Firestore → client
  • containerStatus: running → running_async
// Agent Delegation aaas-workflow: research, strategy, planning, orchestration claude_code_agent: implementation, tests, git ops, PR creation security_scanner: OWASP Top 10, secrets, auth bypass performance_monitor: bundle size, load time, DB queries // Quality Gate (iterative until 0 critical) Static: TypeScript types, lint, dead code Unit: functions, utilities, components Integration: API endpoints, DB operations Runtime: actual execution, edge cases Max 5 iterations → escalate to platform // Cost Reporting A0 sends cumulative token_cost in every callback SET (not +=) to avoid double-counting Soft limit → optimize (fewer iterations) Hard limit → partial delivery + user notification
// Container resume logic if docker ps -a | grep agent-zero: docker start agent-zero # keep state else: docker run --privileged \ -v /mnt/docker-data/... \ frdel/agent-zero:latest
08
Output

Delivery — Email + Portal + ZUI

Technical Layer
  • A0 callback → functions/src/agentZeroCallback.ts
  • Status transition: running → review
  • Delivery email via Resend API
  • Firestore project_portal collection (no-auth read)
  • ZUI: PixiJS infinite canvas, 3 semantic zoom layers
  • Transaction guards prevent double-delivery (sync + async race)
// Artifact Transfer GCS Signed Upload URL flow (no credentials on VM) A0 requests signed URL → uploads ZIP → verifies → sends "completed" Signed Read URLs: 7-day TTL, renewable by owner Path traversal guard on storageUrl // User Review Options Download ZIP Visual preview (screenshot/render) Live execution (sandboxed iframe) Code inspection (file tree + syntax highlighting) Correction rounds: free if < 150% budget, extra payment if > 200%
// agentZeroCallback.ts // Verifies X-AaaS-Signature (HMAC) // Writes deliverables to Firestore // status: running → review // Triggers delivery email via Resend // Signed GCS URLs for file assets
09
Adaptive Intelligence

Learning System — 5-Component Adaptive Intelligence

Overview

Every completed project makes the next one better. The system learns from research quality, user preferences, pricing accuracy, spec clarity, and agent performance — building a growing template archive that accelerates future deliveries.

Technical Layer
// 5 Learning Components 1. Template Archive — universal artifact register Firestore: shared_memory/template_archive/{id} Semantic search via Vertex AI embeddings Cross-VM via centralized Firestore (not VM-local) 2. Research Wiki — cached deep research + quality scoring Cache logic: age + quality_score + decisive_elements Enrichment for partial results, full re-research for stale 3. Task Templates — pattern library (not copy-paste) Fingerprint: hash(type + domain + tech_stack + complexity) Stores: goals_pattern, strategy_pattern, plan_structure CAPO history for pricing calibration 4. User Profile — behavioral adaptation Tracks: communication_style, patience_level, decision_autonomy Adapts: question count, offer detail, correction expectations 5. Spec Quality Tracker — iteration minimization Monitors: avg_iterations vs target per complexity class Auto-improves: spec templates when iterations exceed threshold
10
Operations

Dashboards — Monitoring & Operations

User Experience

Internal dashboards give the operations team a live view of pipeline health, agent performance, ecosystem surface status, and outstanding issues. Every phase of the funnel is observable.

Technical Layer
  • Static HTML pages deployed to aaas-design.web.app
  • Firebase Hosting target: design
  • Deploy: firebase deploy --only hosting:design
  • All dashboards share the AaaS design system tokens
  • No external JS dependencies — self-contained HTML
  • Agent oversight: design/agents/ directory
// Deployment config { "hosting": [{ "target": "design", "public": "design", "ignore": ["*.md"] }] }
System Architecture

End-to-End Overview.

How the six major subsystems connect — from entry surface through auth, context, planning, execution, and delivery back to the monitoring layer.

Layer 1 — Entry
14+ Domains
Firebase Hosting. Next.js static export or SSR via Cloud Run. Shared @aaas/ui + @aaas/auth-core.
Layer 2 — Identity
Firebase Auth
Google OAuth + Email/Password. User doc created in Firestore. Persona detection begins immediately.
Layer 3 — Intelligence
Context Engine
14D behavioral vectors in Firestore. Cosine similarity for collaborative recommendations. Blog behavioral tracking.
Layer 6 — Output
Delivery
Portal (public), ZUI PixiJS canvas, CRM workspace. Delivery email via Resend. GCS signed URLs for assets.
Layer 5 — Core
Agent Zero
GCE Ubuntu VMs + Docker CE. Persistent disk state. 50+ tool executors. Sync + async dispatch patterns.
Layer 4 — Intake
Project API
Cloud Run Express API. Project + conversation creation. VM provisioner. Status state machine with 10+ transitions.
Layer 7 — Operations
Foundry & Dashboards
Micro-agent tournaments, chains, and competition cycles. Pipeline health boards. 8 internal monitoring surfaces.
Pipeline Numbers

Key Metrics.

2,847
Entities Indexed
49
Autonomous Agents
50+
Built-in Tools
14+
Entry Surfaces
Live Surfaces

Visual Gallery.

Screenshots captured from live AaaS surfaces — entry points, dashboards, delivery views, and operational tooling.

Platform Home
Stage 1 — Entry
agents-as-a-service.com
Primary platform — Home, About, Pricing, Projects
Blog Knowledge Index
Stage 1 — Entry
aaas.blog — Knowledge Index
2,847 entities, 49 agents, semantic search, MCDA recommendations
Select Marketplace
Stage 1 — Entry
aaas.select — Agent Activation
Agent activation via email + agent database. Email {agent}@aaas.select to activate.
Delivery Portal
Stage 8 — Delivery
Public Portal — No Auth Required
Guest-facing delivery view with timeline and downloadable artifacts
Canvas API Docs
Stage 8 — Delivery
Canvas API Documentation
CRM API endpoints — schema, records, search, export, credits
Delivery Funnel
This Page
Delivery Funnel — End-to-End Architecture
The page you're reading — 10 stages, technical specs, visual gallery
Ecosystem Overview
Stage 10 — Operations
Ecosystem Overview
All 14+ surfaces, cloud services, and infrastructure mapped
Foundry
Stage 10 — Operations
Micro-Agent Foundry
Tournament engine — slots, Elo scoring, chain composition
Orbital Prototype
Design Vision
★ Orbital Prototype — Navigation Hub
5 concentric semantic rings — the conceptual foundation for ZUI's semantic layers
Deliveries Dashboard
Stage 10 — Operations
Deliveries Dashboard
All project deliverables with audit badges and deployment status
Control Panel
Stage 10 — Operations
Control Panel — Operations Hub
Stats grid, 23 design documents, system cron status, quick links