AI Agent Development in Practice: From Workflows to Industry Deployment

    This article outlines an engineering approach to building AI agents, covering the core components of an agent, common development challenges, platform setup, model integration, prompt engineering, application types, knowledge base retrieval quality, protocol standardization with MCP, multimodal and custom nodes, shared patterns across industry use cases, and release and operations practices.

    1. Why an Engineering Approach to Agent Development Matters

    An AI agent is not just a conversational model. It is a combination of a model, tools, memory, and orchestration. A widely accepted definition is that an agent can perceive input, plan steps autonomously, invoke external capabilities, and evaluate and iterate on results. Compared with a single question-and-answer exchange, its key differences are that it is stateful and executable.

    This introduces three common engineering pain points:

    1. Insufficient controllability: model output is stochastic, while business processes require determinism.
    2. Missing observability: when a multi-step call chain fails, it is hard to tell whether the issue lies in the prompt, retrieval, or a tool.
    3. High integration cost: internal enterprise systems use different protocols, and hard-coding each one is not maintainable.

    Visual workflow orchestration platforms address these issues by abstracting “prompts, branching, tool calls, and data transformation” into nodes and connections, making logic explicit, replayable, and version-controlled.

    2. Environment Setup and Platform Deployment

    Beginners are advised to start with a local or private environment. Common practices include:

    • Using containers to launch the platform and its dependencies with a single command (application service, vector database, relational database, cache, object storage, and so on);
    • Configuring ports, keys, and storage backends through environment variables;
    • Adding load balancing, logging, and monitoring alerts before production, to avoid a system that “runs but cannot be operated.”

    After deployment, verify three things: whether the model provider credentials work, whether the vector database index is created properly, and whether file upload and object storage read/write permissions are fully configured.

    3. Model Integration and Prompt Engineering

    The model integration layer typically supports three options: general-purpose cloud-hosted large models, privately deployed open-source models, and self-hosted inference services. In engineering terms, models should be abstracted as “replaceable configurations” so they can be switched gradually based on task cost and quality.

    Prompt design should follow a structured pattern:

    1. # Role
    2. You are an e-commerce after-sales assistant and handle only return and exchange issues.
    3. # Context
    4. {{retrieved knowledge snippets}}
    5. # Constraints
    6. 1. If uncertain, say so explicitly and escalate to a human;
    7. 2. Do not promise compensation plans that are not in the policy;
    8. 3. Output JSON: {"intent":..., "reply":..., "need_human":bool}

    For style refinement, use few-shot examples, chain-of-thought guidance, and output format constraints to converge gradually. Use a fixed evaluation set for regression testing to avoid “fixing one scenario and breaking three others.”

    4. Five Basic Application Types

    Platform-based development usually covers five application types: conversational assistants, text generation, knowledge base Q&A, workflow orchestration, and agents with tool-calling capabilities. The selection principle is: if the answer is unique and the process is fixed, use a workflow; if the question is open-ended and requires multi-step exploration, use an agent.

    5. Knowledge Base and Retrieval Quality

    Knowledge base quality depends on four stages: chunking strategy, embedding model, retrieval recall, and reranking. In practice:

    • Chunk along semantic boundaries and keep titles and hierarchy as metadata;
    • Prioritize metadata filtering (department, time, document type) over pure similarity;
    • Add a reranking model to improve Top-K precision;
    • Establish a fallback strategy for “no answer” to reduce hallucinations.

    6. External System Communication and Protocol Standardization

    For agents to deliver real value, they must be able to read from and write to business systems. The early approach was to write adapter code for each tool, and maintenance costs rise sharply as the number of tools grows. The industry therefore adopts standards such as the Model Context Protocol (MCP): a unified server exposes tools, resources, and prompt templates, and clients discover and call them in a standard way.

    1. {
    2. "tools": [
    3. {"name": "query_order", "description": "Query logistics status by order ID",
    4. "input_schema": {"type": "object", "properties": {"order_id": {"type": "string"}}}}
    5. ]
    6. }

    With this approach, adding a capability only requires deploying a protocol server, and the agent side can reuse it with zero changes, achieving “pluggable capabilities.”

    7. Multimodal Support and Node Extensions

    Multimodal scenarios (image understanding, document parsing, speech transcription) are usually integrated as preprocessing nodes in a workflow: normalize formats and extract content first, then pass it to the model for inference. Custom nodes are used to encapsulate proprietary algorithms, data transformation, and approval logic. Define clear input and output schemas, timeout, and retry policies for each node.

    8. Common Patterns Across Four Industry Use Cases

    Whether it is e-commerce customer service, an office collaboration bot, internal enterprise knowledge Q&A, or a marketing content production pipeline, successful cases follow the same path: narrow the scenario scope → turn knowledge into assets → standardize tools → add human-in-the-loop fallback → iterate based on metrics. Core metrics include first-contact resolution rate, human escalation rate, average handling time, and answer accuracy.

    9. Release and Operations

    Before release, complete prompt regression, permission checks, sensitive data masking, and rate limiting configuration. After release, use logs and distributed tracing to locate failing nodes, and use monitoring alerts to cover three frequent failure types: model timeouts, empty retrieval results, and tool errors. General capabilities from cloud providers such as Baidu AI Cloud, including container platforms, logging services, object storage, and monitoring alerts, can serve as common infrastructure choices for hosting such applications.

    By mastering these areas, developers can move agents from demo prototypes to production systems that can be operated sustainably.