Enterprise AI Agent Architecture: A Technical Guide to Building General-Purpose Work Agents

    This article breaks down the engineering architecture behind enterprise-grade general-purpose AI agents. It explains how these systems differ from traditional instruction-based assistants, why a unified entry point matters, and how to connect enterprise tools and private data through controlled interfaces. Key topics include multi-agent orchestration, persistent state machines for unattended execution, layered memory across devices, pluggable model routing, and the governance requirements needed for production deployment. Readers will also find practical risk mitigation strategies and a phased adoption roadmap.

    1. From Instruction Response to Goal Completion: The Shift in Work Agent Positioning

    Throughout the evolution of enterprise software, intelligent assistants have largely remained at the stage of “question-and-answer” interactions or executing preset actions within a single application. The core difference of a general-purpose work agent is that the user provides a goal rather than a sequence of steps. The agent must decompose the task on its own, select tools, invoke data, validate results, and roll back or retry when necessary. This requires three layers of capability: a task understanding layer, a tool orchestration layer, and an execution and feedback layer. If any of these three layers is missing, the agent degrades into a script or a chat window.

    To evaluate whether a solution is truly “general-purpose,” you can use four self-check questions: Can it complete a closed loop across applications? Can it run continuously without human supervision? Can it incorporate enterprise private knowledge into its reasoning? Can it be governed and audited in a unified manner? All four goals are essential.

    2. The Engineering Value of a Unified Entry Point

    Consolidating Q&A, knowledge processing, content generation, and code writing and execution into a single interface appears to be an interaction simplification, but it is essentially about context reuse. The problem with scattered tools is that every switch loses background information, leading to repeated clarification and repeated retrieval. The benefits of a unified entry point include:

    • Context continuity: The goal, constraints, and intermediate outputs of the same task can be directly referenced by subsequent steps;
    • Consistent permissions: Identity and visibility scope are adjudicated uniformly at the entry layer, avoiding fragmentation across individual tools;
    • Improved observability: A centralized call chain makes it easier to track latency, failure rates, and costs.

    3. Key Design for Integrating Enterprise Tools and Private Data

    To “take action,” an agent must connect to existing systems through controlled interfaces. In practice, this typically covers three types of resources: collaboration and documentation (email, cloud storage, documents, spreadsheets, presentations, instant messaging, calendars), business systems (tickets, orders, resource management platforms), and data and storage (object storage, data warehouses, message queues). Key design points are as follows:

    1. Least privilege: Grant scopes per task rather than opening full read/write access at once;
    2. Idempotency and rollback: Write operations must carry an idempotency key and support compensation on failure;
    3. Structured returns: Tool outputs should be unified into parseable structures to reduce the probability of model misreading;
    4. Rate and quota: Set token buckets for high-frequency calls to prevent amplifying failures.

    An illustrative tool registration structure (pseudocode):

    1. ToolSpec {
    2. name: "query_ticket"
    3. scope: ["ticket.read"]
    4. input_schema: { id: string, since?: timestamp }
    5. output_schema: { status: enum, owner: string, payload: object }
    6. idempotent: true
    7. timeout_ms: 8000
    8. retry: { max: 2, backoff: "exponential" }
    9. }

    4. Multi-Agent Collaboration: Breaking Complex Tasks into Verifiable Units

    Complex work is often difficult for a single execution entity to complete. A viable approach is to have a main agent handle task decomposition and result aggregation, while sub-agents each take on sub-goals such as retrieval, writing, coding, and validation, exchanging intermediate conclusions through a message bus or a shared blackboard. Engineering considerations include:

    • Clear boundaries: Sub-agents do not share write permissions, preventing mutual overwrites;
    • Verifiable results: Each sub-goal defines acceptance criteria, and failed ones are reassigned;
    • Conflict resolution: Concurrent modifications to the same resource use version numbers or locking mechanisms;
    • Cost control: Set maximum iteration counts and budget caps for sub-agents.

    5. Long-Running Execution, Scheduling, and Event Triggers

    Unattended scenarios require agents to have a persistent state machine: task states, completed steps, and pending dependencies must all be persisted, so the process can recover from a checkpoint after a restart. Triggers typically fall into three categories: scheduled (periodic inspections and reports), event-based (messages, file changes, pipeline completion), and manual confirmation (high-risk actions require secondary authorization). A simplified representation of state transitions:

    1. created -> planned -> running -> verifying -> done
    2. | |
    3. v v
    4. retrying blocked(waiting for manual confirmation)

    6. Consistent Memory and Context Across Devices

    Retaining the same memory across devices is not about “syncing chat history” but about layered memory: short-term working memory holds the current task draft; mid-term episodic memory holds task trajectories and decision rationale; long-term semantic memory holds curated enterprise knowledge. Before writing to long-term memory, deduplication, timeliness tagging, and permission tagging should be performed to prevent expired or unauthorized information from contaminating subsequent reasoning.

    7. Pluggable Models and Routing Strategies

    Selecting the underlying model by task is a pragmatic approach: structured extraction and classification can use lightweight models to reduce costs, while long-context reasoning and code generation use more capable models. Routing can be decided comprehensively based on task type, context length, latency requirements, and compliance region, with fallback paths retained. It is worth emphasizing that model replaceability means the interface layer must abstract capabilities, avoiding binding business logic to a specific model.

    8. Security, Management, and Governance

    The prerequisite for enterprise adoption is governance capability: unified identity and single sign-on, fine-grained authorization, key management, data residency policies, full-chain auditing and logging, sensitive information masking, and output content compliance checks. For high-risk actions (deletion, external sharing, bulk modifications), automatic execution should be disabled by default and replaced with an approval workflow. Audit logs are recommended to include: initiator, agent identifier, target resource, parameter summary, result status, and latency.

    9. General Practice Recommendations from Baidu AI Cloud

    In the technical practice of Baidu AI Cloud, such systems typically rely on a container platform to host the agent runtime, use message queues to enable event-driven workflows, store intermediate outputs in object storage, and build an observability loop through logging services and monitoring alerts. The recommended adoption path is in three steps: first, build read-only assistive Q&A to validate knowledge and permissions; then, open controlled write operations with approval and rollback in place; finally, expand to multi-agent collaboration and unattended workflows.

    10. Common Risks and How to Avoid Them

    • Goal drift: Task decomposition lacks acceptance criteria, causing results to deviate; explicitly define completion conditions;
    • Permission inflation: Opening broad permissions for convenience; adhere to on-demand granting and periodic review;
    • Hallucination amplification: Tool returns are referenced without validation; introduce structured validation and source tagging;
    • Cost overrun: Multi-agents retry repeatedly; set budgets and iteration caps;
    • Missing audit trails: Inability to trace the decision process; uniformly record the call chain and intermediate conclusions.

    In summary, the competitive focus of enterprise-grade general-purpose intelligent agents has shifted from single-model capability to workflow entry points, depth of tool integration, and governance maturity. A goal-driven approach, with permissions as boundaries and auditing as the standard, is the sustainable engineering path.