Enterprise AI Agents: Architecture Practices from Models to Production

    Enterprise AI agents become useful when they can execute tasks reliably, not when another chat interface is added. This article presents an architecture for the full operational chain—understanding, planning, tool invocation, persistence, and review—and outlines practical controls for model evaluation, sandboxed execution, separated storage layers, long-term memory, release workbenches, and risk-tiered application rollout. It also proposes a phased implementation sequence that starts with identity, audit, and read-only retrieval, then moves toward limited automated writes only for low-risk, reversible actions. The goal is to help teams turn model capability upgrades into measurable task completion and lower incident cost while preserving human confirmation at the points that matter.

    When enterprises move large language models (LLMs) from chat interfaces into systems that execute tasks, the core challenge is not adding another conversational entry point. The core challenge is turning the chain of understanding, planning, tool invocation, persistence, and review into an operable engineering pipeline. Recent industry discussions have converged on the same set of capabilities: longer and more stable context, more reliable agent and coding performance, and supporting infrastructure for sandboxes, storage, memory, and development workbenches.

    The following architecture is organized around implementable design principles. It is not tied to a single product narrative and focuses only on practices that have gained broad consensus.

    1. Align Capability Boundaries Before Pursuing Broad Speedups

    Models are often expected to improve three classes of metrics at the same time: instruction following in long contexts, tool selection in multi-step agent workflows, and correctness in code generation and modification. These capabilities do not advance automatically together.

    A longer context only means the model window can hold more material. If retrieval, compression, and citation strategies remain unchanged, the model may still lose constraints later in the context. Higher agent scores often come from more stable planning and function-call formats, not from the model suddenly gaining business permissions. Improvements in coding ability must be judged by whether patches pass tests and preserve existing interfaces, not by whether a single generation looks as if it might run.

    Model selection and acceptance testing should therefore be split into separate evaluations instead of relying on a single demonstration task. At a minimum, teams should maintain four benchmark groups with fixed prompts, tool lists, and scoring scripts:

    • Long-document constraints: Provide policies, interface descriptions, and counterexamples, then check whether the model still obeys prohibitions later in the context.
    • Multi-step tools: Expose only read-only queries and controlled write operations, and count incorrect tool choices, missing steps, and duplicate calls.
    • Code changes: Use existing tests as the judge, distinguishing between “it compiles” and “its behavior is correct.”
    • Refusal and escalation: When permissions are insufficient, materials conflict, or goals are ambiguous, the agent should stop or ask for clarification rather than fabricate a result.

    These metrics can be compared across versions, but laboratory scores should not be turned directly into production commitments. After launch, teams should also replay real tickets to observe distribution drift.

    2. Runtime Isolation: A Sandbox Is an Execution Boundary, Not a Decoration

    Once an agent can modify files, run commands, or call external APIs, process-level permissions become a security boundary. A common industry approach is to place untrusted execution in short-lived sandboxes: limit the file system view, outbound network access, CPU usage, and duration, and make the working directory a one-time copy. The sandbox is destroyed when the task ends, and any artifacts that must be retained are explicitly exported.

    The purpose of a sandbox is not to make the model smarter. It is to reduce the blast radius. Typical constraints include:

    • No outbound network access by default; permit only pre-registered internal domains or message channels.
    • The workspace contains only the code and samples required for the current task. Do not mount full repository secrets or production configuration.
    • Standard output, exit codes, and changed files enter the audit log, rather than leaving only a final summary.
    • Timeouts, memory limits, and concurrency limits prevent a single looping plan from consuming a node.

    A structured task description can be used for workbench scheduling instead of forcing everything into natural language:

    1. task_id: unique identifier
    2. goal: verifiable description of the user's goal
    3. workspace: read-only inputs and writable output directory
    4. tools: allowed tools and parameter ranges
    5. limits: duration, network, maximum number of changed files
    6. done_when: tests pass, documentation is generated, or human confirmation is obtained

    Field names can follow team conventions. The key requirement is that the completion condition must be checkable. An agent without a done_when condition can easily exhaust its budget on tool calls that look busy.

    3. Storage Foundation: Separate Conversations, Artifacts, and State

    Conversation records, generated files, vector indexes, and task state should not be placed in a single “memory bucket.” A more robust design separates four types of data:

    1. Session logs: Who proposed which goal and when, plus the context summaries made visible to the model. These logs support accountability and replay.
    2. Artifact storage: Code patches, spreadsheets, contract drafts, and retrieved source fragments. Archive them by task ID in object storage and retain versions.
    3. State storage: The current step, tools already called, and pending confirmations. Key-value or document stores are suitable, and the design should support resuming after an interruption.
    4. Knowledge index: A retrieval library built by chunking policies, project documents, and API documentation. The index can be rebuilt; the original documents or artifact systems remain the source of truth.

    Once these layers are separated, “connecting a knowledge base” no longer means stuffing every document into a prompt. It means retrieving under permissions and writing citations back. Before writing to production systems, the agent should go through the same approval process as any other change: it can draft, while a person confirms key fields. Writes involving different risk levels—marketing assets, map and guide content, contract clauses, and knowledge entries—should require different approval strength instead of sharing a single “auto-publish” switch.

    4. Long-Term Memory: Store Conclusions and Evidence, Not Unverified Conversation

    Enhanced long-term memory is often interpreted as vectorizing all historical conversations. That approach introduces stale facts, over-privileged fragments, and residual privacy risk. A more practical memory design is layered:

    • User preferences: Language, output format, and common projects. Users should be able to view and delete this information.
    • Task conclusions: Confirmed decisions, interface agreements, and failure reasons, with timestamps and sources.
    • Procedural memory: Successful step templates for a class of tasks—for example, “list the change scope, run tests, then write notes”—rather than pasting every log from one run.
    • Prohibited writes: Secrets, sensitive personal information, unverified rumors, and data belonging to other tenants.

    Retrieval should use both keywords and vectors, then apply permission filtering to the results. Before writing to memory, add a check: has the conclusion been confirmed by a person or a test? Unconfirmed content should remain only in the current session, preventing a faulty plan from becoming “experience” for the next run.

    Memory should also decay. Archive it when a project ends, and limit the default retrieval window to the relevant space. Otherwise, the agent may carry an old project’s directory structure and naming conventions into a new repository, creating hidden defects.

    5. Development Workbench: Treat Agents as Releasable Software

    If an agent development platform provides only a prompt editor, teams will soon be unable to reproduce production behavior. A workbench should cover at least prompt and tool versions, evaluation sets, sandbox policies, release approvals, and production observability. An agent can be viewed as a small service:

    • Specification: Target users, allowed tools, input and output schemas, and the human takeover point when failure occurs.
    • Versioning: Model routing, system prompts, retrieval parameters, and memory-write rules should be versioned together. Online hot changes without records should be prohibited.
    • Evaluation: Use fixed cases to compare pass rate, average steps, human takeover rate, and the number of policy-violating tool calls.
    • Observability: Log planning steps, redacted tool parameter summaries, latency, and cost estimates so that loops can be diagnosed.
    • Canary release: First enable internal spaces or read-only scenarios, then allow write operations.

    The value of an intelligent workbench is that it embeds human confirmation into the process rather than removing people from it. Advanced tasks can plan autonomously, but the plan should first show its steps and impact. Write operations should execute only after user confirmation. Read-only companion assistants—such as search-and-explain or type-ahead completion features—should use different permission profiles from execution assistants that can change data. Avoid giving a single chat entry point browser access, local files, and production APIs at the same time.

    6. Application Rollout: Build a Shared Foundation, Not a Feature Checklist

    When an enterprise launches several general-purpose or vertical agents within one quarter, a common failure is that each entry point connects its own model and knowledge, leading to inconsistent permissions and definitions. A safer rollout uses a shared foundation with scenario-specific policies.

    General assistants are suited to cross-document organization, meeting minutes, information retrieval, and light writing. They are read-only by default; when writing back to documents or the knowledge base, they generate revision suggestions. Vertical assistants narrow the tools:

    • Marketing scenarios touch only campaign assets and customer segmentation rules.
    • Mapping or guide scenarios parse public information and cite sources.
    • Contract scenarios extract fields, compare against templates, and identify risks, but do not automatically seal or sign.
    • R&D scenarios modify branches and run tests in a sandbox, while merges continue through existing code review.

    For knowledge products, “exclusive knowledge” should be isolated at the space level: retrieval filtering, citation display, and update notifications should all be tied to space membership. Companion capabilities, such as input methods, browsers, and document sidebars, suit short context and low latency; they should not enable long-running autonomous execution by default. When multiple systems need integration, use unified identity and least-privilege connectors rather than handing local directories, online documents, and instant messaging records to a single process all at once.

    To measure whether an agent is actually used, do not rely only on days online and registration volume. More informative metrics include seven-day retention, task completion rate, human rewrite ratio, and the number of rollbacks caused by an erroneous execution. High retention suggests that the entry point and scenario match user needs. If completion is low while call volume is high, planning is spinning without producing results; the team should narrow the tools or rewrite the completion conditions.

    7. A Practical Implementation Sequence

    Teams do not need to wait for a model that is ahead on every benchmark before starting. A low-to-high risk sequence is recommended:

    1. Unify identity, audit, and object storage so that all assistant logs and artifacts are traceable.
    2. Launch read-only retrieval and cited answers, and evaluate hallucination and privilege violations.
    3. Provide a sandbox and diff preview for code and document changes, with human merging.
    4. Turn repeatedly successful steps into procedural memory and skill templates, and regress them periodically with a replay set.
    5. Permit limited automatic execution only for low-risk, reversible write actions, and retain one-click rollback.

    Model routing can select different specifications by task: low-latency models for short completions, long-context models for long-document planning, and models with stronger patch-evaluation results for code modification. The routing policy itself should also be versioned. If a team uses a cloud container platform, object storage, logging, and monitoring and alerting, these should be treated as generic infrastructure, with differentiation placed in permissions, evaluation, and business tools. Cloud infrastructure such as Baidu AI Cloud can provide containers, storage, and observability, but agent reliability still depends on whether completion conditions, sandbox boundaries, and human confirmation points are written into the release process—not on whether the console has another chat window.

    8. Conclusion

    The main line of agent engineering is autonomy under constraints: the model plans within the given tools and materials, the sandbox limits execution, storage leaves replayable artifacts, memory stores only confirmed conclusions, and the workbench manages versions, evaluation, and canary releases. General and vertical scenarios can share this foundation, but write permissions, knowledge scope, and human confirmation points must be separated by risk. With this structure, capability upgrades can become measurable pass rates and lower incident cost rather than a set of demonstrations that are difficult to reproduce.