Skip to main content

New Agent Application (Agent 2.0)

The new Agent application (Agent 2.0) unifies capabilities such as knowledge bases and MCPs into tools, which the agent autonomously plans and invokes through reasoning to solve complex tasks.

Version Comparison and Selection Guidance

The new Agent delivers superior performance and developer experience for most use cases. Unless you have dependencies on the legacy version, we recommend adopting Agent 2.0.
Comparison DimensionLegacy Version (Agent 1.0)New Version (Agent 2.0)
Planning & OrchestrationThe agent first retrieves from the knowledge base, then decides whether to invoke other tools (e.g., MCPs).Knowledge bases and MCPs are unified as tools; the agent autonomously plans when and in what order to invoke them.
Process TransparencyOnly the final result is shown; intermediate decisions cannot be fully traced.Fully displays the end-to-end “Plan → Execute → Reflect” chain for each step.
Suitable ScenariosBest for simple, single-intent, fixed-flow tasks.Handles diverse tasks—from basic Q&A to complex multi-step planning.
Agent 2.0 applications can also be called via the Bailian CLI: bl app call --app-id <APP_ID> --prompt "your question". See Use the CLI.

Quick Start: Create a Basic Agent

  1. Go to the Alibaba Cloud Bailian Console Application Management and click Create Agent (this creates an Agent 2.0 application by default; for the legacy version (Agent 1.0), click the Legacy Agent creation link at the bottom of the dialog — the page will redirect to the legacy Bailian console).
  2. Enter an application name and click Create Now. After creation, you’ll be automatically redirected to the configuration page.
  3. From the model selector dropdown, choose a model—e.g., Qwen-Plus-Latest.
  4. In the right-hand chat panel, enter the question: Who are you?.

Capability Configuration

Model Selection

The model selector dropdown offers two kinds of options:
  • Smart Mode: The platform automatically balances cost and quality—no need to pick a model manually.
  • A specific model: Select a particular model directly. To ensure robust multi-step planning, we recommend models with strong tool-calling capabilities such as the Qwen-Max series; click More Models to browse additional options.
Among these, Smart Mode offers four tiers—AUTO, Performance, Balanced, and Economy—all of which you select manually. The difference is that once AUTO is selected, the platform automatically assesses task complexity and dynamically routes to the appropriate tier; selecting any of the other three locks in that specific tier.
ModePositioningHighlights
AUTOAuto-routing, multi-model, context-adaptiveIntelligently matches the optimal reasoning depth and model
PerformanceHigh-quality models balancing speed and qualityFast response, 1M context, tool calling
BalancedAdvanced reasoning with high-quality outputEnhanced reasoning, 256K context, stable output
EconomyStandard reasoning with strong cost efficiencyStandard reasoning, 256K context, cost-effective
Among these, AUTO assesses task complexity on each request and dynamically routes to the appropriate performance tier:
  • Simple tasks (single-step, short Q&A, casual chat, etc.) → Economy
  • Medium tasks (single-file code, medium-length writing, multi-step reasoning, etc.) → Balanced
  • Complex tasks (multi-file architecture, long-form writing, multi-tool orchestration, etc.) → Performance
Complexity assessment considers both the latest user message and the current context length: when the context exceeds 200K tokens, the request is routed to at least the Performance tier to ensure quality on long-context tasks.
When AUTO is selected, billing follows a unified list price regardless of the model actually routed to; when you select the Performance / Balanced / Economy tier directly, billing follows that tier. See Billing Overview. Click the Settings icon (⚙️) next to the model selector to configure the following parameters:
  • Maximum Response Length: Limits the number of tokens generated by the model (excluding prompt tokens).
  • Temperature: Controls output randomness and diversity—higher values increase variability.
  • enable_thinking: Enables thinking mode, which enhances the agent’s reflection capability; unavailable for models that do not support thinking mode.

Prompt Engineering

System prompts define the agent’s role, behavioral instructions, and capability boundaries—ensuring consistency, controllability, and task compliance throughout interactions.
  1. Configure System Prompt: For example, set the system prompt to Please answer my questions in the style of *One Hundred Years of Solitude*—the model will reply in the specified style; without a system prompt, the model replies using its default persona.
  2. Use Variables in System Prompts (Optional): In addition to static text, system prompts support embedded variables.
    1. Click Create Variable (top-right corner of the Prompt editor), define your variables, and click OK to save.
    2. Type / to insert a configured variable.

Pre-parsing Files

The pre-parsing files feature controls how uploaded files are processed.
  • Disable Pre-parsing: Files won’t be parsed automatically. Their URLs are passed directly as context to the agent, which may later decide to invoke a tool and pass the URL as a parameter.
  • Enable Pre-parsing: The system uses built-in parsers to process uploaded documents, images, videos, and audio files—and returns extracted text content to the model for reference.
Qwen-VL series models possess multimodal capabilities and can directly parse images and videos—even when pre-parsing is disabled.

