Enterprise AI Agents at Scale: A Practical Guide to Architecture, Cost Control, and Metrics

    This article turns a recent Hong Kong IPO in the enterprise marketing and sales software space into a practical engineering checklist for scaling AI agents. It breaks an enterprise agent into five deliverable layers, shows how tiered model routing controls cost per request as gross margins come under pressure, and explains why compliance checks belong in the architecture rather than in a last-minute pre-launch sprint. It also maps business metrics such as net revenue retention and average revenue per customer to engineering signals, suggests a budget split and a three-phase rollout, and lists common pitfalls that keep agent projects stuck at the demo stage.

    1. What a Recent Capital Markets Event Reveals About Enterprise AI

    A company founded around 2009, long focused on digital transformation for enterprise marketing and sales, recently listed in Hong Kong. It priced at the top of its range, opened nearly twice the offer price, spiked to more than three times the offer price intraday, and held a market capitalization in the range of HKD 17 billion by the morning close. The global offering was roughly 9 million shares for net proceeds of about HKD 460 million, while the public tranche drew more than 230,000 valid applications, an oversubscription above 5,000 times.

    The market enthusiasm is not the point here. What deserves attention from technical teams are three facts disclosed in the prospectus, which together read like a standard exam for enterprise AI deployment:

    • Highly concentrated revenue: a single intelligent ad delivery business contributes about 87% of revenue, and intelligent data management about 12%;
    • Margin pressure trending down: gross margin fell from about 31% to about 25.5% over three years, indicating that compute and data service costs are becoming the main variable;
    • Rising customer concentration: the top five customers grew from about 50% to about 60% of revenue, while net revenue retention among end customers sits at about 88.7%, with average annual revenue per customer of about RMB 2.53 million, up about 14% year over year.

    Read together, the conclusion is clear. The hard part of commercializing enterprise AI is not whether it can generate content, but whether it can raise per-customer value and keep retention stable while gross margins are being eroded. That is precisely the problem engineering has to solve.

    2. Capability Layers: Breaking the Agent into Deliverable Modules

    An enterprise agent is not a model endpoint. It is a pipeline. A practical split is five layers, each with its own acceptance criteria:

    1. Data ingestion: collection and cleaning of multimodal raw data (text, images, behavior logs, transaction records);
    2. Knowledge and feature layer: industry knowledge bases, tagging systems, and feature stores that determine domain accuracy;
    3. Model orchestration: integration with open-source large language models or in-house small models, handling task planning, tool calls, and multi-turn dialogue;
    4. Execution and feedback: two-way integration with systems such as ad delivery, customer management, and ticketing, turning decisions into actions;
    5. Measurement and governance: metric definitions, audit logs, permissions, and compliance policies.

    The value of layering is cost control. When compute eats into gross margin, the only way out is to route most requests through low-cost paths and escalate only complex requests to more capable models. Illustrative routing logic:

    1. def route(task):
    2. # Low complexity: templated generation plus retrieval augmentation, small model
    3. if task.complexity_score < 0.4 and task.risk_level == "low":
    4. return small_model_pipeline(task)
    5. # Medium complexity: multi-turn tool calls, mid-size model
    6. if task.complexity_score < 0.75:
    7. return mid_model_with_tools(task)
    8. # High complexity or high risk: large model plus human review
    9. return large_model_with_human_review(task)

    Tiered routing is the most direct lever on cost per request, and the engineering handle for bending the margin curve back upward.

    3. Data and Compliance Are Prerequisites, Not Add-Ons

    Marketing and sales scenarios inherently involve large volumes of personal information and business data, so compliance has to enter at the architecture design stage:

    • Minimal necessary collection: take only the fields required to close the business loop, and mask and hash behavior logs;
    • Tiered authorization: control the visibility of knowledge bases and data domains by role, with sensitive fields protected by separate keys;
    • Full-chain auditing: log every tool call and every outbound touch to support traceability and accountability;
    • Explainable output: for decisions that affect customer interests, such as pricing, credit, and prioritization, retain the supporting references.

    The engineering recommendation is to implement compliance checks as a dedicated interceptor in the pipeline rather than scattered conditionals in business code:

    1. class ComplianceGuard:
    2. def __init__(self, policy_store, audit_sink):
    3. self.policy = policy_store
    4. self.audit = audit_sink
    5. def check(self, request, context):
    6. verdict = self.policy.evaluate(request, context)
    7. self.audit.write(request.id, verdict)
    8. return verdict.allowed

    4. Measuring Impact: Three Metrics Decide the Outcome

    The disclosed net revenue retention and average revenue per customer offer the best measurement template. Technical teams should align business metrics with engineering metrics:

    • Net revenue retention (target 90% or above): reflects whether the product is embedded in daily customer workflows, and maps on the engineering side to weekly active feature penetration;
    • Average revenue per customer (target 10%+ annual growth): reflects how deeply modules are reused, and maps to the number of enabled capability modules;
    • Cost per request: reflects margin health, and maps to model routing hit rate and cache reuse rate.

    Lose any one of the three and the project tends to stall at the demo stage. A weekly dashboard is recommended, with model routing hit rate monitored as a first-class metric.

    5. Budget Allocation and Evolution Roadmap

    The stated use of proceeds offers a reference ratio: about 50% to R&D, about 20% to expanding the sales network, about 20% to selective strategic acquisitions, and about 10% to working capital. Mapped to a technical team’s annual plan, this abstracts into:

    • 50% platform and model capability (orchestration framework, evaluation sets, cost optimization);
    • 20% delivery and integration (connectors, data synchronization, permission systems);
    • 20% capability gaps (build in-house or bring in external components, with licensing and compliance assessed);
    • 10% buffer and operations.

    For sequencing, three phases work best: close the loop in a single scenario first (such as lead scoring or creative generation), then orchestrate across scenarios, and finally build industry knowledge and automated operations.

    6. Common Pitfalls

    • Optimizing generation quality only, not invocation cost, which guarantees margin decline;
    • Writing custom requirements into the main branch when customer concentration is high, leading to version sprawl;
    • Lacking an offline evaluation set, so model upgrades rely on subjective impressions;
    • Handling compliance in the week before launch, which makes rework extremely expensive;
    • Tracking only call volume, not retention and per-customer value.

    7. Conclusion

    Competition in enterprise agents has shifted from demonstrating model capability to competing on engineering and measurement. Get capability layering, cost routing, compliance interception, and business metrics right, and it becomes possible to lift both per-customer value and retention in an environment of squeezed margins and fragmented demand. If a unified cloud foundation is needed, a general-purpose combination is worth considering first: a container platform to host orchestration services, object storage for multimodal data, a message queue for asynchronous decoupling, and logging plus monitoring and alerting for observability, so the team can concentrate on the business loop itself.