cURL
Create a new RAG Agent with initial status
The field composition of
draft and version beta.
Creating an Agent requires Knowledge Base - Create permission.
agent_config structure
The field composition of agent_config depends on the value of agent_scene:
- Chat:
agent_policy,agent_model,enable_session_file,enable_refusal,enable_anti_leak,enable_rich_text,enable_citation,temperature,max_num_llm_calls,max_completion_tokens,session_file_max_parse_length,kb_search_configs - Search:
agent_policy,enable_kb_router,kb_router_model,rerank_top_n,kb_search_configs,hybrid_rerank
kb_search_configs[] element fields: id, weight, credibility_level, dense_similarity_top_k, sparse_similarity_top_k, rerank_top_n, rerank_min_score, rerank, search_filters
Fields such as
name, desc, and knowledge_type are auto-filled by the system from the Knowledge Base and will be overridden even if passed in.Authorizations
string
header
required
DashScope API Key, obtained from the API Key page in the console.
Body
application/jsonstring
required
Agent name, up to 200 characters, must be unique within the same tenant and scene.
length <= 200
enum<string>
required
Agent scene: chat (knowledge Q&A) or search (knowledge retrieval).
chat,search
string
Agent description, up to 1000 characters.
length <= 1000
object
Agent configuration object. If not provided, default configuration is used.
Response
200-application/json