Built-in Tools

Built-in tools run in an isolated sandbox environment and provide code execution and file manipulation capabilities. All tools are disabled by default and must be explicitly enabled.
ToolDescription
bashExecutes shell commands—including bash, python3, pip, etc.
writeCreates or overwrites files; parent directories are auto-created.
readReads file contents—including partial reads (by line range) for large files.
editPerforms precise text replacement (find-and-replace) within files.
globSearches for files matching a pattern; returns matched file paths.
grepSearches file contents using regular expressions.
download_fileExports files generated during execution as downloadable links.

Knowledge Base

A knowledge base enables the agent to query external information and use retrieved content to generate answers. This proactive knowledge acquisition significantly improves answer accuracy and reduces hallucination—especially for private or domain-specific Q&A. To create and manage knowledge bases, see Knowledge Base. Agent 2.0 applications use knowledge bases by associating a knowledge retrieval service. A knowledge retrieval service can contain one or more knowledge bases and supports both single-knowledge-base retrieval and multi-knowledge-base joint retrieval. An application can be associated with only one knowledge retrieval service at a time; associating another service replaces the existing one. Before you associate a service, make sure that you have created a knowledge retrieval service, added the required knowledge bases to the service, and published the service. See Knowledge Retrieval.
Enabling Show Source in Response (under Response Settings) displays knowledge sources and original file/webpage URLs.

Associate a Knowledge Retrieval Service

  1. Go to the configuration page of the Agent 2.0 application and find the Retrieval Strategy area under Knowledge Base. On first configuration, the page indicates that no knowledge retrieval service is associated. Click Configure Now to open the service selection panel. You can also click Configure in the upper-right corner of the area.
  2. In the Configure Retrieval Service panel, find the target service. You can use the search box to find published retrieval services, and confirm the target based on the service name, version, included knowledge bases, and the number of knowledge bases.
  3. Click Associate on the right of the target service to associate the knowledge retrieval service with the current application.
After the association is complete, the Retrieval Strategy area displays the service name, invocation settings, and the knowledge bases and weights included in the service.

Adjust Invocation Settings

You can adjust Invocation Method and Multi-turn Rewrite on the service card to control how the application uses the retrieval service:
ItemOptionDescription
Invocation methodIntelligent invocationThe model autonomously decides whether to invoke the knowledge retrieval service based on the question and conversation context
Invocation methodAlways invokeIn each request, a knowledge retrieval is performed before the model's first inference
Multi-turn rewriteOnWhen the model autonomously invokes the knowledge retrieval service, it generates a retrieval query based on the current question and conversation context
Multi-turn rewriteOffThe original input is used for retrieval, and the rewritten query generated by the model is not used

Manage the Associated Service

The upper-right corner of the service card provides the following actions:
  • Settings: Click the gear icon to go to the corresponding knowledge retrieval service page and modify the knowledge bases included in the service and the retrieval strategy.
  • Delete: Click the delete icon to remove the association between the current application and the knowledge retrieval service. This removes the association in the application only, not the knowledge retrieval service or the knowledge bases themselves.

Modify the Retrieval Service Configuration and Publish

After you click Settings on the service card, you are directed to the Service Configuration page of the corresponding knowledge retrieval service.
  1. Add a knowledge base: Click Add in the upper-right corner of the knowledge base area to add a new knowledge base to the service.
  2. Adjust the retrieval strategy: Adjust the knowledge base weights, knowledge base routing, hybrid ranking model, and other settings as needed. The available settings are subject to the service page.
  3. Publish the changes: After the configuration is complete, click Publish in the upper-right corner of the page to publish the knowledge retrieval service configuration. Make sure you complete this step after modifying the configuration.
  4. Return to the application to confirm: Return to the Agent 2.0 application page and click the refresh icon in the upper-right corner of the Retrieval Strategy area to confirm that the knowledge bases included in the service and the related information have been updated.
Legacy knowledge bases are integrated as MCP tools and appear under Tools → MCP Services on the new Model Studio page. To add a legacy knowledge base, go to the legacy Model Studio page.
Agent 2.0 supports tagging knowledge base files to constrain search scope. By assigning tags to files and defining usage rules in the system prompt, you guide the agent to retrieve from smaller, more relevant subsets—dramatically improving answer accuracy and relevance.

MCP (Model Control Protocol)

In Agent 2.0, all external tools integrate via the MCP protocol and join the agent’s orchestration system—including official MCPs from the MCP Plaza and custom MCP services. The agent dynamically invokes MCPs in non-fixed, multi-step reasoning chains to tackle complex tasks. Plugins can also be converted to MCP services with one click.

Data Connectors

Data connectors serve as bridges for agents, workflows, and knowledge bases on the Alibaba Cloud Model Studio platform to access external data. By configuring data connectors, agents can directly query and operate on data from external data sources.

Application Components

You can integrate previously created agents or workflows as tools—provided they’ve first been published as components.

Skills

