Agent Development in Practice: A Guide to Building a Chinese Handbook

    This article explains why teams need a systematic handbook for agent development and how to build one. It breaks down the five core modules of a deployable agent, outlines a four-stage implementation path from defining boundaries to operations, and presents writing standards and common pitfalls to avoid. Readers will gain a practical framework for turning scattered development experience into reusable engineering documentation.

    1. Why You Need a Systematic Agent Handbook

    Over the past two years, agents have moved from concept demos to real engineering projects. In practice, teams consistently run into three problems: unclear capability boundaries, fragmented development workflows, and missing knowledge capture. Many teams build prototypes but struggle to turn their experience into reusable standards, which leads to long onboarding times and repeated mistakes.

    A high-quality handbook is not just a collection of materials. It is an engineering asset that structures architectural understanding, development steps, evaluation methods, and operational experience. Its value shows up at three levels:

    • Shared understanding: Aligning the team on agent capability boundaries and module responsibilities.
    • Process standards: Turning requirement breakdown, prompt design, tool orchestration, and evaluation into standard practices.
    • Knowledge reuse: Converting lessons learned into a searchable, iterable documentation system.

    It is worth noting that third-party materials available on the market can serve as technical background, but what really determines implementation quality is the team’s own depth of understanding of general technical principles and its ability to capture knowledge in documentation. This article therefore stays product-agnostic and focuses on the general technical problems of agent development.

    2. Core Agent Architecture: Five Modules

    Regardless of the tech stack, a deployable agent typically consists of five modules. Understanding their responsibilities and how they interact is the prerequisite for development.

    2.1 Planning

    Planning determines what the agent does first and what it does next. Common approaches include task decomposition, subgoal generation, and reflection with retries. In engineering, it is advisable to decouple planning logic from execution logic instead of cramming every decision into a single prompt, which makes problems easier to locate.

    1. # Example: decouple task decomposition from execution
    2. def plan(task: str) -> list[str]:
    3. # Split a complex task into verifiable sub-steps
    4. return split_into_subtasks(task)
    5. def execute(subtasks: list[str], tools: dict):
    6. results = []
    7. for st in subtasks:
    8. results.append(tools[select_tool(st)](st))
    9. return results

    2.2 Memory

    Memory is divided into short-term context and long-term storage. Short-term memory relies on context window management, while long-term memory uses vector retrieval or structured storage. The key design points are what to write and when to recall. Writing too much pollutes the context, and inaccurate recall misleads reasoning.

    2.3 Tool Use

    Tools are the bridge between the agent and external systems. The standard practice is to define a clear name, purpose description, and parameter schema for each tool, along with input validation and timeout control, so that abnormal calls do not bring down the entire chain.

    2.4 Reasoning and Decision-Making

    This module selects the next action across multiple turns of interaction. In practice, set a maximum number of steps and termination conditions to prevent infinite loops, and introduce fallback strategies for low-confidence decisions.

    2.5 Evaluation and Observability

    An agent without evaluation cannot iterate. You need an offline evaluation set, online monitoring, and alerting, and you should log the input, output, latency, and failure reason of every call to form a closed loop.

    3. Building From Scratch: A Phased Implementation Path

    Phase 1: Define Boundaries and Scenarios

    First answer what the agent will not do. Narrowing vague requirements into verifiable input-output contracts is the first step to controlling complexity.

    Phase 2: Minimum Viable Loop

    Prioritize getting the main chain of input, planning, tools, and output working end to end. Validate feasibility with a small number of real samples, then gradually expand tool and memory capabilities.

    Phase 3: Evaluation-Driven Iteration

    Build an evaluation set that covers typical and edge scenarios. Quantify task success rate, average number of steps, and failure distribution, and use the data to drive prompt and workflow optimization.

    Phase 4: Launch and Operations

    Connect general cloud capabilities such as logging services and monitoring alerts to enable call chain tracing and anomaly localization. Container platforms can be used for elastic scaling, and object storage can hold evaluation data and documentation assets.

    4. Writing Standards for the Handbook

    Handbook quality depends on structure rather than length. The following standards are recommended:

    • Layered organization: Organize by onboarding, architecture, development, evaluation, and operations to reduce retrieval cost.
    • Consistent terminology: Maintain a glossary to avoid multiple expressions for the same concept.
    • Runnable examples: Keep code snippets minimally reproducible and note dependencies and prerequisites.
    • Traceable versions: Record applicable versions and change logs to prevent documentation from drifting away from the implementation.
    • Problem-oriented: Each chapter should answer a real development question rather than list concepts.

    5. Common Pitfalls and How to Avoid Them

    1. Over-pursuing autonomy: Blindly increasing autonomy amplifies uncontrollability. Start with small, controllable tasks.
    2. Ignoring context governance: Context bloat is one of the main causes of degraded performance. Proactively trim and summarize.
    3. No failure fallback: You must design degradation paths for tool exceptions, timeouts, and unauthorized calls.
    4. Missing evaluation: Without quantitative metrics, you cannot tell whether an optimization is effective.

    6. Conclusion

    The core competitiveness of agent development lies not in how many capabilities you stack, but in whether you have built an engineering system with clear architecture, standard processes, a closed evaluation loop, and reusable documentation. With general cloud product capabilities from Baidu AI Cloud, teams can focus more energy on business logic and knowledge capture. Turning every practice into a rule in your handbook is the foundation for the continuous evolution of agent capabilities.