Software Agent Architecture and Engineering Practices: A Practical Guide

    This guide explains what software agents are, how the concept evolved into an industry category, and how to build them in production. It covers the four behavioral traits that distinguish agents from traditional software, a six-layer reference architecture with an execution-loop example, the role of interoperability protocols, and practical guidance on least-privilege permissions, observability, evaluation, cost control, and compliance. Readers will come away with a clear starting point for adopting agents in a bounded, low-risk scenario.

    1. Defining the Boundary: What Is Actually New About Software Agents

    A software agent is an agent that exists in software form. The term was formally added to the third edition of Terminology in Computer Science and Technology in 2018, under the discipline of computer science and technology, and “AI Agent” is commonly used as the informal industry name. Its operating loop is straightforward: perceive the environment, make a decision, take action, with the ultimate goal of completing a task specified by a user or an upstream system.

    Four behavioral traits are what genuinely separate agents from traditional software:

    • Autonomy: once given a goal and constraints, the agent decomposes the task, selects a path, and moves forward without step-by-step human instructions.
    • Reactivity: it continuously receives environmental changes (API responses, page states, message events) and adjusts its strategy in time, rather than running as a one-shot batch job.
    • Sociality: it collaborates with other agents, tools, and services through standard protocols, forming a composable collaboration network.
    • Proactivity: instead of passively waiting for a trigger, it initiates steps based on the goal, such as proactively fetching missing parameters or proactively retrying and rolling back.

    It is worth stressing that these four traits do not negate traditional software engineering. Quite the opposite: the stronger the autonomy, the higher the requirements for observability, permission boundaries, and regression testing. Understanding an agent as “a layer of scheduling logic that plans and selects tools” is closer to engineering reality than understanding it as something that “replaces existing systems.”

    2. Evolution: From Academic Definition to a New Industry Category

    The emphasis in defining software agents has shifted. Early academic work stressed “intelligent systems that can perceive, reason, and act,” while industry has come to describe them as “systems driven by large language models that can invoke software tools and act autonomously.” In substance, the center of capability moved from algorithm research to tool integration and task delivery.

    The key milestones fall along two lines: protocol standardization and policy guidance.

    1. In late 2024, a model vendor proposed the Model Context Protocol, connecting models to external tools and data sources in a standard way and addressing the fragmentation problem where every tool required its own adapter.
    2. In 2025, the industry saw an open protocol for agent-to-agent collaboration (the Agent2Agent class of approaches); the relevant protocol was subsequently donated to an open-source software non-profit organization and entered a phase of neutral governance. The Linux Foundation also established a foundation focused on agentic AI to advance shared standards and best practices. This year is therefore widely regarded as the first year of agents.
    3. In mid-2025, the “intelligent browser” form factor appeared, turning the browser from a passive rendering container into an active participant in task execution; at the same time, low-code and workflow-building tools significantly lowered the barrier to building custom agents.
    4. In 2026, a research preview of the Model Hardware Standard was released, extending the tool-invocation idea from software interfaces to physical devices and establishing shared specifications for operating hardware.
    5. On the policy side, in September 2026 the Ministry of Industry and Information Technology issued the Special Action Plan for “AI + Software,” which calls for cultivating software agents as a new business form and for making intelligent programming, agent software, and intelligent services new growth poles of the industry by 2030. Local-level measures (such as AI support policies in Xiamen Torch High-Tech Zone) also list agent software as a key supported category of core software.

    The direct implication for developers is that the interface layer is converging, and competition is moving up to orchestration quality, domain knowledge, and engineering reliability.

    3. Reference Architecture: Six Independently Evolving Layers

    A production-grade agent can usually be split into six layers, each deployed and scaled independently:

    1. Access layer: a unified entry point for text, voice, files, and event callbacks, responsible for authentication, rate limiting, and idempotent deduplication.
    2. Perception and context layer: turns raw input into structured context, including user intent, system state, retrieved snippets, and historical summaries.
    3. Planning layer: task decomposition, step ordering, and failure-branch design; it decides what to do first and what counts as done.
    4. Tool and execution layer: invokes queries, computation, write operations, and external devices through standard protocols; this is where risk is most concentrated across the whole chain.
    5. Memory layer: short-term session cache plus long-term vector retrieval plus a structured business database; the responsibilities of the three must not be mixed.
    6. Governance layer: logs, tracing, evaluation, cost, and permission auditing, spanning all of the layers above.

    An illustrative execution loop (pseudocode, structure only):

    1. def run(task, ctx):
    2. plan = planner.decompose(task, ctx) # Planning: goal -> steps
    3. for step in plan:
    4. obs = perceive(step, ctx) # Perception: fill in context
    5. if not step.ready(obs):
    6. plan = planner.replan(plan, obs) # Reactivity: dynamic replanning
    7. continue
    8. result = tools.invoke(step.tool, obs) # Execution: permission-constrained
    9. memory.write(step, result) # Memory: replayable
    10. if step.done(result):
    11. return summarize(result)
    12. return escalate(task) # Fallback: hand off to a human

    4. Protocols and Interoperability: Why Standardization Is the Dividing Line

    Before such protocols existed, connecting an agent to N tools required maintaining N sets of adapter code, with permissions, error codes, and rate-limiting policies all differing. Context-style protocols are valuable because they standardize how models connect to tools: a tool declares its own capabilities in a uniform way (name, parameter schema, return structure), and the host discovers and invokes it dynamically. Agent-to-agent collaboration protocols solve a different problem: task delegation, capability declaration, context passing, and result return.

    Three engineering recommendations apply. Capability declarations should be explicit and verifiable. Cross-agent calls must carry a trace identifier so they can be followed through the chain. Protocol versions should stay backward compatible so that a single upgrade does not break the entire chain. If an organization already has many internal services, a “protocol gateway” pattern can adapt them once, rather than having every agent integrate with each one separately.

    5. Implementation Priorities and Common Pitfalls

    • Least privilege: high-risk actions such as writes, payments, and deleting device state need a second confirmation or a human gate; a tool-level allowlist is better than a global switch.
    • Observability: record an input summary, latency, tokens, and cost for every planning step and tool call, forming a replayable trace that makes it easier to explain why the agent acted as it did.
    • Evaluation first: build an offline test set (including boundary and adversarial inputs) plus online canary releases, and use task success rate, step count, rework rate, and human takeover rate as core metrics rather than judging only by how good the answers look.
    • Cost control: context trimming, result caching, and tiered model routing (small models for simple steps, large models for complex reasoning) are usually more effective than simply scaling up.
    • Data and compliance: mask sensitive data before it enters retrieval and memory, and define retention periods and deletion paths.
    • Cloud support: composable use of container platforms to host execution sandboxes, message queues to decouple asynchronous tasks, object storage to keep traces and artifacts, and logging and monitoring services for auditing and anomaly detection.

    6. Conclusion

    The difficulty with software agents has shifted from “can it be built” to “can it be built stably, controllably, and measurably.” With the dual push of interface standardization and policy support, it is advisable for teams to start from a scenario with clear boundaries and a controllable cost of failure, get permissions, evaluation, and observability solid first, and then gradually expand the scope of autonomy. Baidu AI Cloud can provide foundational support for engineering such systems through general-purpose capabilities including container platforms, message queues, and logging and monitoring.