← Back to Leaderboard
QQwenLM

QwenLM/Qwen-Agent

Python SDK for Qwen assistants that use tools, MCP, and document retrieval

Engineering Health (Methodology)
B · 59/100
Maintenance Activity
● Updated 9mo ago
Latest Release
v0.0.26
Commercial License Check
Apache-2.0 · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance6/35
Fork Adoption22/25
Release Cadence11/20
License Clarity20/20
Self-HostedMCPAPI
Total Stars
★ 17,309
24h Growth
+2
7d Growth
+26
Forks
1,780

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

QwenLM/Qwen-Agent Star History (2023-09-23 - 2026-12-04) ALL-TIME STAR HISTORY (2023-09 – 2026-12) +17.3k in 1168d · avg +15/day 18.3k 9.1k 0 2023-09-23: ★ 12023-12-09: ★ 3962024-02-24: ★ 6092024-05-11: ★ 1,6462024-07-27: ★ 2,6322024-10-12: ★ 3,1282024-12-28: ★ 4,4252025-03-15: ★ 5,9682025-05-31: ★ 8,8522025-08-16: ★ 10,6252025-11-01: ★ 11,8272026-01-17: ★ 12,6452026-04-04: ★ 15,5812026-06-20: ★ 16,4042026-09-05: ★ 16,9662026-12-04: ★ 17,309 ★ 17.3k 2023-09 2025-04 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Qwen-Agent is a Python SDK with separate extension points for model access, tools, and agent orchestration. BaseChatModel provides the model-facing interface, including function calling. BaseTool defines the tool contract; register_tool makes custom implementations available by name. Agent is the base class for orchestration, and the built-in Assistant takes a model configuration, system message, tool list, and optional files.

The chatbot example makes state ownership explicit: application code keeps the message list, passes it to Assistant.run, consumes streamed responses, and appends the returned messages to the history. Tool integrations can use Python implementations or configured MCP servers; the local MCP examples launch server processes through npx or uvx. The repository separates the qwen_agent package, examples, and tests from application and serving code in browser_qwen/, qwen_server/, and run_server.py.

Key Capabilities & Differentiators

Function calling is available at the model layer and underpins agents such as FnCallAgent and ReActChat. The default tool-calling template supports parallel function calls. MCP extends the available tool set beyond in-process Python implementations, and v0.0.24 added support for treating an MCP server resource as a tool. The same release added a fallback for invalid tool-call output and allowed empty tool responses.

Assistant can take PDF files for document workflows. The long-document examples offer a retrieval-oriented implementation in assistant_rag.py and a more expensive agent approach in parallel_doc_qa.py; the one-million-token example is a single-needle retrieval test, not a general document QA accuracy guarantee. Model access includes DashScope and self-hosted OpenAI-compatible endpoints. Transformers model support and audio input were added in v0.0.24. Gradio WebUI provides a demo interface, while BrowserQwen is a separate example application.

Trade-offs & Limitations

Compared with calling a model API directly, Qwen-Agent is useful when one application needs tool dispatch, document retrieval, and MCP integration. A small application with a fixed set of tools may be easier to maintain with a direct API loop. Compared with a provider-neutral framework, the main reason to adopt Qwen-Agent is its integration with Qwen's tool-calling behavior. An OpenAI-compatible endpoint gives you serving choices, but it does not remove the need to test parsing against the specific model and backend.

DashScope avoids operating an inference server but introduces an external dependency and service costs. Self-hosting gives you more control over model placement, not automatic control over every tool's data flow. In production, scope MCP permissions and validate tool arguments at the execution boundary. The Docker interpreter mounts only the specified working directory and provides basic isolation; do not treat that alone as a sufficient boundary for untrusted workloads. Apache-2.0 covers the framework, not necessarily the models, services, or tools you pair with it.

Hardware & Deployment Guide

Install the Python package from PyPI and select the extras you need: gui, rag, code_interpreter, and mcp. Editable installation from source is also available. DashScope uses DASHSCOPE_API_KEY or an explicitly configured API key. For self-hosting, use an OpenAI-compatible endpoint: vLLM is the GPU-oriented route and Ollama is the local CPU or GPU option. Size inference separately from orchestration using the chosen model, representative context lengths, and expected concurrency; no fixed VRAM requirement is established.