Skills are reusable capability packages that empower agents to automatically handle specific task types during conversations. Once added, the agent detects matching intents and invokes the corresponding skill—no custom code required.

Memory

  • Short-term Memory: Agent 2.0 supports short-term memory—providing contextual history across multi-turn conversations. You can configure context length from 0 to 30 turns (0 means no conversation history is passed). More turns improve coherence but increase input token count.
  • Long-term Memory: Planned for future iterations.

Environment

Environment settings let you configure authentication keys and environment variables needed for skill invocation. Once set, credentials and parameters are automatically injected at runtime—eliminating the need to hardcode sensitive info in skill code.

Response

Response settings support displaying answer sources. When enabled, source references appear as footnotes—including knowledge base entries and original file/webpage URLs. We recommend combining this with knowledge bases and web-search MCPs.

Execution & Result Analysis

After configuring your application, test it in the right-hand chat panel. For complex, multi-step requests, Agent 2.0 visualizes its decision-making process and execution trace as a card-based flow—comprising two core steps:
  1. Thinking: Shows the model’s internal reasoning logic—helpful for analyzing decision paths and diagnosing unexpected behavior. (Appears only when using a model that supports thinking mode.)
  2. Tool Invocation: Logs the exact tool call inputs and returned outputs.
Maximum ReAct Rounds (range: 1–50) limits how many times the agent may invoke tools in a single session. Upon hitting this limit, the agent exits the tool chain and generates its final response.

Application Publishing & Integration

Publishing your application is mandatory before it can be invoked or integrated elsewhere.

Publishing an Application

From the application configuration page, click Publish (top-right corner). A modal will display configuration changes since your last publish. Verify the details and click Confirm Publish to complete publishing.

Calling via API

On your agent application’s Distribution Channels tab, click View API (next to API Call) to see how to invoke your Agent 2.0 application programmatically.

Application Management

Version Management

Version management lets you edit historical version descriptions or roll back to previously published versions.
  1. On the application configuration page, click Version Management (top-right navigation bar).
  2. Hover over the target historical version card and click the edit icon (✎) in the top-right corner. In the Edit Version Info dialog, make your changes and click OK to update the description. Click Overwrite Current Draft to roll back to that version.

Billing Overview

Agent functionality incurs charges across several dimensions:
  1. Model Invocation
    • Each agent invocation consumes model credits—cost depends on model type and input/output token count.
    • Refer to the model list for pricing details per model. For Smart Mode tier list prices, see the breakdown below.
  2. Knowledge Base
    • Knowledge bases are billed on a pay-as-you-go basis.
    • Retrieved text chunks increase input token count—and thus raise model inference costs.
  3. MCP
    • Some official MCPs (e.g., text-to-image, text-to-video, speech synthesis) are billed per model invocation.
    • Third-party MCPs may incur separate fees via their own APIs—charged directly by the third party; Bailian does not bill for these.
Smart Mode Pricing Details The price unit is CNY / million tokens. AUTO is billed at a unified price regardless of the model actually routed to; when you select the Performance / Balanced / Economy tier directly, billing follows that tier. The price breakdown is as follows:
ModeInputOutput
AUTO¥3¥12
Performance¥6.4¥22.4
Balanced¥1.6¥6.4
Economy¥0.5¥2
Cache prices for each tier are as follows (same unit: CNY / million tokens):
ModeImplicit Cache HitExplicit Cache WriteExplicit Cache Hit
AUTO¥0.75——
Performance¥1.6——
Balanced¥0.32¥2.5¥0.2
Economy¥0.12¥0.75¥0.06

Frequently Asked Questions

No. Legacy and Agent 2.0 are built on fundamentally different architectures and are incompatible. Direct version switching, upgrading, or downgrading is unsupported.If you’re currently using the legacy Agent and wish to try Agent 2.0, please create a new Agent 2.0 application in the console.
Investigate across four layers:
  • Skill Configuration & Mounting: Confirm the skill was successfully created and correctly mounted to your agent application.
  • System Prompt Clarity: Ensure your system prompt clearly describes the skill’s purpose, parameters, and applicable scenarios—the model relies on this to decide when to invoke it.
  • Intent–Skill Alignment: Assess whether the user query clearly expresses intent aligned with the skill’s function. Ambiguous or mismatched queries may lead the model to skip invocation.
  • ReAct Round Limit: Check if the maximum ReAct rounds have been exhausted. The agent may have planned the tool call—but terminated early due to round exhaustion.
It supports implicit caching, but not configurable explicit caching.
  • Implicit Caching: Automatically activated when calling models that support it—requires no setup and cannot be disabled. The system identifies and caches common prefixes (e.g., identical system prompts, multi-turn history, retrieved knowledge snippets). Cached input tokens are billed at 20% of standard input pricing—reducing overall model costs.
  • Explicit Caching: Requires manually specifying cache keys in model requests. Since Bailian constructs model requests internally, explicit caching is not currently supported in Agent applications.