Enterprise General-Purpose AI Agent Architecture: A Practical Technical Guide

    This article presents a reusable technical architecture for enterprise general-purpose AI agents, moving beyond conversational Q&A tools toward autonomous work agents. It covers capability boundaries, a six-layer reference architecture, tool calling and enterprise system integration, long-running tasks with sub-agents, event-driven and scheduled triggers, context and memory management, model abstraction for cost control, and security and governance requirements. It also outlines a phased adoption roadmap. The content is intended for developers and enterprise architects evaluating how to build and operate such systems.

    Enterprise General-Purpose AI Agent Architecture: A Practical Technical Guide

    1. Introduction: From Chat Tool to Work Agent

    Over the past few years, most enterprise deployments have centered on conversational tools built around question answering: a user asks a question, the system responds, and a human still closes the loop on the task. More recently, a new form has emerged across the industry, commonly referred to as a general-purpose agent. The key difference is that it no longer outputs text only. Instead, it autonomously plans steps around a goal, calls existing enterprise tools and data, advances tasks over long time spans, and delegates subtasks to other agents when necessary.

    This article does not target any specific vendor product. Instead, it abstracts this class of systems into a reusable technical architecture and discusses capability boundaries, key modules, engineering challenges, and governance requirements for developers and enterprise architects.

    2. Capability Boundaries: What a General-Purpose Agent Can Actually Do

    From an engineering perspective, a mature general-purpose work agent typically covers four categories of tasks, and all four share the same context:

    1. Q&A and knowledge retrieval: Retrieval-augmented generation over enterprise documents, tickets, and knowledge bases, with answers that include clear citations.
    2. Knowledge work processing: Reading spreadsheets, writing documents, building slides, and organizing meeting notes. In essence, this is reading, writing, and converting structured and unstructured documents.
    3. Content creation and multimodal generation: Drafting text, images, and audio or video material for human review.
    4. Code writing and execution: Generating code and running it in a controlled sandbox, then reading execution results to continue iterating.

    The key design principle is “a single entry point with orchestrated capabilities.” Users do not need to switch between multiple tools; the agent handles intent recognition, task decomposition, and tool selection internally. The requirement this places on the system is not a “smarter model” but a rigorous orchestration layer.

    3. Layered Architecture: A Practical Reference Model

    It is advisable to split the system into six layers, each with a single responsibility and the ability to evolve independently:

    • Interaction layer: Web, mobile, and desktop clients, plus integrations with internal collaboration tools and third-party applications.
    • Session and context layer: Maintains goals, constraints, intermediate artifacts, and long-term memory.
    • Orchestration layer: Task decomposition, plan generation, and retry and rollback strategies.
    • Tool and connector layer: Adapters and authentication for enterprise systems, internal APIs, and data sources.
    • Execution layer: Code sandbox, file processing, rendering, and execution of external actions.
    • Governance layer: Identity, permissions, audit, quotas, and observability.

    The orchestration layer is the most commonly underestimated part. A reliable orchestrator needs to explicitly represent the “current goal, completed steps, and assumptions to be verified” rather than stuffing all state into the conversation history.

    1. # Illustration: minimal state machine skeleton for the orchestration layer (pseudocode)
    2. class AgentRun:
    3. def __init__(self, goal, constraints):
    4. self.goal = goal
    5. self.constraints = constraints
    6. self.plan = [] # pending steps
    7. self.artifacts = {} # intermediate artifacts
    8. self.memory = Memory() # long-term memory reference
    9. def step(self):
    10. if not self.plan:
    11. self.plan = planner.decompose(self.goal, self.memory)
    12. task = self.plan.pop(0)
    13. result = executor.run(task, tools=self.tools, sandbox=True)
    14. self.artifacts[task.id] = result
    15. if not verifier.check(task, result):
    16. self.plan.insert(0, task.retry())
    17. return result

    4. Tool Calling and Enterprise System Integration

    To do real work, an agent must be able to read from and write to enterprise systems. Three principles are recommended:

    • Standardized connectors: Wrap each enterprise system in a unified description of “capability description + authentication method + parameter schema.” The model faces only the capability description, not raw interface details.
    • Least privilege and agent identity: Assign the agent a separate identity with separate permissions rather than reusing an individual’s account. This makes “what the agent did” distinguishable from “what a person did.”
    • Tiered write operations: Read operations can run automatically. Write operations are tiered by impact: low-impact actions run automatically, while high-impact actions require human confirmation or a two-person review.

    In office collaboration scenarios, an agent typically needs to connect with email, cloud storage, documents, spreadsheets, presentations, instant messaging, and calendars. These are common general capability categories in the industry and can be integrated through standard connectors, without custom logic for each system.

    5. Long-Running Tasks, Sub-Agents, and Concurrent Collaboration

    Real enterprise tasks often take tens of minutes or even days, which introduces two design requirements.

    First, tasks must be persistable. Runtime state needs to be written to storage so that execution can resume after a process restart. The input and output of each step must be traceable to support failure replay.

    Second, complex tasks need to be split into sub-agents. The main agent owns the goal and acceptance criteria, while sub-agents each hold independent context and permissions and process subtasks such as retrieval, writing, and verification in parallel. The main agent then aggregates the results. Sub-agents do not share their full history directly; they exchange only structured results, which significantly suppresses context pollution and error accumulation.

    1. Main agent (goal: produce a quarterly business review)
    2. ├── Sub-agent A: pull metric data and validate definitions
    3. ├── Sub-agent B: retrieve historical documents and decision records
    4. ├── Sub-agent C: generate charts and a first text draft
    5. └── Main agent: cross-check → produce final draft → submit for human review

    6. Trigger Mechanisms: Scheduled and Event-Driven

    The form that maximizes an agent’s value is not “waiting to be asked” but “acting on schedule and reacting to events.”

    • Scheduled tasks: Periodic inspections, daily report generation, and data synchronization checks. Engineering must account for idempotency, staggered scheduling, and timeout circuit breaking.
    • Event triggers: Workflows driven by business events such as ticket status changes, new files, or pipeline failure alerts. It is recommended to introduce a message queue for peak shaving and replay, with each event carrying a unique identifier to guarantee idempotent consumption.
    1. # Illustration: event-driven workflow definition
    2. trigger:
    3. type: event
    4. source: internal-messaging
    5. event: file.created
    6. filter: { path_prefix: "/reports/inbox/" }
    7. workflow:
    8. - action: extract_and_summarize
    9. - action: cross_check_with_knowledge_base
    10. - action: notify_owner
    11. requires_approval: true

    7. Context and Memory: Cross-Device Consistency

    The user expectation is “start a conversation halfway on the phone, then continue on desktop.” This requires context and memory to be stored in the cloud, with the client handling only rendering and capture. Memory is best divided into three layers:

    1. Short-term session context: The working set for the current task, archived when the task ends.
    2. Task-level memory: Goals, constraints, completed steps, and acceptance conclusions.
    3. Long-term knowledge memory: User preferences, organizational terminology, and historical conclusions, with support for retrieval and invalidation updates.

    Engineering must pay particular attention to the write threshold and forgetting mechanism for memory. Not every conversation should be retained long term, and sensitive information should have lifecycle policies.

    8. Pluggable Models and Cost Control

    Different tasks place very different demands on model capability: extraction and classification can use small models, while complex reasoning and code generation require stronger models. The architecture should therefore include a model abstraction layer that routes tasks to different models and retains a fallback path. This controls cost and avoids being locked to a single model’s capabilities. Routing decisions can be made jointly based on task type, context length, latency requirements, and budget.

    9. Security, Governance, and Observability

    The prerequisite for enterprise adoption is governance first:

    • Identity and permissions: Independent agent identity, temporary authorization per task, and permissions revoked when the task ends.
    • Audit: Record in full “who, under what goal, called what, and changed what,” with logs sent to a unified logging service.
    • Data boundaries: Define which data may enter the model context, and mask or process sensitive fields locally.
    • Observability: Establish monitoring and alerts for task success rate, average number of steps, tool failure rate, and human takeover rate.
    • Quotas and circuit breaking: Limit the number of steps and calls per task to prevent runaway loops from generating high costs.

    10. General Capability Support from the Baidu AI Cloud Perspective

    In Baidu AI Cloud’s technical stack, building this kind of agent typically reuses a combination of general cloud capabilities: a container platform to host the execution sandbox and orchestration services, a message queue to handle event-driven flows, object storage to hold task artifacts, logging and monitoring services for observability, and unified identity and access management for agent identity and least privilege. At the model layer, appropriately sized model capabilities can be selected per task and integrated through a unified model service interface, preserving architectural replaceability and cost control.

    1. Start with a narrow scenario: Begin with high-frequency, low-risk tasks whose results are easy to verify, such as organizing meeting notes, summarizing weekly reports, or triaging tickets.
    2. Read-only before write: Grant read permissions only at first, then gradually open write operations after verifying accuracy.
    3. Enforce human gates: Key outputs must pass through a human confirmation step, and the confirmation data should be captured for evaluation.
    4. Build an evaluation set: Construct regression evaluations from real tasks and run them every time a model is swapped or a prompt is adjusted.
    5. Expand permissions gradually: Use “declining human takeover rate” and “declining rework rate” as quantitative grounds for expanding permissions.

    12. Conclusion

    The difficulty of general-purpose agents lies not in “whether they can generate a polished piece of text” but in long-task reliability, tool-calling security, context consistency, and auditable governance. By decoupling the system into layers, applying least privilege to permissions, designing triggers across both event and scheduled channels, and routing models by task, enterprises can gradually unlock the productivity of this technology under controllable risk.