[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2755":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},2755,"Qwen-Agent","QwenLM\u002FQwen-Agent","QwenLM","Agent framework and applications built upon Qwen>=3.0, featuring Function Calling, MCP, Code Interpreter, RAG, Chrome extension, etc.","https:\u002F\u002Fpypi.org\u002Fproject\u002Fqwen-agent\u002F",null,"Python",16510,1631,104,414,0,27,38,199,81,44.64,"Apache License 2.0",false,"main",true,[],"2026-06-12 02:00:43","\u003C!---\nCopyright 2023 The Qwen team, Alibaba Group. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\n[中文](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen-Agent\u002Fblob\u002Fmain\u002FREADME_CN.md) ｜ English\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Fqianwen-res.oss-accelerate-overseas.aliyuncs.com\u002Flogo_qwen_agent.png\" width=\"400\"\u002F>\n\u003Cp>\n\u003Cbr>\n\n\u003Cp align=\"center\">\n          💜 \u003Ca href=\"https:\u002F\u002Fchat.qwen.ai\u002F\">\u003Cb>Qwen Chat\u003C\u002Fb>\u003C\u002Fa>&nbsp&nbsp | &nbsp&nbsp🤗 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002FQwen\">Hugging Face\u003C\u002Fa>&nbsp&nbsp | &nbsp&nbsp🤖 \u003Ca href=\"https:\u002F\u002Fmodelscope.cn\u002Forganization\u002Fqwen\">ModelScope\u003C\u002Fa>&nbsp&nbsp | &nbsp&nbsp 📑 \u003Ca href=\"https:\u002F\u002Fqwenlm.github.io\u002F\">Blog\u003C\u002Fa> &nbsp&nbsp ｜ &nbsp&nbsp📖 \u003Ca href=\"https:\u002F\u002Fqwenlm.github.io\u002FQwen-Agent\u002Fen\u002F\">Documentation\u003C\u002Fa>\n\n\u003Cbr>\n📊 \u003Ca href=\"https:\u002F\u002Fqwenlm.github.io\u002FQwen-Agent\u002Fen\u002Fbenchmarks\u002Fdeepplanning\u002F\">Benchmark\u003C\u002Fa>&nbsp&nbsp | &nbsp&nbsp💬 \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen\u002Fblob\u002Fmain\u002Fassets\u002Fwechat.png\">WeChat (微信)\u003C\u002Fa>&nbsp&nbsp | &nbsp&nbsp🫨 \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FCV4E9rpNSD\">Discord\u003C\u002Fa>&nbsp&nbsp\n\u003C\u002Fp>\n\n\nQwen-Agent is a framework for developing LLM applications based on the instruction following, tool usage, planning, and\nmemory capabilities of Qwen.\nIt also comes with example applications such as Browser Assistant, Code Interpreter, and Custom Assistant.\nNow Qwen-Agent plays as the backend of [Qwen Chat](https:\u002F\u002Fchat.qwen.ai\u002F).\n\n# News\n* 🔥🔥🔥Feb 16, 2026: Open-sourced Qwen3.5. For usage examples, refer to [Qwen3.5 Agent Demo](.\u002Fexamples\u002Fassistant_qwen3.5.py).\n* Jan 27, 2026: Open-sourced agent evaluation benchmark [DeepPlanning](https:\u002F\u002Fqwenlm.github.io\u002FQwen-Agent\u002Fen\u002Fbenchmarks\u002Fdeepplanning\u002F) and added Qwen-Agent [documentation](https:\u002F\u002Fqwenlm.github.io\u002FQwen-Agent\u002Fen\u002Fguide\u002F).\n* Sep 23, 2025: Added [Qwen3-VL Tool-call Demo](.\u002Fexamples\u002Fcookbook_think_with_images.ipynb), supporting tools such as zoom in, image search, and web search.\n* Jul 23, 2025: Add [Qwen3-Coder Tool-call Demo](.\u002Fexamples\u002Fassistant_qwen3_coder.py); Added native API tool call interface support, such as using vLLM's built-in tool call parsing.\n* May 1, 2025: Add [Qwen3 Tool-call Demo](.\u002Fexamples\u002Fassistant_qwen3.py), and add [MCP Cookbooks](.\u002Fexamples\u002F).\n* Mar 18, 2025: Support for the `reasoning_content` field; adjust the default [Function Call template](.\u002Fqwen_agent\u002Fllm\u002Ffncall_prompts\u002Fnous_fncall_prompt.py), which is applicable to the Qwen2.5 series general models and QwQ-32B. If you need to use the old version of the template, please refer to the [example](.\u002Fexamples\u002Ffunction_calling.py) for passing parameters.\n* Mar 7, 2025: Added [QwQ-32B Tool-call Demo](.\u002Fexamples\u002Fassistant_qwq.py). It supports parallel, multi-step, and multi-turn tool calls.\n* Dec 3, 2024: Upgrade GUI to Gradio 5 based. Note: GUI requires Python 3.10 or higher.\n* Sep 18, 2024: Added [Qwen2.5-Math Demo](.\u002Fexamples\u002Ftir_math.py) to showcase the Tool-Integrated Reasoning capabilities of Qwen2.5-Math. Note: The python executor is not sandboxed and is intended for local testing only, not for production use.\n\n# Getting Started\n\n## Installation\n\n- Install the stable version from PyPI:\n```bash\npip install -U \"qwen-agent[gui,rag,code_interpreter,mcp]\"\n# Or use `pip install -U qwen-agent` for the minimal requirements.\n# The optional requirements, specified in double brackets, are:\n#   [gui] for Gradio-based GUI support;\n#   [rag] for RAG support;\n#   [code_interpreter] for Code Interpreter support;\n#   [mcp] for MCP support.\n```\n\n- Alternatively, you can install the latest development version from the source:\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen-Agent.git\ncd Qwen-Agent\npip install -e .\u002F\"[gui,rag,code_interpreter,mcp]\"\n# Or `pip install -e .\u002F` for minimal requirements.\n```\n\n## Preparation: Model Service\n\nYou can either use the model service provided by Alibaba\nCloud's [DashScope](https:\u002F\u002Fhelp.aliyun.com\u002Fzh\u002Fdashscope\u002Fdeveloper-reference\u002Fquick-start), or deploy and use your own\nmodel service using the open-source Qwen models.\n\n- If you choose to use the model service offered by DashScope, please ensure that you set the environment\nvariable `DASHSCOPE_API_KEY` to your unique DashScope API key.\n\n- Alternatively, if you prefer to deploy and use your own model service, please follow the instructions provided in the README of Qwen2 for deploying an OpenAI-compatible API service.\nSpecifically, consult the [vLLM](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen2?tab=readme-ov-file#vllm) section for high-throughput GPU deployment or the [Ollama](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen2?tab=readme-ov-file#ollama) section for local CPU (+GPU) deployment.\nFor the QwQ and Qwen3 model, it is recommended to **do not** add the `--enable-auto-tool-choice` and `--tool-call-parser hermes` parameters, as Qwen-Agent will parse the tool outputs from vLLM on its own.\nFor Qwen3-Coder, it is recommended to enable both of the above parameters, use vLLM's built-in tool parsing, and combine with the `use_raw_api` parameter [usage](#how-to-pass-llm-parameters-to-the-agent).\n\n## Developing Your Own Agent\n\nQwen-Agent offers atomic components, such as LLMs (which inherit from `class BaseChatModel` and come with [function calling](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen-Agent\u002Fblob\u002Fmain\u002Fexamples\u002Ffunction_calling.py)) and Tools (which inherit\nfrom `class BaseTool`), along with high-level components like Agents (derived from `class Agent`).\n\nThe following example illustrates the process of creating an agent capable of reading PDF files and utilizing tools, as\nwell as incorporating a custom tool:\n\n```py\nimport pprint\nimport urllib.parse\nimport json5\nfrom qwen_agent.agents import Assistant\nfrom qwen_agent.tools.base import BaseTool, register_tool\nfrom qwen_agent.utils.output_beautify import typewriter_print\n\n\n# Step 1 (Optional): Add a custom tool named `my_image_gen`.\n@register_tool('my_image_gen')\nclass MyImageGen(BaseTool):\n    # The `description` tells the agent the functionality of this tool.\n    description = 'AI painting (image generation) service, input text description, and return the image URL drawn based on text information.'\n    # The `parameters` tell the agent what input parameters the tool has.\n    parameters = [{\n        'name': 'prompt',\n        'type': 'string',\n        'description': 'Detailed description of the desired image content, in English',\n        'required': True\n    }]\n\n    def call(self, params: str, **kwargs) -> str:\n        # `params` are the arguments generated by the LLM agent.\n        prompt = json5.loads(params)['prompt']\n        prompt = urllib.parse.quote(prompt)\n        return json5.dumps(\n            {'image_url': f'https:\u002F\u002Fimage.pollinations.ai\u002Fprompt\u002F{prompt}'},\n            ensure_ascii=False)\n\n\n# Step 2: Configure the LLM you are using.\nllm_cfg = {\n    # Use the model service provided by DashScope:\n    'model': 'qwen-max-latest',\n    'model_type': 'qwen_dashscope',\n    # 'api_key': 'YOUR_DASHSCOPE_API_KEY',\n    # It will use the `DASHSCOPE_API_KEY' environment variable if 'api_key' is not set here.\n\n    # Use a model service compatible with the OpenAI API, such as vLLM or Ollama:\n    # 'model': 'Qwen2.5-7B-Instruct',\n    # 'model_server': 'http:\u002F\u002Flocalhost:8000\u002Fv1',  # base_url, also known as api_base\n    # 'api_key': 'EMPTY',\n\n    # (Optional) LLM hyperparameters for generation:\n    'generate_cfg': {\n        'top_p': 0.8\n    }\n}\n\n# Step 3: Create an agent. Here we use the `Assistant` agent as an example, which is capable of using tools and reading files.\nsystem_instruction = '''After receiving the user's request, you should:\n- first draw an image and obtain the image url,\n- then run code `request.get(image_url)` to download the image,\n- and finally select an image operation from the given document to process the image.\nPlease show the image using `plt.show()`.'''\ntools = ['my_image_gen', 'code_interpreter']  # `code_interpreter` is a built-in tool for executing code. For configuration details, please refer to the FAQ.\nfiles = ['.\u002Fexamples\u002Fresource\u002Fdoc.pdf']  # Give the bot a PDF file to read.\nbot = Assistant(llm=llm_cfg,\n                system_message=system_instruction,\n                function_list=tools,\n                files=files)\n\n# Step 4: Run the agent as a chatbot.\nmessages = []  # This stores the chat history.\nwhile True:\n    # For example, enter the query \"draw a dog and rotate it 90 degrees\".\n    query = input('\\nuser query: ')\n    # Append the user query to the chat history.\n    messages.append({'role': 'user', 'content': query})\n    response = []\n    response_plain_text = ''\n    print('bot response:')\n    for response in bot.run(messages=messages):\n        # Streaming output.\n        response_plain_text = typewriter_print(response, response_plain_text)\n    # Append the bot responses to the chat history.\n    messages.extend(response)\n```\n\nIn addition to using built-in agent implementations such as `class Assistant`, you can also develop your own agent implemetation by inheriting from `class Agent`.\n\nThe framework also provides a convenient GUI interface, supporting the rapid deployment of Gradio Demos for Agents.\nFor example, in the case above, you can quickly launch a Gradio Demo using the following code:\n\n```py\nfrom qwen_agent.gui import WebUI\nWebUI(bot).run()  # bot is the agent defined in the above code, we do not repeat the definition here for saving space.\n```\nNow you can chat with the Agent in the web UI. Please refer to the [examples](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen-Agent\u002Fblob\u002Fmain\u002Fexamples) directory for more usage examples.\n\n# FAQ\n## How to Use the Code Interpreter Tool?\n\nWe implement a code interpreter tool based on local Docker containers. You can enable the built-in `code interpreter` tool for your agent, allowing it to autonomously write code according to specific scenarios, execute it securely within an isolated sandbox environment, and return the execution results.\n\n⚠️ **Note**: Before using this tool, please ensure that Docker is installed and running on your local operating system. The time required to build the container image for the first time depends on your network conditions. For Docker installation and setup instructions, please refer to the [official documentation](https:\u002F\u002Fdocs.docker.com\u002Fdesktop\u002F).\n\n\n## How to Use MCP?\n\nYou can select the required tools on the open-source [MCP server website](https:\u002F\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fservers) and configure the relevant environment.\n\nExample of MCP invocation format:\n```\n{\n    \"mcpServers\": {\n        \"memory\": {\n            \"command\": \"npx\",\n            \"args\": [\"-y\", \"@modelcontextprotocol\u002Fserver-memory\"]\n        },\n        \"filesystem\": {\n            \"command\": \"npx\",\n            \"args\": [\"-y\", \"@modelcontextprotocol\u002Fserver-filesystem\", \"\u002Fpath\u002Fto\u002Fallowed\u002Ffiles\"]\n        },\n        \"sqlite\" : {\n            \"command\": \"uvx\",\n            \"args\": [\n                \"mcp-server-sqlite\",\n                \"--db-path\",\n                \"test.db\"\n            ]\n        }\n    }\n}\n```\nFor more details, you can refer to the [MCP usage example](.\u002Fexamples\u002Fassistant_mcp_sqlite_bot.py)\n\nThe dependencies required to run this example are as follows:\n```\n# Node.js (Download and install the latest version from the Node.js official website)\n# uv 0.4.18 or higher (Check with uv --version)\n# Git (Check with git --version)\n# SQLite (Check with sqlite3 --version)\n\n# For macOS users, you can install these components using Homebrew:\nbrew install uv git sqlite3\n\n# For Windows users, you can install these components using winget:\nwinget install --id=astral-sh.uv -e\nwinget install git.git sqlite.sqlite\n```\n## Do you have function calling (aka tool calling)?\n\nYes. The LLM classes provide [function calling](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen-Agent\u002Fblob\u002Fmain\u002Fexamples\u002Ffunction_calling.py). Additionally, some Agent classes also are built upon the function calling capability, e.g., FnCallAgent and ReActChat.\n\nThe current default tool calling template natively supports **Parallel Function Calls**.\n\n## How to pass LLM parameters to the Agent?\n```py\nllm_cfg = {\n    # The model name being used:\n    'model': 'qwen3-32b',\n    # The model service being used:\n    'model_type': 'qwen_dashscope',\n    # If 'api_key' is not set here, it will default to reading the `DASHSCOPE_API_KEY` environment variable:\n    'api_key': 'YOUR_DASHSCOPE_API_KEY',\n\n    # Using an OpenAI API compatible model service, such as vLLM or Ollama:\n    # 'model': 'qwen3-32b',\n    # 'model_server': 'http:\u002F\u002Flocalhost:8000\u002Fv1',  # base_url, also known as api_base\n    # 'api_key': 'EMPTY',\n\n    # (Optional) LLM hyperparameters:\n    'generate_cfg': {\n        # This parameter will affect the tool-call parsing logic. Default is False:\n          # Set to True: when content is `\u003Cthink>this is the thought\u003C\u002Fthink>this is the answer`\n          # Set to False: when response consists of reasoning_content and content\n        # 'thought_in_content': True,\n\n        # tool-call template: default is nous (recommended for qwen3):\n        # 'fncall_prompt_type': 'nous'\n\n        # Maximum input length, messages will be truncated if they exceed this length, please adjust according to model API:\n        # 'max_input_tokens': 58000\n\n        # Parameters that will be passed directly to the model API, such as top_p, enable_thinking, etc., according to the API specifications:\n        # 'top_p': 0.8\n\n        # Using the API's native tool call interface\n        # 'use_raw_api': True,\n    }\n}\n```\n\n## How to do question-answering over super-long documents involving 1M tokens?\n\nWe have released [a fast RAG solution](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen-Agent\u002Fblob\u002Fmain\u002Fexamples\u002Fassistant_rag.py), as well as [an expensive but competitive agent](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen-Agent\u002Fblob\u002Fmain\u002Fexamples\u002Fparallel_doc_qa.py), for doing question-answering over super-long documents. They have managed to outperform native long-context models on two challenging benchmarks while being more efficient, and perform perfectly in the single-needle \"needle-in-the-haystack\" pressure test involving 1M-token contexts. See the [blog](https:\u002F\u002Fqwenlm.github.io\u002Fblog\u002Fqwen-agent-2405\u002F) for technical details.\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Fqianwen-res.oss-cn-beijing.aliyuncs.com\u002Fassets\u002Fqwen_agent\u002Fqwen-agent-2405-blog-long-context-results.png\" width=\"400\"\u002F>\n\u003Cp>\n\n# Application: BrowserQwen\n\nBrowserQwen is a browser assistant built upon Qwen-Agent. Please refer to its [documentation](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen-Agent\u002Fblob\u002Fmain\u002Fbrowser_qwen.md) for details.\n\n# Disclaimer\n\nThe Docker container-based code interpreter mounts only the specified working directory and implements basic sandbox isolation, but it should still be used with caution in production environments.\n","Qwen-Agent 是一个基于 Qwen 语言模型构建的应用框架，支持功能调用、多轮对话、代码解释器、检索增强生成等功能。其核心特性包括强大的指令执行能力、工具使用、计划制定及记忆功能，并提供了浏览器助手、代码解释器和自定义助手等示例应用。该框架采用 Python 编写，适用于需要集成复杂自然语言处理能力的场景，如自动化办公、智能客服系统开发以及个人效率提升工具等。",2,"2026-06-11 02:51:07","top_language"]