A Practical Guide to Building AI Agent Applications on a Platform

    This article explains why building production-ready AI agents requires a platform rather than one-off model API calls, and walks through the four application types mature agent platforms support: conversational assistants, content generation apps, task-driven agents, and workflow orchestration apps. It breaks down the five-layer technical architecture, shares key practices for knowledge base and retrieval quality (including hybrid search and reranking), covers tool-calling and controllability design, and outlines evaluation, rollout, and ongoing operations so agents can move reliably from prototype to production.

    1. Why Agent Development Needs a Platform

    Now that generative model capabilities are widely available, the hard part of building a usable AI agent is no longer “calling a model API once.” The real challenge is embedding model capabilities into business processes reliably. A typical intelligent customer service system or data analysis assistant has to solve a whole set of engineering problems at once: prompt design, context management, knowledge retrieval, tool invocation, result validation, permissions, and auditing. Starting from scratch, a team needs frontend, backend, data, and algorithm skills, and also has to carry the operational cost of server resources, key management, rate limiting, and security authentication. Prototype cycles are usually measured in weeks.

    The value of a platform approach is that it consolidates these cross-cutting concerns into reusable infrastructure. Developers orchestrate applications through a visual interface, while the platform automatically takes over model integration, session state, file parsing, vector retrieval, and API packaging, compressing the cycle from “idea to usable prototype” down to hours. It is worth stressing that platformization does not replace engineering skills; it shifts the engineering focus from repeated setup toward scenario modeling, data quality, and effectiveness evaluation.

    2. Four Application Types a Platform Should Support

    A mature agent development platform typically supports four basic application types, each corresponding to different technical complexity and delivery forms.

    The first type is the conversational assistant. Built around multi-turn dialogue, it relies on context window management and session memory strategies, and fits scenarios such as customer service, internal Q&A, and training role-play. The key is to control context length, design fallback responses, and keep a human handoff channel available.

    The second type is the content generation application. Aimed at tasks like summarization, rewriting, translation, and structured extraction, it focuses on prompt templating, output format constraints, and concurrency control for batch tasks. From an engineering standpoint, it is advisable to apply schema validation to outputs to avoid parsing failures in downstream systems.

    The third type is the task-driven agent. The model performs task decomposition during reasoning and calls external tools. Common paradigms include alternating reasoning and action, as well as native model function calling. Such applications must design a tool whitelist, timeouts and retries, and idempotency keys to prevent side effects from repeated execution.

    The fourth type is the workflow orchestration application. It organizes a multi-node process as a directed graph, supporting conditional branches, loops, variable passing, and external API calls, making it suitable for production pipelines with high demands on determinism and observability. A common practice is to use the workflow to keep the main path controllable, and use the agent to handle local, non-deterministic steps.

    3. Understanding the Technical Architecture in Layers

    From an architectural perspective, such a platform can generally be divided into five layers.

    The access layer handles application publishing and multi-channel reach, producing accessible interaction entry points and standard APIs so the application can be embedded into existing business systems. The orchestration layer carries prompts, model selection, workflow nodes, and variable mapping, and is the core of visual configuration. The capability layer encapsulates model inference, vector retrieval, reranking, document parsing, and tool registration, usually using an adapter layer to hide differences between model providers and make models replaceable. The data layer manages knowledge base chunks, embedding vectors, session records, and labeled data, involving common cloud components such as object storage, relational databases, vector indexes, and caches. The operations layer provides logging, tracing, metrics monitoring and alerting, along with key hosting, quotas, and access control.

    Understanding the layers matters for fault localization and capacity planning: if results are poor, check data and prompts first; response jitter usually comes from retrieval and external APIs; and concurrency bottlenecks typically appear in model quotas and vector indexes.

    4. Key Practices for Knowledge Base and Retrieval Quality

    Retrieval augmentation is a prerequisite for agents entering enterprise scenarios. Documents must first be parsed and cleaned to remove headers, footers, and duplicate content, then chunked along semantic boundaries. Chunks that are too large introduce noise, while chunks that are too small lose context. The embedding model and chunking strategy should be tuned together, and original position metadata should be retained for citation traceback.

    Relying on vector similarity alone often produces recalls that are “semantically close but factually wrong.” It is recommended to introduce a hybrid strategy combining keyword retrieval and vector retrieval, then use a reranking model to improve top-result precision. For multi-hop questions, query rewriting and sub-question decomposition can be applied. For evaluation, build a labeled Q&A set and separately measure recall hit rate and answer accuracy, rather than relying only on subjective experience.

    The following sample retrieval configuration illustrates the data contract between nodes:

    1. retrieval:
    2. strategy: hybrid # vector + keyword
    3. top_k: 8
    4. rerank:
    5. enabled: true
    6. top_n: 3
    7. score_threshold: 0.35
    8. fallback: "When no evidence is retrieved, state this clearly and hand off to a human"

    5. Tool Invocation and Controllability Design

    Tools are the bridge between an agent and business systems. When registering a tool, you should clearly define its name, purpose description, and parameter schema; the quality of the description directly determines how accurately the model selects the tool. Engineering constraints include least-privilege authorization, input schema validation, call timeouts and limited retries, idempotency for write operations, and full audit trails. High-risk actions should have a confirmation step or human approval, and sensitive data should be masked in prompts and logs.

    6. Evaluation, Launch, and Continuous Operations

    Before launch, build an offline evaluation set covering common questions, edge cases, and adversarial prompts, with metrics including task completion rate, citation accuracy, latency, and cost per call. During canary release, compare the new and old versions with a small traffic share, and keep a rollback configuration. After launch, continuously iterate on prompts and the knowledge base based on logs and user feedback, forming a closed loop of “label — regression — release.” On Baidu AI Cloud, deployment and observability can be built by combining common capabilities such as the container platform, object storage, log service, and monitoring and alerting, so that an agent moves steadily from prototype to production.