Building Multi-Agent AI Systems with Chinese Models
Multi-agent systems are the next evolution of AI applications. Instead of a single LLM trying to do everything, you assign specialized agents to different tasks — one for research, one for coding, one for writing — and let them collaborate. The results are dramatically better than any single-model approach.
Chinese AI models are uniquely suited for multi-agent architectures because they're cheap enough to run multiple agents simultaneously without breaking the bank. At $0.15-0.60 per million tokens, running 5 agents in parallel costs less than one call to GPT-4o.
This guide covers three practical multi-agent patterns with complete code using DeepSeek, GLM, and Qwen through AIWave.
Why Multi-Agent?
| Single Model | Multi-Agent System |
|---|---|
| One prompt for everything | Specialized prompts per task |
| Context window limits | Distributed context |
| Compromise quality for breadth | Each agent optimized for its task |
| Single point of failure | Graceful degradation |
| Expensive per quality unit | Cost-efficient with cheap models |
Pattern 1: Router + Specialist Agents
A router agent classifies the user's request and routes it to the most appropriate specialist. Each specialist has a tuned system prompt for its domain.
from openai import OpenAI
client = OpenAI(api_key="your-aiwave-key", base_url="https://api.aiwave.live/v1")
AGENTS = {
"coder": {
"model": "deepseek-v4-pro",
"system": "You are an expert programmer. Write clean, well-commented code. Always explain your approach first."
},
"writer": {
"model": "glm-5",
"system": "You are a professional writer. Write clear, engaging content. Match the requested tone and style."
},
"analyst": {
"model": "qwen3",
"system": "You are a data analyst. Provide precise, number-driven analysis. Always cite your reasoning."
},
"researcher": {
"model": "kimi-k3",
"system": "You are a research assistant. Provide thorough, well-organized summaries of topics."
}
}
def route_request(user_input: str) -> dict:
# Router classifies the request
router_response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[
{"role": "system", "content": "Classify this request as: coder, writer, analyst, or researcher. Reply with only the category name."},
{"role": "user", "content": user_input}
],
temperature=0.0
)
category = router_response.choices[0].message.content.strip().lower()
agent = AGENTS.get(category, AGENTS["researcher"])
# Forward to specialist
response = client.chat.completions.create(
model=agent["model"],
messages=[
{"role": "system", "content": agent["system"]},
{"role": "user", "content": user_input}
]
)
return {
"routed_to": category,
"model": agent["model"],
"response": response.choices[0].message.content
}
# Usage
result = route_request("Write a Python script to scrape Hacker News top stories")
print(f"Routed to: {result['routed_to']} (using {result['model']})")
print(result['response'])
Pattern 2: Sequential Pipeline
Multiple agents process the request in sequence, each adding value. Common for content generation: research → draft → edit → format.
def content_pipeline(topic: str) -> dict:
"""Research, draft, edit, and format content in a pipeline."""
# Agent 1: Researcher gathers key points
research = client.chat.completions.create(
model="kimi-k3",
messages=[
{"role": "system", "content": "List 5-7 key points about this topic. Be factual and concise."},
{"role": "user", "content": topic}
],
temperature=0.3
).choices[0].message.content
# Agent 2: Writer creates draft
draft = client.chat.completions.create(
model="glm-5",
messages=[
{"role": "system", "content": "Write a 500-word article based on these research points."},
{"role": "user", "content": f"Topic: {topic}\n\nResearch:\n{research}"}
],
temperature=0.7
).choices[0].message.content
# Agent 3: Editor improves the draft
edited = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[
{"role": "system", "content": "Edit this article for clarity, flow, and grammar. Fix any factual errors."},
{"role": "user", "content": draft}
],
temperature=0.3
).choices[0].message.content
return {"research": research, "draft": draft, "edited": edited}
Pattern 3: Debate / Reflection
Two agents with different system prompts review each other's output, creating a self-improving loop:
def debate_refine(question: str, rounds: int = 2) -> str:
"""Two agents debate and refine an answer."""
# Agent A answers
answer_a = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[
{"role": "system", "content": "Provide a thorough, technically precise answer."},
{"role": "user", "content": question}
]
).choices[0].message.content
for i in range(rounds):
# Agent B critiques
critique = client.chat.completions.create(
model="glm-5",
messages=[
{"role": "system", "content": "Critique this answer. Find flaws, missing points, and improvements."},
{"role": "user", "content": f"Question: {question}\n\nAnswer: {answer_a}"}
]
).choices[0].message.content
# Agent A refines based on critique
answer_a = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[
{"role": "system", "content": "Improve your answer based on this critique."},
{"role": "user", "content": f"Original answer: {answer_a}\n\nCritique: {critique}"}
]
).choices[0].message.content
return answer_a
Cost Analysis
| Architecture | Agents/Request | Tokens/Request | Cost/Request | Equivalent (GPT-4o) |
|---|---|---|---|---|
| Single model | 1 | 2,000 | $0.0005 | $0.010 |
| Router + Specialist | 2 | 1,500 | $0.0004 | $0.012 |
| Sequential Pipeline | 3 | 4,000 | $0.0012 | $0.028 |
| Debate (2 rounds) | 4 | 8,000 | $0.0020 | $0.050 |
Multi-agent systems with Chinese models cost 1/20 to 1/25 of the same architecture with GPT-4o. This makes complex multi-step workflows economically viable for the first time.
Frameworks for Multi-Agent
- CrewAI: Python framework for orchestrating role-playing agents
- LangGraph: State machine-based agent workflows
- AutoGen: Microsoft's multi-agent conversation framework
- DSPy: Programmatic prompting with compiled pipelines
All of these frameworks support OpenAI-compatible APIs, so they work with AIWave out of the box.
Frequently Asked Questions
Can Chinese AI models build multi-agent systems?
Absolutely. DeepSeek V4, GLM-5, Qwen 3, and Kimi K3 all support function calling and tool use, which are the core capabilities needed for multi-agent architectures. Through AIWave's OpenAI-compatible API, you can build sophisticated agent systems at 1/10th the cost of using GPT-4o.
Which multi-agent framework should I use?
CrewAI is the easiest to start with. LangGraph offers the most control for complex workflows. AutoGen is best for conversational agent patterns. All work with AIWave's API.
How much does a multi-agent system cost per day?
A typical multi-agent customer support system handling 1,000 conversations/day costs about $2-5/day with Chinese models through AIWave, versus $40-100/day with GPT-4o.
Ready to Get Started?
Access DeepSeek, GLM, Kimi, Qwen and 50+ Chinese AI models through one OpenAI-compatible API. No Chinese phone number required.
Get Your API Key →