# Qwen-Agent

> An open-source framework by Alibaba's Qwen team for building LLM applications with function calling, tool usage, planning, MCP, RAG, and memory capabilities.

Qwen-Agent is an open-source Python framework developed by Alibaba's QwenLM team for building LLM-powered applications on top of the Qwen model family. It provides both atomic components (LLMs, tools) and high-level agent abstractions, and serves as the backend for Qwen Chat. The project is licensed under Apache 2.0 and is actively maintained on GitHub.

## What It Is

Qwen-Agent is an agent development framework that exposes instruction-following, tool usage, planning, and memory capabilities of Qwen models to developers. It sits in the agent framework category — giving developers building blocks to compose multi-step, tool-using AI applications rather than a finished end-user product. The framework ships with example applications including a Browser Assistant, Code Interpreter, and Custom Assistant, and now powers the Qwen Chat backend.

## Core Architecture

The framework is organized around three layers of abstraction:

- **LLM layer** — `BaseChatModel` subclasses that wrap DashScope-hosted Qwen models or any OpenAI-compatible API (vLLM, Ollama). Supports parallel function calls, multi-step tool calls, and the `reasoning_content` field for thinking models.
- **Tool layer** — `BaseTool` with a `@register_tool` decorator for defining custom tools. Built-in tools include `code_interpreter` (Docker-sandboxed Python execution) and web search.
- **Agent layer** — `Agent` base class with ready-made implementations like `Assistant`, `FnCallAgent`, and `ReActChat`. A `WebUI` helper wraps any agent in a Gradio interface with a single line of code.

## Key Capabilities

- **Function / tool calling** — parallel and multi-turn function calls with a configurable template (default: Nous-style, recommended for Qwen3).
- **MCP support** — agents can connect to Model Context Protocol servers (memory, filesystem, SQLite, etc.) via a JSON config block.
- **RAG over long documents** — a fast RAG solution and a parallel agent approach that the project claims outperforms native long-context models on two benchmarks while handling 1M-token contexts.
- **Code Interpreter** — Docker-based sandboxed Python execution; requires Docker to be installed locally.
- **BrowserQwen** — a Chrome extension application built on the framework for browser-based assistance.
- **Gradio GUI** — rapid demo deployment via `WebUI(agent).run()`.

## Installation and Setup Path

Install from PyPI with optional extras:

```
pip install -U "qwen-agent[gui,rag,code_interpreter,mcp]"
```

The framework requires either a DashScope API key (set as `DASHSCOPE_API_KEY`) for cloud-hosted Qwen models, or a locally deployed OpenAI-compatible endpoint via vLLM or Ollama. The GUI requires Python 3.10 or higher (upgraded to Gradio 5 as of December 2024).

## Update: v0.0.26 and Qwen3.5 Support

The latest release is **v0.0.26**, published May 29, 2025. The most recent notable update (February 16, 2026) open-sourced Qwen3.5 with a corresponding agent demo. Earlier 2025 milestones include Qwen3-Coder tool-call support with native vLLM API tool parsing (July 2025), Qwen3-VL tool-call support with image zoom and search tools (September 2025), and MCP cookbooks (May 2025). An agent evaluation benchmark called DeepPlanning and full documentation were published in January 2026. The repository shows 16,500+ stars and active issue tracking as of mid-2026.

## Features
- Function calling (parallel and multi-turn)
- MCP (Model Context Protocol) support
- RAG over long documents (up to 1M tokens)
- Docker-sandboxed Code Interpreter
- Gradio-based WebUI for rapid demo deployment
- Custom tool registration via @register_tool decorator
- Support for DashScope, vLLM, and Ollama backends
- BrowserQwen Chrome extension application
- ReAct and FnCall agent implementations
- Qwen3, Qwen3-Coder, Qwen3-VL, QwQ-32B support
- Streaming output
- Multi-turn chat history management
- PDF and file reading support
- DeepPlanning benchmark evaluation

## Integrations
DashScope (Alibaba Cloud), vLLM, Ollama, Hugging Face, ModelScope, Docker, Gradio, MCP servers (memory, filesystem, SQLite), OpenAI-compatible APIs, Chrome browser extension

## Platforms
WINDOWS, MACOS, WEB, API, BROWSER_EXTENSION, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
v0.0.26

## Links
- Website: https://pypi.org/project/qwen-agent/
- Documentation: https://qwenlm.github.io/Qwen-Agent/en/guide/
- Repository: https://github.com/QwenLM/Qwen-Agent
- EveryDev.ai: https://www.everydev.ai/tools/qwen-agent