Match tool parsing to the model before rollout. For QwQ and Qwen3 on vLLM, omit --enable-auto-tool-choice and --tool-call-parser hermes so Qwen-Agent handles parsing. For Qwen3-Coder, enable both flags and pair vLLM's built-in parser with use_raw_api. The interpreter requires a running Docker installation and may need network access for its initial image build, so prepare the image and tool dependencies before an offline rollout. For MCP, v0.0.25 added Streamable HTTP and switched the license to Apache-2.0; v0.0.26 added configurable SSE read timeouts and automatic reconnection.

SDK layers: BaseChatModel, BaseTool, and Agent are separate extension points; Assistant combines a model configuration, tools, and files.
Function calling: FnCallAgent and ReActChat build on model tool calls, and the default template supports parallel calls.
MCP transports: v0.0.25 added Streamable HTTP; v0.0.26 added configurable SSE read timeouts and automatic reconnection.
Document QA: assistant_rag.py and parallel_doc_qa.py provide two approaches to long-document question answering with different execution costs.
Model serving: DashScope and self-hosted OpenAI-compatible endpoints are supported, with different vLLM tool-parsing settings for Qwen3 and Qwen3-Coder.
Execution isolation: The code interpreter uses local Docker containers and mounts the specified working directory; that is basic isolation, not a production security guarantee.
Best For

Python teams building Qwen-based assistants that combine document retrieval, custom tools, and selected MCP servers, with the option to use DashScope or self-host inference.

Skip If

A direct model API call covers your workflow, model-provider portability is the top priority, or you need production-grade isolation for untrusted code without building additional controls.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

Self-HostedMCPAPI
pip install -U "qwen-agent[gui,rag,code_interpreter,mcp]"
# Or use `pip install -U qwen-agent` for the minimal requirements.
# The optional requirements, specified in double brackets, are:
#   [gui] for Gradio-based GUI support;
#   [rag] for RAG support;
#   [code_interpreter] for Code Interpreter support;
#   [mcp] for MCP support.

Comparison vs. Top Agents & Frameworks Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
Qwen-Agent ★17.3k+26PythonApache-2.0Python SDK for Qwen assistants that use tools, MCP, and document retrieval
browser-use122.7k+477PythonMITPython REPL and CDP for adaptive browser automation
langchain150.4k+299PythonMITModular Python framework for building agents across model providers
agentscope37.2k+342PythonApache-2.0Python ReAct SDK and FastAPI service for observable, interruptible agent workflo

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/QwenLM/Qwen-Agent.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

QwenLM/Qwen-Agent Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about Qwen-Agent

How do I integrate an existing Python service as an agent tool?

Implement a BaseTool subclass, register it with register_tool, and include its registered name in the Assistant's function_list. Define the tool description and parameter schema, and validate the model-generated arguments inside the tool. The calling application passes message history to Assistant.run and can consume responses as they stream.

What hardware and VRAM do I need?

With DashScope, model inference runs remotely; the Python application still handles orchestration and any enabled local tools. For self-hosted inference, size the model server separately: vLLM is the GPU-oriented path, while Ollama is an option for local CPU or GPU execution. There is no fixed VRAM requirement for Qwen-Agent itself. Measure the chosen model at representative context lengths and concurrency, and budget separately for Docker if code execution is enabled.

Can I use it commercially in a self-hosted product?

The framework switched to Apache-2.0 in v0.0.25, which permits commercial use subject to the license terms. Check obligations separately for model weights, MCP servers, and hosted services. Self-hosting the model endpoint does not by itself guarantee that data stays on premises: review where enabled tools send data and what files they can access.

When should I choose Qwen-Agent over a direct API or a provider-neutral SDK?

Use the SDK when you want a ready-made Assistant that combines Qwen tool calling with document retrieval, custom tools, or MCP. Call the model API directly when the application only needs a small, predictable tool loop. If provider portability is the main requirement, evaluate a provider-neutral framework and verify tool-call behavior across your target backends rather than assuming OpenAI-compatible endpoints behave identically.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining QwenLM/Qwen-Agent? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature QwenLM/Qwen-Agent on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare