Large language models (LLMs) cannot directly access private knowledge bases or retrieve real-time information. Alibaba Cloud Bailian Agent applications enable zero-code integration of LLMs with external tools and knowledge bases—extending beyond the model’s built-in capabilities.
How It Works
An agent is driven by prompts and orchestrates external capabilities to accomplish complex tasks. Upon receiving a request, the LLM identifies the user’s intent, plans the required steps, autonomously invokes external tools, and finally synthesizes results into a coherent response.
Agents are ideal when you want the model to autonomously decide how to complete a task using available tools—rather than manually designing multi-step workflows. For example: building a customer support assistant that automatically queries a private knowledge base, calls real-time data APIs, and consolidates all results into a unified reply.
Bailian Agents support the following core capabilities:
- Knowledge Base (RAG): Connect external knowledge bases to answer questions grounded in proprietary data—ideal for domain-specific Q&A where the model’s internal knowledge falls short.
- Plugins: Invoke prebuilt platform tools such as code execution, image generation, weather lookup, etc.—ideal when the task requires concrete actions beyond conversational interaction.
Quick Start
Create a Basic Agent
- Go to the Alibaba Cloud Bailian Console Application Management page, click Create Application, then switch to the Agent Application tab and click Create Now.
- In the application configuration interface, select a model from the model dropdown—for example,
Qwen-Plus. Other parameters can remain at their defaults. - After creation, type
Helloin the left-side chat window to test your agent.
Agent Capabilities
You can extend agent capabilities by selecting models, optimizing system prompts, adding knowledge bases (RAG), and invoking plugins.
Models
The model serves as the core engine for reasoning and decision-making. Bailian Agents support Qwen-series models and custom-deployed models.
- Model Selection: Choose a model from the dropdown—for example,
Qwen-Plus. Click More Models to browse additional options. - Parameter Configuration: Click the gear icon next to the model dropdown to configure:
- Maximum Response Length: Upper limit on generated content length (excluding prompt tokens). Maximum varies by model.
- Context Turns Retained: Maximum number of prior conversation turns passed to the model. More turns improve contextual relevance.
- Temperature: Controls output randomness. Higher values increase diversity; lower values increase consistency. Range:
[0, 2). - Reasoning Mode: Enables advanced reasoning mode. Not available for models that do not support this feature.
System Prompt
The system prompt defines the agent’s role, behavior, and capability boundaries—ensuring consistent, task-oriented responses. When crafting effective prompts, consider these best practices:
- Define Role: Specify the persona the model should assume and its required domain expertise.
- Specify Output Format: Describe desired structure, length, or style of output.
- Set Constraints: Clarify prohibited content or mandatory rules the model must follow.
- Guide Tool Usage: Explicitly name tools and indicate when and how they should be used.
Knowledge Base (RAG)
Retrieval-Augmented Generation (RAG) enables agents to query external knowledge bases and ground answers in retrieved content. RAG significantly improves accuracy—and reduces hallucination—in scenarios involving proprietary or domain-specific knowledge. See Knowledge Base for details.
Text retrieved from the knowledge base consumes space in the model’s context window. Adjust retrieval strategies and chunk lengths based on your use case to maximize context utilization and avoid exceeding limits.
Plugins
Agents invoke plugins to perform concrete tasks such as code execution, web search, or text-to-image generation—extending beyond the model’s native capabilities. Bailian offers multiple official plugins and supports custom plugin integration.
Agent Interaction
Text-Based Chat
Text-based chat is the primary interaction method and supports multi-turn conversations.
Two input methods are supported:
- Text Input: Type messages directly to converse with the agent.
- File Upload: Attach documents, images, videos, or audio files.
Publishing & Invocation
Once published, your agent application can be invoked via API/SDK, deployed to third-party platforms (e.g., DingTalk, WeChat Official Accounts), or packaged as reusable components for integration into business systems.
Publish an Application
Click Publish in the top-right corner of the Agent Application Management page, then confirm with Confirm Publish.
For subsequent publishes, a modal displays changes since the last publication. If the application was created by a RAM user, ensure the
ram:CreateServiceLinkedRole permission is granted before publishing.API Invocation
In the Distribution Channels tab of your agent application, click View API next to API Invocation to see usage instructions.
Replace
YOUR_API_KEY with your actual Bailian API Key before making requests.Agent Management
Duplicate & Delete
On the Application Management page, locate your application card and use the More > Duplicate Application / Delete Application menu to duplicate, delete, or rename your agent.
Common use cases for duplication:
- Creating test versions with different prompts or models
- Customizing agents for distinct audiences or purposes
- Backing up before major configuration changes
Version Management
Version management lets you edit version descriptions or roll back to previously published versions.
- In your agent application’s Application Configuration tab, click Version Management in the top-right navigation bar.
- From the version history list, select a target version:
- To edit version metadata: hover over the edit icon, click it, update fields in the Edit Version Info dialog, then click OK.
- To revert to this version: click Overwrite Current Draft, then confirm in the secondary dialog.
Billing Overview
Agent billing includes the following components:
- Model Invocation: Charges apply per model call, based on model type and token usage.
- Knowledge Base: Retrieved text chunks increase input token count—and thus may raise model invocation costs.
- MCP (Model Capability Plugins)
- Some official MCPs (e.g., text-to-image, text-to-video, speech synthesis) are billed per model invocation.
- Some MCPs rely on third-party APIs—usage may incur separate fees charged directly by those providers. Bailian does not charge additionally for these.
- Long-Term Memory
- Storage of long-term memory data is free.
- During Q&A, memory content is injected into the prompt sent to the LLM—increasing token consumption. Tokens consumed by memory content are currently not billed.
Supported Models
Model availability may lag slightly behind live updates. Always verify supported models directly within the Agent Application interface.
- Qwen-Plus
- Qwen-Max
- Qwen-VL-Max
- Qwen-VL-Plus
- Qwen-Turbo
Frequently Asked Questions
How are Bailian applications billed?Creating an application incurs no cost. You’re only billed for model invocations during actual Q&A usage. I configured a knowledge base, but the agent’s responses ignore it. How do I fix this?
First, run a knowledge base hit test to check similarity scores between your query and retrieved content. If scores are low, adjust retrieval settings to prioritize knowledge base grounding. Explicitly instruct the model in your system prompt to answer only using knowledge base content—not its own training data. If issues persist, try switching to another model for more stable behavior. Do custom plugins have timeout limits?
Yes—custom plugins time out after 5 seconds. Can I create agent applications programmatically via API?
Yes—you can use the Assistant API to create LLM applications functionally equivalent to agents. However, applications created via the Assistant API cannot be managed via the console.