ANTIGRAVITY LABJP
Articles/Agents & Manager
Agents & Manager/2026-04-28Advanced

Turning AI Agents into Products — Build Billable Automation Services with Antigravity

Learn how to package Antigravity's multi-agent capabilities into sellable automation services. Covers AgentKit 2.0 orchestration, usage-based billing, and three ready-to-sell agent service blueprints.

antigravity437agents129agentkit-2.0multi-agent50monetization31automation-serviceorchestration21saas10

Premium Article

Most of us have experienced how AI agents can automate our own work. But packaging that automation as a product you can sell to clients is a different challenge entirely.

When I first started running paid memberships across my own network of sites, what surprised me most was how wide the gap is between "automation for myself" and "automation someone pays for."

As an indie developer running several blogs on an automated publishing pipeline, handing a draft off to an agent is already part of my daily routine. But the moment I tried to turn that same machinery into a service people pay for, the bar for the design jumped a level or two. The meaning of a failure changes completely.

This article walks you through designing and implementing agent services you can actually sell to clients, with working code throughout. From AgentKit 2.0 orchestration to usage-based billing, I'll follow the same path I took in my own operations.

From Personal Automation to Sellable Products

The gap between personal automation and commercialized agent services hinges on three structural requirements.

Personal automation: If your workflow breaks, you fix it yourself. An 80% accuracy rate is fine if you're the only user.

Commercialized product: A client is paying monthly for reliability. A 95% success rate might trigger refund requests. Accuracy becomes non-negotiable.

The three pillars of agent commercialization are:

  1. Reliability — Graceful error handling, retry logic, and fallback responses ensure the service continues functioning even when individual agent calls fail
  2. Measurability — Every execution is logged with token counts, execution time, and outcome, enabling usage-based billing and accurate cost attribution
  3. Transparency — Clients see exactly what they're paying for via a dashboard showing execution history, token consumption, and monthly charges

Without these three pillars, agents remain internal tools. With them, they become SaaS products.

AgentKit 2.0 Multi-Agent Orchestration Architecture

Antigravity's AgentKit 2.0 introduces the Manager Surface pattern, which lets you coordinate multiple specialist agents. This is the architectural foundation for scaling agent services.

How Manager Surface Works

The Manager Agent acts as a coordinator, deciding which specialist agents to invoke, in what order, and how to aggregate results. For client-facing services, this separation of concerns is crucial—clients never call agents directly; they call your API, which routes to the appropriate agent through the manager.

// manager-orchestrator.js
// Multi-agent orchestration using Manager Surface
 
const Anthropic = require("@anthropic-ai/sdk");
 
const client = new Anthropic();
 
const managerPrompt = `You are a Manager Agent coordinating multiple specialist agents for client automation.
 
Available Specialists:
- ReportGenerator: Creates weekly/monthly business reports from data sources
- DataAnalyzer: Extracts insights and segments from datasets
- ContentProducer: Generates marketing content at scale
 
For each client request:
1. Determine required specialists based on request type
2. Validate execution capacity (max 10 concurrent operations)
3. Delegate to appropriate specialists
4. Aggregate results and validate quality
5. Return structured response with audit trail`;
 
async function orchestrateRequest(clientId, request, executionLog) {
  const response = await client.messages.create({
    model: "claude-3-5-sonnet-20241022",
    max_tokens: 2048,
    system: managerPrompt,
    messages: [
      {
        role: "user",
        content: `Client: ${clientId}\nRequest: ${request}\nExecution Context: ${JSON.stringify(executionLog)}`,
      },
    ],
  });
 
  const usage = response.usage;
 
  // Critical: Log token consumption for billing
  executionLog.push({
    timestamp: new Date().toISOString(),
    agentType: "Manager",
    inputTokens: usage.input_tokens,
    outputTokens: usage.output_tokens,
    totalTokens: usage.input_tokens + usage.output_tokens,
    clientId: clientId,
    operation: "orchestration",
  });
 
  return {
    decision: response.content[0].text,
    executionLog: executionLog,
    usage: usage,
  };
}
 
module.exports = { orchestrateRequest };

Resilience: Retry Logic and Fallbacks

In production, agent calls fail. Network timeouts, API limits, momentary service disruptions—these happen. A commercialized service doesn't crash when one execution fails; it recovers gracefully.

// agent-resilience.js
// Production-grade error handling with exponential backoff
 
async function executeWithRetry(
  agentName,
  task,
  maxRetries = 3,
  executionLog
) {
  let lastError = null;
 
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    try {
      const result = await invokeSpecialistAgent(agentName, task);
 
      executionLog.push({
        timestamp: new Date().toISOString(),
        agentName: agentName,
        status: "success",
        attempt: attempt + 1,
        taskSummary: task.substring(0, 100),
      });
 
      return { success: true, result, totalAttempts: attempt + 1 };
    } catch (error) {
      lastError = error;
 
      executionLog.push({
        timestamp: new Date().toISOString(),
        agentName: agentName,
        status: "failed",
        attempt: attempt + 1,
        error: error.message,
      });
 
      if (attempt < maxRetries - 1) {
        // Exponential backoff: 1s, 2s, 4s...
        const backoffMs = Math.pow(2, attempt) * 1000;
        await new Promise((resolve) => setTimeout(resolve, backoffMs));
      }
    }
  }
 
  // All retries exhausted: return fallback response
  executionLog.push({
    timestamp: new Date().toISOString(),
    agentName: agentName,
    status: "fallback_activated",
    reason: `All ${maxRetries} attempts failed. Error: ${lastError.message}`,
  });
 
  return {
    success: false,
    fallbackResult: generateFallback(agentName, task),
    totalAttempts: maxRetries,
    error: lastError.message,
  };
}
 
function generateFallback(agentName, task) {
  // Fallback strategies vary by agent type.
  // For ReportGenerator: return cached report from previous week
  // For ContentProducer: return templated content
  return {
    source: "fallback",
    reason: `${agentName} temporarily unavailable`,
    timestamp: new Date().toISOString(),
  };
}
 
module.exports = { executeWithRetry };

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
The implementation essentials—reliability, measurability, transparency—for lifting personal automation into a paid service
Concrete code for AgentKit 2.0 orchestration and usage-based billing (API Gateway + token metering + Stripe)
The real judgment calls on failure detection, usage logs, and pricing you only learn by running it
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Agents & Manager2026-04-10
Antigravity Multi-Agent Orchestration Guide: From Communication Errors to Production
Complete guide to designing and implementing multi-agent systems with Antigravity. Covers architecture patterns, communication error troubleshooting, and production stability.
Agents & Manager2026-06-19
How to Orchestrate Multiple Agents: Drawing the Line Between Parallel and Serial Work
Antigravity 2.0 brings true parallel execution across multiple agents. But making everything parallel does not make it faster. Which work should fan out in parallel, and which should stay serial? This is an orchestration design that does not fall apart, viewed through dependencies and contention.
Agents & Manager2026-06-19
Parallel or Keep It Serial: The Break-Even Point When Orchestrating Multiple Agents
Should you run agents in parallel or keep them serial? A simple way to estimate the break-even between coordination cost and saved wall-clock time, plus how I actually split parallel vs serial across four scheduled sites.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →