diff --git a/LICENSE b/LICENSE index 310ac44a..4947287f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,177 @@ -MIT License - -Copyright (c) 2025 MiroMind - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/README.md b/README.md index 4f2494c7..741e604b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@
- MiroThinker + MiroThinker

-[![DEMO](https://img.shields.io/badge/Demo-FFB300?style=for-the-badge&logo=airplayvideo&logoColor=white)](https://dr.miromind.ai/) [![Blog](https://img.shields.io/badge/Blog-4285F4?style=for-the-badge&logo=google-chrome&logoColor=white)](https://miromind.ai/#blog) [![DATA](https://img.shields.io/badge/Data-0040A1?style=for-the-badge&logo=huggingface&logoColor=ffffff&labelColor)](https://huggingface.co/datasets/miromind-ai/MiroVerse-v0.1) @@ -18,17 +17,12 @@
-### πŸš€ [Try our Demo!](https://dr.miromind.ai/) +### πŸš€ [Try MiroThinker!](https://dr.miromind.ai/)
-> **MiroThinker** is an open source deep research agent optimized for research and prediction. It achieves a 80.8% Avg@8 score on the challenging GAIA benchmark. +**MiroThinker**: A deep research agent optimized for research and prediction. It achieves a 88.2 on the challenging BrowseComp benchmark. See [Quick Start](#-quick-start). -The project currently comprises four key components: - -- πŸ’‘ **MiroThinker**: An open source deep research agent optimized for research and prediction. It achieves a 80.8% Avg@8 score on the challenging GAIA benchmark. See [Quick Start](#-quick-start). -- πŸ€– **MiroFlow**: An agent framework that enables tool-use agent tasks, featuring a reproducible GAIA score of 82.4%. See [MiroFlow](https://github.com/MiroMindAI/MiroFlow) for details. -- πŸ“š **MiroVerse**: A premium open-source training dataset with 147k samples supporting research agent training. See [MiroVerse](https://huggingface.co/datasets/miromind-ai/MiroVerse-v0.1) on HuggingFace. ## πŸ“‹ Table of Contents @@ -44,14 +38,16 @@ The project currently comprises four key components: - πŸ™ [Acknowledgments](#-acknowledgments) ## πŸ“° News & Updates -- **\[2026-01-23\]**Β πŸŽ‰ We have brought two important updates to [MiroThinker online demo](http://dr.miromind.ai): (a) Core Research Report Generation: Deep Research online reports now support generation, preview, and sharing. (b) Extended Document Upload Types: Now supports the upload of various file formats, such as `.pdf`, `.doc`, `.ppt`, `.xls`, `.jpg`. Welcome to try it out!Β MiroThinker will continue to be maintained and iteratively upgraded, with the goal of becoming the best Research Agent you'll ever use! -- **\[2026-01-05\]** πŸŽ‰πŸŽ‰ We release [MiroThinker-v1.5](https://huggingface.co/collections/miromind-ai/mirothinker-v15), a series of open source deep research agents optimized for financial prediction. [MiroThinker-v1.5-30B](https://huggingface.co/miromind-ai/MiroThinker-v1.5-30B) surpasses Kimi-K2-Thinking on BrowseComp-ZH at much lower cost, using only 1/30 of the parameters. [MiroThinker-v1.5-235B](https://huggingface.co/miromind-ai/MiroThinker-v1.5-235B) scores 39.2% on HLE-Text, 69.8% on BrowseComp, 71.5% on BrowseComp-ZH, and 80.8% on GAIA-Val-165, setting a new state-of-the-art among search agents. -- **\[2025-11-13\]** πŸŽ‰ [MiroThinker-v1.0](https://huggingface.co/collections/miromind-ai/mirothinker-v10) is now released! Introducing **interactive scaling** as a third dimension of performance improvement, MiroThinker v1.0 supports 256K context window and up to 600 tool calls per task. Available in 8B, 30B, and 72B parameter scales, achieving 37.7%, 47.1%, 55.6%, and 81.9% on HLE-Text, BrowseComp, BrowseComp-ZH, and GAIA-Text-103, respectively. See [Technical Report](https://arxiv.org/abs/2511.11793) for more details. -- **\[2025-09-11\]** MiroThinker-72B-Preview ranked 4th in this week's FutureX benchmark. See [FutureX](https://futurex-ai.github.io/). +- **[2026-03-11]** πŸŽ‰πŸŽ‰πŸŽ‰ Introducing [MiroThinker-1.7](https://huggingface.co/collections/miromind-ai/mirothinker-17), including [MiroThinker-1.7-mini](https://huggingface.co/miromind-ai/MiroThinker-1.7-mini) and [MiroThinker-1.7](https://huggingface.co/miromind-ai/MiroThinker-1.7). MiroThinker-1.7-mini achieves 72.3 on BrowseComp-ZH, setting a new SOTA among open-source models while using only 30B parameters. Our proprietary agent MiroThinker-H1 achieves leading performance on BrowseComp and BrowseComp-ZH among open-source and commercial models. +- **\[2026-01-23\]**Β πŸŽ‰ We have brought two important updates to [MiroThinker online](http://dr.miromind.ai): (a) Core Research Report Generation: Deep Research online reports now support generation, preview, and sharing. (b) Extended Document Upload Types: Now supports the upload of various file formats, such as `.pdf`, `.doc`, `.ppt`, `.xls`, `.jpg`. Welcome to try it out!Β MiroThinker will continue to be maintained and iteratively upgraded, with the goal of becoming the best Research Agent you'll ever use! +- **\[2026-01-05\]** πŸŽ‰πŸŽ‰ We release [MiroThinker-v1.5](https://huggingface.co/collections/miromind-ai/mirothinker-v15), a series of open-source deep research agents optimized for financial prediction. [MiroThinker-v1.5-30B](https://huggingface.co/miromind-ai/MiroThinker-v1.5-30B) surpasses Kimi-K2-Thinking on BrowseComp-ZH at much lower cost, using only 1/30 of the parameters. [MiroThinker-v1.5-235B](https://huggingface.co/miromind-ai/MiroThinker-v1.5-235B) scores 39.2% on HLE-Text, 69.8% on BrowseComp, 71.5% on BrowseComp-ZH, and 80.8% on GAIA-Val-165, setting a new state-of-the-art among search agents. +
πŸ“œ Click to expand older updates +- **\[2025-11-13\]** πŸŽ‰ [MiroThinker-v1.0](https://huggingface.co/collections/miromind-ai/mirothinker-v10) is now released! Introducing **interactive scaling** as a third dimension of performance improvement, MiroThinker v1.0 supports 256K context window and up to 600 tool calls per task. Available in 8B, 30B, and 72B parameter scales, achieving 37.7%, 47.1%, 55.6%, and 81.9% on HLE-Text, BrowseComp, BrowseComp-ZH, and GAIA-Text-103, respectively. See [Technical Report](https://arxiv.org/abs/2511.11793) for more details. +- **\[2025-09-11\]** MiroThinker-72B-Preview ranked 4th in this week's FutureX benchmark. See [FutureX](https://futurex-ai.github.io/). - **\[2025-09-08\]** [MiroThinker-v0.2](https://huggingface.co/collections/miromind-ai/mirothinker-v02) is now released, achieving open-source SOTA performance across multiple benchmarks, including HLE (17.8%), HLE-Text-Only (19.1%), BrowseComp-EN (17.2%), BrowseComp-ZH (29.4%), XBench-DeepSearch (56.0%), and Frames (74.8%). - **\[2025-09-07\]** We supported more benchmarks, including [BrowseComp-ZH](https://arxiv.org/abs/2504.19314), [XBench-DeepSearch](https://xbench.org/agi/aisearch), and [FutureX](https://futurex-ai.github.io/). We plan to add more benchmarks in the future. - **\[2025-08-22\]** Introducing streamlined deployment options for MiroThinker with optimized resource usage and faster startup times. Experience the interactive demo: [πŸš€ Try Gradio Demo](apps/gradio-demo) @@ -61,8 +57,38 @@ The project currently comprises four key components: ## πŸ“ Introduction +### MiroThinker-1.7 +Our new MiroThinker family represents a significant leap in building reliable agents for long-chain tasks. Engineered with enhanced post-training pipeline, our MiroThinker-1.7 family achieve SOTA performance in deep research tasks among open-source models. + + +**Key Features** + +- πŸš€ MiroThinker-1.7 supports a 256K context window, long-horizon reasoning, and deep multi-step analysis. +- πŸ”§ Handles up to 300 tool interactions per task, now with more accurate stepwise reasoning and decision-making. +- πŸ“¦ Released in 30B and 235B parameter scales, accompanied by a comprehensive suite of tools and workflows to flexibly support diverse research settings and compute budgets. +- Our proprietary agent, MiroThinker-H1 provides promising evidence for long-chain verifiable reasoning β€” reasoning processes that are step-verifiable and globally verifiable, improving the performance of complex agentic workflows. + +
+ +| Agent Name | Base Agent | Max Context | Max Tool Calls | HF Link | +|:---------------------:|:-----------------------------:|:-----------:|:--------------:|:------------------------------------------------------------------:| +| MiroThinker-1.7-mini | Qwen3-30B-A3B-Thinking-2507 | 256K | 300 | [πŸ€— link](https://huggingface.co/miromind-ai/MiroThinker-1.7-mini) | +| MiroThinker-1.7 | Qwen3-235B-A22B-Thinking-2507 | 256K | 300 | [πŸ€— link](https://huggingface.co/miromind-ai/MiroThinker-1.7) | + +
+ +MiroThinker-1.7 demonstrates strong general-research performance across a broad range of benchmarks, achievingΒ 74.0%,Β 75.3%, 82.7% andΒ 42.9%Β on BrowseComp, BrowseComp-ZH, GAIA-Val-165 and HLE-Text, respectively. MiroThinker-1.7 achieves SOTA performance on BrowseComp-ZH. + +![image](/assets/1.7_main_results.png) + + + + ### MiroThinker-v1.5 +
+ πŸ“¦ Click to expand MiroThinker-v1.5 details + MiroThinker v1.5 is the world-leading open-source search agent that advances tool-augmented reasoning through **interactive scaling** β€” training the agent to handle deeper and more frequent agent-environment interactions as a third dimension of performance improvement, beyond model size and context length. ![image](https://huggingface.co/datasets/miromind-ai/MiroFlow-Benchmarks/resolve/main/assets/mirothinker_v1.5_framework.png) @@ -86,6 +112,8 @@ MiroThinker v1.5 demonstrates strong general-research performance across a broad ![image](https://huggingface.co/datasets/miromind-ai/MiroFlow-Benchmarks/resolve/main/assets/mirothinker_v1.5_browsecomp.png) +
+ ### MiroThinker-v1.0
@@ -209,8 +237,23 @@ We have released the **MiroThinker v0.1** series, including both SFT and DPO var ## πŸ“ˆ Performance on Benchmarks +### MiroThinker-1.7 + +> To prevent potential information leakage (e.g., retrieving benchmark answers from HuggingFace), we blocked access to certain websites during evaluation. + +
+ MiroThinker +
+ +
+ + + ### MiroThinker-v1.5 +
+ πŸ“¦ Click to expand MiroThinker-v1.5 details + > To prevent potential information leakage (e.g., searching benchmark answers from HuggingFace), access to HuggingFace has been explicitly disabled in these tools. > We further perform canary string testing on the tool outputs of all trajectories and disregard any trajectory found to be contaminated, treating it as an incorrect answer. @@ -219,6 +262,8 @@ We have released the **MiroThinker v0.1** series, including both SFT and DPO var MiroThinker
+ + ### MiroThinker-v1.0
@@ -355,7 +400,7 @@ cp .env.example .env ### Tool Configuration -#### Minimal Configuration for MiroThinker v1.5 and v1.0 +#### Minimal Configuration for MiroThinker-1.7. | Server | Description | Tools Provided | Required Environment Variables | |:-------|:------------|:---------------|:-------------------------------| @@ -398,7 +443,7 @@ OPENAI_BASE_URL="https://api.openai.com/v1" # Optional, defaults to OpenAI's AP
πŸ”§ Click to expand additional available tools -The following optional tools are available but were not used in MiroThinker v1.5 and v1.0 evaluation: +The following optional tools are available but were not used in MiroThinker v1.0-1.7 evaluation: | Server Name | Type | Description | |:---------------------|:-------------|:--------------------------------------------| @@ -422,21 +467,24 @@ See the [MiroFlow Tools README](libs/miroflow-tools/README.md) for complete docu The `apps/miroflow-agent/conf/agent/` directory contains several pre-configured agent settings. Each configuration uses different tools and requires corresponding environment variables in your `.env` file. -> **πŸ’‘ Recommended**: For MiroThinker v1.5, use `mirothinker_v1.5_keep5_max200` (with context management, recommended for most tasks) or `mirothinker_v1.5_keep5_max400` (only used for BrowseComp and BrowseComp-ZH). For v1.0, use `mirothinker_v1.0_keep5` (with context management). All use minimal configuration with only 3 MCP servers. +> **πŸ’‘ Recommended**: For MiroThinker-1.7, use `mirothinker_1.7_keep5_max200` (with context management, recommended for most tasks) or `mirothinker_v1.7_keep5_max300` (only used for BrowseComp and BrowseComp-ZH). | Configuration | Description | Max Turns | Context Retention | Required Environment Variables | Recommended For | |:---------------------------------------|:------------|:----------|:------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------| -| **`mirothinker_v1.5_keep5_max200`** ⭐ | Single-agent with context management | 200 | Keep 5 most recent | `SERPER_API_KEY`, `SERPER_BASE_URL`, `JINA_API_KEY`, `JINA_BASE_URL`, `E2B_API_KEY`, `SUMMARY_LLM_BASE_URL`, `SUMMARY_LLM_MODEL_NAME`, `SUMMARY_LLM_API_KEY` | **v1.5 (recommended for most tasks)** | -| **`mirothinker_v1.5_keep5_max400`** ⭐ | Single-agent with context management | 400 | Keep 5 most recent | Same as above | **v1.5 (for BrowseComp & BrowseComp-ZH)** | -| **`mirothinker_v1.5`** | Single-agent for MiroThinker v1.5 | 600 | Keep all results | Same as above | **v1.5** | -| **`mirothinker_v1.0_keep5`** | Single-agent with context management | 600 | Keep 5 most recent | Same as above | **v1.0** | -| **`mirothinker_v1.0`** | Single-agent for MiroThinker v1.0 | 600 | Keep all results | Same as above | **v1.0** | +| **`mirothinker_1.7_keep5_max200`** ⭐ | Single-agent with context management | 200 | Keep 5 most recent | `SERPER_API_KEY`, `SERPER_BASE_URL`, `JINA_API_KEY`, `JINA_BASE_URL`, `E2B_API_KEY`, `SUMMARY_LLM_BASE_URL`, `SUMMARY_LLM_MODEL_NAME`, `SUMMARY_LLM_API_KEY` | **1.7 (recommended for most tasks)** | +| **`mirothinker_1.7_keep5_max300`** ⭐ | Single-agent with context management | 300 | Keep 5 most recent | Same as above | **1.7 (for BrowseComp & BrowseComp-ZH)** | +
πŸ“¦ Click to expand legacy configurations (v0.1/v0.2) | Configuration | Description | Max Turns | Context Retention | Required Environment Variables | Recommended For | |:-------------------------|:------------|:----------|:------------------|:-------------------------------|:----------------| +| **`mirothinker_v1.5_keep5_max200`** | Single-agent with context management | 200 | Keep 5 most recent | `SERPER_API_KEY`, `SERPER_BASE_URL`, `JINA_API_KEY`, `JINA_BASE_URL`, `E2B_API_KEY`, `SUMMARY_LLM_BASE_URL`, `SUMMARY_LLM_MODEL_NAME`, `SUMMARY_LLM_API_KEY` | **v1.5 (recommended for most tasks)** | +| **`mirothinker_v1.5_keep5_max400`** | Single-agent with context management | 400 | Keep 5 most recent | Same as above | **v1.5 (for BrowseComp & BrowseComp-ZH)** | +| **`mirothinker_v1.5`** | Single-agent for MiroThinker v1.5 | 600 | Keep all results | Same as above | **v1.5** | +| **`mirothinker_v1.0_keep5`** | Single-agent with context management | 600 | Keep 5 most recent | Same as above | **v1.0** | +| **`mirothinker_v1.0`** | Single-agent for MiroThinker v1.0 | 600 | Keep all results | Same as above | **v1.0** | | **`multi_agent`** | Multi-agent with commercial tools (v0.1/v0.2) | 50 | Keep all results | `E2B_API_KEY`, `ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL`, `OPENAI_API_KEY`, `OPENAI_BASE_URL`, `SERPER_API_KEY`, `SERPER_BASE_URL`, `JINA_API_KEY`, `JINA_BASE_URL` | v0.1/v0.2 | | **`multi_agent_os`** | Multi-agent with open-source tools (v0.1/v0.2) | 50 | Keep all results | `E2B_API_KEY`, `VISION_API_KEY`, `VISION_BASE_URL`, `VISION_MODEL_NAME`, `WHISPER_API_KEY`, `WHISPER_BASE_URL`, `WHISPER_MODEL_NAME`, `REASONING_API_KEY`, `REASONING_BASE_URL`, `REASONING_MODEL_NAME`, `SERPER_API_KEY`, `SERPER_BASE_URL`, `JINA_API_KEY`, `JINA_BASE_URL` | v0.1/v0.2 | @@ -468,7 +516,7 @@ main_agent: - tool-transcribe # Audio processing (optional) - tool-reasoning # Reasoning engine (optional) - tool-reading # Document reading (optional) - max_turns: 400 # Maximum number of turns + max_turns: 300 # Maximum number of turns sub_agents: agent-browsing: # Optional sub-agent @@ -558,17 +606,15 @@ SUMMARY_LLM_API_KEY=your_summary_llm_api_key #### Option 1 (Recommended): Serve with SGLang or vLLM -Use SGLang to serve MiroThinker agents at port 61002: +Use SGLang to serve MiroThinker models at port 61002: ```bash NUM_GPUS=4 PORT=61002 -# Downloading agent from HF (v1.5 recommended) -AGENT_PATH=miromind-ai/MiroThinker-v1.5-30B +# Downloading agent from HF +AGENT_PATH=miromind-ai/MiroThinker-1.7-mini -# Or use v1.0 -# AGENT_PATH=miromind-ai/MiroThinker-v1.0-30B python3 -m sglang.launch_server \ --model-path $AGENT_PATH \ @@ -595,7 +641,7 @@ After setting up the environment and starting your server, run `main.py` to test cd apps/miroflow-agent # Using MiroThinker agents (requires your own server) -uv run python main.py llm=qwen-3 agent=mirothinker_v1.5_keep5_max200 llm.base_url=http://localhost:61002/v1 +uv run python main.py llm=qwen-3 agent=mirothinker_1.7_keep5_max200 llm.base_url=http://localhost:61002/v1 # Or using Claude (requires ANTHROPIC_API_KEY in .env) uv run python main.py llm=claude-3-7 agent=single_agent_keep5 @@ -630,7 +676,7 @@ rm data_20251115_password_protected.zip ### Run Benchmark Evaluation -> **Note:** For MiroThinker v1.5, use `mirothinker_v1.5_keep5_max200` (with context management), `mirothinker_v1.5_keep5_max400` (with context management), or `mirothinker_v1.5` configurations. For v1.0, use `mirothinker_v1.0_keep5` (with context management) or `mirothinker_v1.0` configurations. +> **Note:** For MiroThinker-1.7, use `mirothinker_1.7_keep5_max200` (with context management), `mirothinker_1.7_keep5_max300` (with context management). **Available Parameters:** @@ -642,7 +688,7 @@ You can customize the evaluation by setting the following environment variables | `BASE_URL` | `"https://your-api.com/v1"` | Base URL of your server | | `NUM_RUNS` | Varies by benchmark | Number of evaluation runs (3 for most benchmarks, 8 for GAIA/XBench/FutureX/SEAL-0, 32 for AIME2025) | | `LLM_PROVIDER` | `"qwen"` | LLM provider (e.g., `qwen`, `openai`, `anthropic`) | -| `AGENT_SET` | `"mirothinker_v1.5_keep5_max200"` | Agent configuration (e.g., `mirothinker_v1.5_keep5_max200`, `mirothinker_v1.5_keep5_max400`, `mirothinker_v1.0_keep5`) | +| `AGENT_SET` | `"mirothinker_1.7_keep5_max200"` | Agent configuration (e.g., `mirothinker_1.7_keep5_max200`, `mirothinker_1.7_keep5_max300`.) | | `MAX_CONTEXT_LENGTH` | `262144` | Maximum context length (256K) | | `MAX_CONCURRENT` | `10` | Maximum concurrent tasks | | `PASS_AT_K` | `1` | Pass@K evaluation metric | @@ -656,79 +702,73 @@ You can customize the evaluation by setting the following environment variables cd apps/miroflow-agent # Basic usage with v1.5 (recommended) -NUM_RUNS=8 LLM_MODEL="MiroThinker-v1.5-30B" BASE_URL="https://your-api.com/v1" bash scripts/run_evaluate_multiple_runs_gaia-validation-text-103.sh +NUM_RUNS=8 LLM_MODEL="MiroThinker-1.7-mini" BASE_URL="https://your-api.com/v1" bash scripts/run_evaluate_multiple_runs_gaia-validation-text-103.sh # Or with v1.0 # NUM_RUNS=8 LLM_MODEL="MiroThinker-v1.0-30B" BASE_URL="https://your-api.com/v1" bash scripts/run_evaluate_multiple_runs_gaia-validation-text-103.sh # Customize number of runs and agent configuration (v1.5 with context management) -LLM_MODEL="MiroThinker-v1.5-30B" \ +LLM_MODEL="MiroThinker-1.7-mini" \ BASE_URL="https://your-api.com/v1" \ NUM_RUNS=8 \ -AGENT_SET="mirothinker_v1.5_keep5_max200" \ +AGENT_SET="mirothinker_1.7_keep5_max200" \ bash scripts/run_evaluate_multiple_runs_gaia-validation-text-103.sh -# Or with v1.0 configuration (with context management) -# LLM_MODEL="MiroThinker-v1.0-30B" \ -# BASE_URL="https://your-api.com/v1" \ -# NUM_RUNS=8 \ -# AGENT_SET="mirothinker_v1.0_keep5" \ -# bash scripts/run_evaluate_multiple_runs_gaia-validation-text-103.sh ```
πŸ“‹ Click to expand all benchmark commands -> **⚠️ Important for MiroThinker v1.5**: To reproduce our reported results, you must set the correct `AGENT_SET`: +> **⚠️ Important for MiroThinker-1.7**: To reproduce our reported results, you must set the correct `AGENT_SET`: > -> - **BrowseComp & BrowseComp-ZH**: Use `AGENT_SET="mirothinker_v1.5_keep5_max400"` -> - **All other benchmarks**: Use `AGENT_SET="mirothinker_v1.5_keep5_max200"` +> - **BrowseComp & BrowseComp-ZH**: Use `AGENT_SET="mirothinker_1.7_keep5_max300"` +> - **All other benchmarks**: Use `AGENT_SET="mirothinker_1.7_keep5_max200"` ```bash # Navigate to the miroflow-agent directory first cd apps/miroflow-agent # HLE -NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_hle.sh +NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_hle.sh # HLE-Text-2158 -NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_hle-text-2158.sh +NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_hle-text-2158.sh # HLE-Text-500 -NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_hle-text-500.sh +NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_hle-text-500.sh # GAIA-Text-103 -NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_gaia-validation-text-103.sh +NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_gaia-validation-text-103.sh # GAIA-Validation (GAIA-Val-165) -NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_gaia-validation.sh +NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_gaia-validation.sh -# BrowseComp-EN (⚠️ use max400) -NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max400" bash scripts/run_evaluate_multiple_runs_browsecomp.sh +# BrowseComp-EN (⚠️ use max300) +NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max300" bash scripts/run_evaluate_multiple_runs_browsecomp.sh -# BrowseComp-ZH (⚠️ use max400) -NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max400" bash scripts/run_evaluate_multiple_runs_browsecomp_zh.sh +# BrowseComp-ZH (⚠️ use max300) +NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max300" bash scripts/run_evaluate_multiple_runs_browsecomp_zh.sh # WebWalkerQA -NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_webwalkerqa.sh +NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_webwalkerqa.sh # XBench-DeepSearch -NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_xbench_deepsearch.sh +NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_xbench_deepsearch.sh # FRAMES -NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_frames.sh +NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_frames.sh # SEAL-0 -NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_seal-0.sh +NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_seal-0.sh # FutureX -NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_futurex.sh +NUM_RUNS=8 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_futurex.sh # AIME2025 -NUM_RUNS=32 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_aime2025.sh +NUM_RUNS=32 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_aime2025.sh # DeepSearchQA -NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_v1.5_keep5_max200" bash scripts/run_evaluate_multiple_runs_deepsearchqa.sh +NUM_RUNS=3 LLM_MODEL="xxx" BASE_URL="xxx" AGENT_SET="mirothinker_1.7_keep5_max200" bash scripts/run_evaluate_multiple_runs_deepsearchqa.sh ```
@@ -811,11 +851,11 @@ bash scripts/collect_trace_qwen3.sh #### **Q: Which version should I use?** -**A:** We recommend **MiroThinker v1.5** ⭐ with the minimal configuration: +**A:** We recommend **MiroThinker-1.7** ⭐ with the minimal configuration: -- **v1.5** ⭐: Latest version with 256K context, world-leading performance. Use config (with context management): - - `mirothinker_v1.5_keep5_max200` (up to 200 turns, recommended for most tasks) - - `mirothinker_v1.5_keep5_max400` (up to 400 turns, only used for BrowseComp and BrowseComp-ZH) +- **v1.7** ⭐: Latest version with 256K context, world-leading performance. Use config (with context management): + - `mirothinker_1.7_keep5_max200` (up to 200 turns, recommended for most tasks) + - `mirothinker_1.7_keep5_max300` (up to 300 turns, only used for BrowseComp and BrowseComp-ZH) #### **Q: How do I get API keys?** @@ -853,8 +893,7 @@ bash scripts/collect_trace_qwen3.sh - **Reduce context length**: Set `MAX_CONTEXT_LENGTH` to a smaller value (e.g., 131072 for 128K) - **Use context management with fewer turns**: - - For v1.5: Use `mirothinker_v1.5_keep5_max200` or `mirothinker_v1.5_keep5_max400` (with context management) - - For v1.0: Use `mirothinker_v1.0_keep5` (with context management) + - For v1.5: Use `mirothinker_1.7_keep5_max200` or `mirothinker_1.7_keep5_max300` (with context management) - **Reduce concurrent tasks**: Set `MAX_CONCURRENT` to a smaller number (e.g., 5) - **Use smaller agents**: - For v1.5: Try 30B instead of 235B @@ -891,7 +930,7 @@ The scripts show completion status, elapsed time, and estimated remaining time. ## πŸ“„ License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details. ## πŸ™ Acknowledgments diff --git a/apps/collect-trace/utils/converters/__init__.py b/apps/collect-trace/utils/converters/__init__.py index 1213306f..25cec849 100644 --- a/apps/collect-trace/utils/converters/__init__.py +++ b/apps/collect-trace/utils/converters/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. from .convert_non_oai_to_chatml import ( convert_to_json_chatml, diff --git a/apps/collect-trace/utils/converters/convert_non_oai_to_chatml.py b/apps/collect-trace/utils/converters/convert_non_oai_to_chatml.py index 36e650eb..a704164f 100644 --- a/apps/collect-trace/utils/converters/convert_non_oai_to_chatml.py +++ b/apps/collect-trace/utils/converters/convert_non_oai_to_chatml.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import json import sys diff --git a/apps/collect-trace/utils/converters/convert_oai_to_chatml.py b/apps/collect-trace/utils/converters/convert_oai_to_chatml.py index e5282c3a..256d5f5b 100644 --- a/apps/collect-trace/utils/converters/convert_oai_to_chatml.py +++ b/apps/collect-trace/utils/converters/convert_oai_to_chatml.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import ast import json diff --git a/apps/collect-trace/utils/converters/convert_to_chatml_auto_batch.py b/apps/collect-trace/utils/converters/convert_to_chatml_auto_batch.py index 2b51ec84..eb7ede1a 100644 --- a/apps/collect-trace/utils/converters/convert_to_chatml_auto_batch.py +++ b/apps/collect-trace/utils/converters/convert_to_chatml_auto_batch.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import json import subprocess diff --git a/apps/collect-trace/utils/converters/example_usage.py b/apps/collect-trace/utils/converters/example_usage.py index df8f26cd..d2607a8d 100644 --- a/apps/collect-trace/utils/converters/example_usage.py +++ b/apps/collect-trace/utils/converters/example_usage.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import json import os diff --git a/apps/collect-trace/utils/converters/system_prompts.py b/apps/collect-trace/utils/converters/system_prompts.py index 2de0e1bd..1da865d2 100644 --- a/apps/collect-trace/utils/converters/system_prompts.py +++ b/apps/collect-trace/utils/converters/system_prompts.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. main_system_prompt_foreword = """In this environment you have access to a set of tools you can use to answer the user's question. \n \nYou only have access to the tools provided below. You can only use one tool per message, and will receive the result of that tool in the user's next response. You use tools step-by-step to accomplish a given task, with each tool-use informed by the result of the previous tool-use.""" diff --git a/apps/collect-trace/utils/merge_chatml_msgs_to_one_json.py b/apps/collect-trace/utils/merge_chatml_msgs_to_one_json.py index 9bdb5962..7fab0cc1 100644 --- a/apps/collect-trace/utils/merge_chatml_msgs_to_one_json.py +++ b/apps/collect-trace/utils/merge_chatml_msgs_to_one_json.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import glob diff --git a/apps/collect-trace/utils/process_logs.py b/apps/collect-trace/utils/process_logs.py index a39064e4..765a3b31 100644 --- a/apps/collect-trace/utils/process_logs.py +++ b/apps/collect-trace/utils/process_logs.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import json diff --git a/apps/gradio-demo/prompt_patch.py b/apps/gradio-demo/prompt_patch.py index 299aa9dc..a508b049 100644 --- a/apps/gradio-demo/prompt_patch.py +++ b/apps/gradio-demo/prompt_patch.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Custom Prompt Override (Monkey Patching) diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_aime2025.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_aime2025.py index 577d095c..15ce7311 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_aime2025.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_aime2025.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_browsecomp.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_browsecomp.py index b28f5970..ec2c1005 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_browsecomp.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_browsecomp.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_browsecomp_zh.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_browsecomp_zh.py index 96ef3efd..6af517b5 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_browsecomp_zh.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_browsecomp_zh.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_deepsearchqa.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_deepsearchqa.py index 0b771d83..5bb9698f 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_deepsearchqa.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_deepsearchqa.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import glob diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_frames.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_frames.py index 7815abc0..73e7911d 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_frames.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_frames.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_gaia-validation-text-103.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_gaia-validation-text-103.py index 915aa01e..3c64fd60 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_gaia-validation-text-103.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_gaia-validation-text-103.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_gaia-validation.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_gaia-validation.py index 471e9a84..58f084df 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_gaia-validation.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_gaia-validation.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle-text-2158.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle-text-2158.py index 91d6b6b8..bce23ccf 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle-text-2158.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle-text-2158.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle-text-500.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle-text-500.py index 91b2dfa2..9beefaa8 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle-text-500.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle-text-500.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle.py index f6437fab..b884e543 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_hle.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_seal-0.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_seal-0.py index 12f60dc6..e18d7c69 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_seal-0.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_seal-0.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_webwalkerqa.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_webwalkerqa.py index 84df5389..3b282de6 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_webwalkerqa.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_webwalkerqa.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/check_progress_xbench_deepsearch.py b/apps/miroflow-agent/benchmarks/check_progress/check_progress_xbench_deepsearch.py index df9288dc..69040b1b 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/check_progress_xbench_deepsearch.py +++ b/apps/miroflow-agent/benchmarks/check_progress/check_progress_xbench_deepsearch.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import os diff --git a/apps/miroflow-agent/benchmarks/check_progress/common.py b/apps/miroflow-agent/benchmarks/check_progress/common.py index e12db33c..2217406b 100644 --- a/apps/miroflow-agent/benchmarks/check_progress/common.py +++ b/apps/miroflow-agent/benchmarks/check_progress/common.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import glob import json diff --git a/apps/miroflow-agent/benchmarks/common_benchmark.py b/apps/miroflow-agent/benchmarks/common_benchmark.py index 5e042a6f..a52f6c38 100644 --- a/apps/miroflow-agent/benchmarks/common_benchmark.py +++ b/apps/miroflow-agent/benchmarks/common_benchmark.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import gc diff --git a/apps/miroflow-agent/benchmarks/evaluators/calculate_average_score.py b/apps/miroflow-agent/benchmarks/evaluators/calculate_average_score.py index 4c910976..c57b7b2b 100755 --- a/apps/miroflow-agent/benchmarks/evaluators/calculate_average_score.py +++ b/apps/miroflow-agent/benchmarks/evaluators/calculate_average_score.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import glob import os diff --git a/apps/miroflow-agent/benchmarks/evaluators/eval_utils.py b/apps/miroflow-agent/benchmarks/evaluators/eval_utils.py index 8f34a495..57632383 100644 --- a/apps/miroflow-agent/benchmarks/evaluators/eval_utils.py +++ b/apps/miroflow-agent/benchmarks/evaluators/eval_utils.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import json diff --git a/apps/miroflow-agent/benchmarks/evaluators/extract_futurex_results.py b/apps/miroflow-agent/benchmarks/evaluators/extract_futurex_results.py index 89ba0056..816d4863 100644 --- a/apps/miroflow-agent/benchmarks/evaluators/extract_futurex_results.py +++ b/apps/miroflow-agent/benchmarks/evaluators/extract_futurex_results.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import json diff --git a/apps/miroflow-agent/benchmarks/subset_extraction/gaia-text-103-grader.py b/apps/miroflow-agent/benchmarks/subset_extraction/gaia-text-103-grader.py index 17ff95a2..0acd30cf 100644 --- a/apps/miroflow-agent/benchmarks/subset_extraction/gaia-text-103-grader.py +++ b/apps/miroflow-agent/benchmarks/subset_extraction/gaia-text-103-grader.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ GAIA-Text-103 Task Grader diff --git a/apps/miroflow-agent/benchmarks/subset_extraction/gaia-to-text-103-mover.py b/apps/miroflow-agent/benchmarks/subset_extraction/gaia-to-text-103-mover.py index c8d04fb1..5d8abbbe 100644 --- a/apps/miroflow-agent/benchmarks/subset_extraction/gaia-to-text-103-mover.py +++ b/apps/miroflow-agent/benchmarks/subset_extraction/gaia-to-text-103-mover.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ GAIA to Text-103 Task Copier diff --git a/apps/miroflow-agent/conf/agent/mirothinker_1.7_keep5_max200.yaml b/apps/miroflow-agent/conf/agent/mirothinker_1.7_keep5_max200.yaml new file mode 100644 index 00000000..d3c39599 --- /dev/null +++ b/apps/miroflow-agent/conf/agent/mirothinker_1.7_keep5_max200.yaml @@ -0,0 +1,23 @@ +# conf/agent/mirothinker_1.7_keep5_max200.yaml +# The name of tools and sub-agents defined in: apps/miroflow-agent/src/config/settings.py +# Each sub-agent prompt is written in: apps/miroflow-agent/src/utils/prompt_utils.py +defaults: + - default + - _self_ + +main_agent: + tools: + - search_and_scrape_webpage + - jina_scrape_llm_summary + - tool-python + tool_blacklist: + - [ "search_and_scrape_webpage", "sogou_search" ] + - [ "tool-python", "download_file_from_sandbox_to_local" ] + max_turns: 200 # Maximum number of turns for main agent execution + +sub_agents: + +# Settings for context management +keep_tool_result: 5 +context_compress_limit: 5 # Enable context compression (>0 = enabled, 0 = disabled). +retry_with_summary: False # default is true \ No newline at end of file diff --git a/apps/miroflow-agent/conf/agent/mirothinker_1.7_keep5_max300.yaml b/apps/miroflow-agent/conf/agent/mirothinker_1.7_keep5_max300.yaml new file mode 100644 index 00000000..73a58508 --- /dev/null +++ b/apps/miroflow-agent/conf/agent/mirothinker_1.7_keep5_max300.yaml @@ -0,0 +1,23 @@ +# conf/agent/mirothinker_1.7_keep5_max300.yaml +# The name of tools and sub-agents defined in: apps/miroflow-agent/src/config/settings.py +# Each sub-agent prompt is written in: apps/miroflow-agent/src/utils/prompt_utils.py +defaults: + - default + - _self_ + +main_agent: + tools: + - search_and_scrape_webpage + - jina_scrape_llm_summary + - tool-python + tool_blacklist: + - [ "search_and_scrape_webpage", "sogou_search" ] + - [ "tool-python", "download_file_from_sandbox_to_local" ] + max_turns: 300 # Maximum number of turns for main agent execution + +sub_agents: + +# Settings for context management +keep_tool_result: 5 +context_compress_limit: 5 # Enable context compression (>0 = enabled, 0 = disabled). +retry_with_summary: False # default is true \ No newline at end of file diff --git a/apps/miroflow-agent/main.py b/apps/miroflow-agent/main.py index c3d7676b..a21ad115 100644 --- a/apps/miroflow-agent/main.py +++ b/apps/miroflow-agent/main.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio diff --git a/apps/miroflow-agent/src/__init__.py b/apps/miroflow-agent/src/__init__.py index d45bf151..f0b222cb 100644 --- a/apps/miroflow-agent/src/__init__.py +++ b/apps/miroflow-agent/src/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """MiroFlow Agent - A modular agent framework for task execution.""" diff --git a/apps/miroflow-agent/src/config/__init__.py b/apps/miroflow-agent/src/config/__init__.py index 5c3673a9..0ca068a1 100644 --- a/apps/miroflow-agent/src/config/__init__.py +++ b/apps/miroflow-agent/src/config/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """Configuration module for MiroFlow Agent.""" diff --git a/apps/miroflow-agent/src/config/settings.py b/apps/miroflow-agent/src/config/settings.py index 11ec4ea6..d5489ddd 100644 --- a/apps/miroflow-agent/src/config/settings.py +++ b/apps/miroflow-agent/src/config/settings.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Configuration settings and MCP server parameter management. diff --git a/apps/miroflow-agent/src/core/__init__.py b/apps/miroflow-agent/src/core/__init__.py index fab1b442..3ff25b4f 100644 --- a/apps/miroflow-agent/src/core/__init__.py +++ b/apps/miroflow-agent/src/core/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """Core module containing orchestrator and pipeline components.""" diff --git a/apps/miroflow-agent/src/core/answer_generator.py b/apps/miroflow-agent/src/core/answer_generator.py index c0d14363..f7f56174 100644 --- a/apps/miroflow-agent/src/core/answer_generator.py +++ b/apps/miroflow-agent/src/core/answer_generator.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Answer generator module for final answer generation and context management. @@ -75,6 +75,7 @@ def __init__( self.max_final_answer_retries = ( DEFAULT_MAX_FINAL_ANSWER_RETRIES if cfg.agent.keep_tool_result == -1 else 1 ) + self.retry_with_summary = cfg.agent.get("retry_with_summary", True) async def handle_llm_call( self, @@ -513,9 +514,10 @@ async def generate_and_finalize_answer( if save_callback: save_callback(system_prompt, message_history) - failure_experience_summary = await self.generate_failure_summary( - system_prompt, message_history, tool_definitions, turn_count - ) + if self.retry_with_summary: + failure_experience_summary = await self.generate_failure_summary( + system_prompt, message_history, tool_definitions, turn_count + ) return ( "Task incomplete - reached maximum turns. Will retry with failure experience.", @@ -575,7 +577,7 @@ async def generate_and_finalize_answer( ) ) - if final_boxed_answer == FORMAT_ERROR_MESSAGE: + if final_boxed_answer == FORMAT_ERROR_MESSAGE and self.retry_with_summary: failure_experience_summary = await self.generate_failure_summary( system_prompt, message_history, tool_definitions, turn_count ) diff --git a/apps/miroflow-agent/src/core/orchestrator.py b/apps/miroflow-agent/src/core/orchestrator.py index e3c88efc..5619bacf 100644 --- a/apps/miroflow-agent/src/core/orchestrator.py +++ b/apps/miroflow-agent/src/core/orchestrator.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Orchestrator module for coordinating agent task execution. diff --git a/apps/miroflow-agent/src/core/pipeline.py b/apps/miroflow-agent/src/core/pipeline.py index 7a8c8967..e111c7bd 100644 --- a/apps/miroflow-agent/src/core/pipeline.py +++ b/apps/miroflow-agent/src/core/pipeline.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Task execution pipeline module. diff --git a/apps/miroflow-agent/src/core/stream_handler.py b/apps/miroflow-agent/src/core/stream_handler.py index 9e32e8c1..52e96555 100644 --- a/apps/miroflow-agent/src/core/stream_handler.py +++ b/apps/miroflow-agent/src/core/stream_handler.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Stream handler module for SSE (Server-Sent Events) protocol. diff --git a/apps/miroflow-agent/src/core/tool_executor.py b/apps/miroflow-agent/src/core/tool_executor.py index c07599d3..b7d2eb40 100644 --- a/apps/miroflow-agent/src/core/tool_executor.py +++ b/apps/miroflow-agent/src/core/tool_executor.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Tool executor module for handling tool call execution. @@ -89,6 +89,14 @@ def fix_tool_call_arguments(self, tool_name: str, arguments: dict) -> dict: fixed_args["info_to_extract"] = fixed_args.pop(mistake_name) break + # Fix run_python_code parameter names: 'code' -> 'code_block' + # Also add default sandbox_id if missing (will trigger stateless fallback) + if tool_name == "run_python_code": + if "code_block" not in fixed_args and "code" in fixed_args: + fixed_args["code_block"] = fixed_args.pop("code") + if "sandbox_id" not in fixed_args: + fixed_args["sandbox_id"] = "default" + return fixed_args def get_query_str_from_tool_call( diff --git a/apps/miroflow-agent/src/io/__init__.py b/apps/miroflow-agent/src/io/__init__.py index a03c1543..04e5f256 100644 --- a/apps/miroflow-agent/src/io/__init__.py +++ b/apps/miroflow-agent/src/io/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """Input/Output module for processing task inputs and formatting outputs.""" diff --git a/apps/miroflow-agent/src/io/input_handler.py b/apps/miroflow-agent/src/io/input_handler.py index 650e4f60..1682783a 100644 --- a/apps/miroflow-agent/src/io/input_handler.py +++ b/apps/miroflow-agent/src/io/input_handler.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Input handler module for processing various file types. diff --git a/apps/miroflow-agent/src/io/output_formatter.py b/apps/miroflow-agent/src/io/output_formatter.py index 2d15d25f..b3605d90 100644 --- a/apps/miroflow-agent/src/io/output_formatter.py +++ b/apps/miroflow-agent/src/io/output_formatter.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """Output formatting utilities for agent responses.""" diff --git a/apps/miroflow-agent/src/llm/__init__.py b/apps/miroflow-agent/src/llm/__init__.py index 5b2d2e7f..dbc223fd 100644 --- a/apps/miroflow-agent/src/llm/__init__.py +++ b/apps/miroflow-agent/src/llm/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. from .base_client import BaseClient from .factory import ClientFactory diff --git a/apps/miroflow-agent/src/llm/base_client.py b/apps/miroflow-agent/src/llm/base_client.py index 07f80113..80e97bcc 100644 --- a/apps/miroflow-agent/src/llm/base_client.py +++ b/apps/miroflow-agent/src/llm/base_client.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Base client module for LLM providers. diff --git a/apps/miroflow-agent/src/llm/factory.py b/apps/miroflow-agent/src/llm/factory.py index 12af841a..c2d979c4 100644 --- a/apps/miroflow-agent/src/llm/factory.py +++ b/apps/miroflow-agent/src/llm/factory.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ LLM Client Factory module. diff --git a/apps/miroflow-agent/src/llm/providers/__init__.py b/apps/miroflow-agent/src/llm/providers/__init__.py index 53b9de6f..fb0f40ad 100644 --- a/apps/miroflow-agent/src/llm/providers/__init__.py +++ b/apps/miroflow-agent/src/llm/providers/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. from .anthropic_client import AnthropicClient from .openai_client import OpenAIClient diff --git a/apps/miroflow-agent/src/llm/providers/anthropic_client.py b/apps/miroflow-agent/src/llm/providers/anthropic_client.py index b30ed4c8..6edd30a2 100644 --- a/apps/miroflow-agent/src/llm/providers/anthropic_client.py +++ b/apps/miroflow-agent/src/llm/providers/anthropic_client.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Anthropic Claude LLM client implementation. @@ -208,6 +208,8 @@ def process_llm_response( assistant_response_text = "" assistant_response_content = [] + from ...utils.parsing_utils import fix_server_name_in_text + for block in llm_response.content: if block.type == "text": assistant_response_text += block.text + "\n" @@ -222,6 +224,12 @@ def process_llm_response( } ) + # Fix server_name in text content + assistant_response_text = fix_server_name_in_text(assistant_response_text) + for item in assistant_response_content: + if item.get("type") == "text": + item["text"] = fix_server_name_in_text(item["text"]) + # Add assistant response to history message_history.append( {"role": "assistant", "content": assistant_response_content} @@ -264,7 +272,11 @@ def update_message_history( return message_history def generate_agent_system_prompt(self, date: Any, mcp_servers: List[Dict]) -> str: - return generate_mcp_system_prompt(date, mcp_servers) + from ...utils.parsing_utils import set_tool_server_mapping + + prompt = generate_mcp_system_prompt(date, mcp_servers) + set_tool_server_mapping(prompt) + return prompt def _estimate_tokens(self, text: str) -> int: """Use tiktoken to estimate the number of tokens in text""" diff --git a/apps/miroflow-agent/src/llm/providers/openai_client.py b/apps/miroflow-agent/src/llm/providers/openai_client.py index 4669b877..0df38e1b 100644 --- a/apps/miroflow-agent/src/llm/providers/openai_client.py +++ b/apps/miroflow-agent/src/llm/providers/openai_client.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ OpenAI-compatible LLM client implementation. @@ -288,8 +288,11 @@ def process_llm_response( return "", True, message_history # Exit loop, return message_history # Extract LLM response text + from ...utils.parsing_utils import fix_server_name_in_text + if llm_response.choices[0].finish_reason == "stop": assistant_response_text = llm_response.choices[0].message.content or "" + assistant_response_text = fix_server_name_in_text(assistant_response_text) message_history.append( {"role": "assistant", "content": assistant_response_text} @@ -297,6 +300,7 @@ def process_llm_response( elif llm_response.choices[0].finish_reason == "length": assistant_response_text = llm_response.choices[0].message.content or "" + assistant_response_text = fix_server_name_in_text(assistant_response_text) if assistant_response_text == "": assistant_response_text = "LLM response is empty." elif "Context length exceeded" in assistant_response_text: @@ -358,7 +362,11 @@ def update_message_history( return message_history def generate_agent_system_prompt(self, date: Any, mcp_servers: List[Dict]) -> str: - return generate_mcp_system_prompt(date, mcp_servers) + from ...utils.parsing_utils import set_tool_server_mapping + + prompt = generate_mcp_system_prompt(date, mcp_servers) + set_tool_server_mapping(prompt) + return prompt def _estimate_tokens(self, text: str) -> int: """Use tiktoken to estimate the number of tokens in text""" diff --git a/apps/miroflow-agent/src/llm/util.py b/apps/miroflow-agent/src/llm/util.py index fd7d1636..c942af4b 100644 --- a/apps/miroflow-agent/src/llm/util.py +++ b/apps/miroflow-agent/src/llm/util.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Utility decorators and helpers for LLM client operations. diff --git a/apps/miroflow-agent/src/logging/__init__.py b/apps/miroflow-agent/src/logging/__init__.py index 648e31b4..f138e6d2 100644 --- a/apps/miroflow-agent/src/logging/__init__.py +++ b/apps/miroflow-agent/src/logging/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """Logging module for task execution tracking.""" diff --git a/apps/miroflow-agent/src/logging/summary_time_cost.py b/apps/miroflow-agent/src/logging/summary_time_cost.py index 47cf6698..9f4e69fb 100644 --- a/apps/miroflow-agent/src/logging/summary_time_cost.py +++ b/apps/miroflow-agent/src/logging/summary_time_cost.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import json from collections import defaultdict diff --git a/apps/miroflow-agent/src/logging/task_logger.py b/apps/miroflow-agent/src/logging/task_logger.py index 99338108..d75d97f6 100644 --- a/apps/miroflow-agent/src/logging/task_logger.py +++ b/apps/miroflow-agent/src/logging/task_logger.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Task logging and structured output module. diff --git a/apps/miroflow-agent/src/utils/__init__.py b/apps/miroflow-agent/src/utils/__init__.py index 80582a0a..f476a1a9 100644 --- a/apps/miroflow-agent/src/utils/__init__.py +++ b/apps/miroflow-agent/src/utils/__init__.py @@ -1,13 +1,15 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """Utility functions for parsing, prompts, and wrappers.""" from .parsing_utils import ( extract_failure_experience_summary, extract_llm_response_text, + fix_server_name_in_text, parse_llm_response_for_tool_calls, safe_json_loads, + set_tool_server_mapping, ) from .prompt_utils import ( FORMAT_ERROR_MESSAGE, @@ -22,6 +24,8 @@ "parse_llm_response_for_tool_calls", "extract_llm_response_text", "extract_failure_experience_summary", + "fix_server_name_in_text", + "set_tool_server_mapping", "safe_json_loads", # prompt_utils "FORMAT_ERROR_MESSAGE", diff --git a/apps/miroflow-agent/src/utils/parsing_utils.py b/apps/miroflow-agent/src/utils/parsing_utils.py index a17b9b59..901a68d5 100644 --- a/apps/miroflow-agent/src/utils/parsing_utils.py +++ b/apps/miroflow-agent/src/utils/parsing_utils.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Parsing utilities for LLM responses and tool calls. @@ -21,6 +21,106 @@ logger = logging.getLogger("miroflow_agent") +def parse_tool_server_mapping(system_prompt: str) -> dict: + """ + Parse system prompt to extract tool_name β†’ server_name mapping. + + Parses patterns like: + ## Server name: tool-python + ### Tool name: run_python_code + + Only extracts mappings for the 3 target tools that models commonly get wrong: + run_python_code, google_search, scrape_and_extract_info. + + Args: + system_prompt: The system prompt containing MCP tool definitions + + Returns: + Dict mapping tool_name to correct server_name, e.g. + {"run_python_code": "tool-python", "google_search": "search_and_scrape_webpage", ...} + """ + TARGET_TOOLS = {"run_python_code", "google_search", "scrape_and_extract_info"} + mapping = {} + current_server = None + for line in system_prompt.split("\n"): + server_match = re.match(r"## Server name:\s*(.+)", line) + if server_match: + current_server = server_match.group(1).strip() + continue + tool_match = re.match(r"### Tool name:\s*(.+)", line) + if tool_match and current_server: + tool_name = tool_match.group(1).strip() + if tool_name in TARGET_TOOLS: + mapping[tool_name] = current_server + return mapping + + +# Module-level cache for tool_server_mapping +_tool_server_mapping: dict = {} + + +def set_tool_server_mapping(system_prompt: str) -> None: + """ + Parse system prompt and cache the tool_name β†’ server_name mapping. + + Should be called once when system prompt is available. + + Args: + system_prompt: The system prompt containing MCP tool definitions + """ + global _tool_server_mapping + _tool_server_mapping = parse_tool_server_mapping(system_prompt) + + +def fix_server_name_in_text(text: str) -> str: + """ + Fix incorrect server_name and tool_name in MCP XML tool calls. + + Uses the cached tool_server_mapping (parsed from system prompt) to determine + the correct server_name for each tool. Only fixes the 3 target tools: + run_python_code, google_search, scrape_and_extract_info. + + Also handles the special case where model outputs tool_name=python + (should be run_python_code). + + Args: + text: The LLM response text containing MCP tool calls + + Returns: + Text with corrected server_name and tool_name if needed + """ + if not isinstance(text, str): + return text + + mapping = _tool_server_mapping + if not mapping: + return text + + # Special case: tool_name=python or python_code β†’ rename to run_python_code + # Only apply if system prompt defines run_python_code (not python) + if "run_python_code" in mapping: + for wrong_name in ("python", "python_code"): + tag = f"{wrong_name}" + if tag in text: + text = text.replace(tag, "run_python_code") + + # Fix server_name for each target tool using the mapping from system prompt + for tool_name, correct_server in mapping.items(): + tool_tag = f"{tool_name}" + if tool_tag not in text: + continue + correct_server_tag = f"{correct_server}" + if correct_server_tag in text: + continue + text = re.sub( + r"[^<]+(\s*" + re.escape(tool_tag) + r")", + correct_server_tag + r"\1", + text, + ) + + return text + + def filter_none_values(arguments: Union[Dict, Any]) -> Union[Dict, Any]: """ Filter out keys with None values from arguments dictionary. diff --git a/apps/miroflow-agent/src/utils/prompt_utils.py b/apps/miroflow-agent/src/utils/prompt_utils.py index 9b7591a6..939c2f7c 100644 --- a/apps/miroflow-agent/src/utils/prompt_utils.py +++ b/apps/miroflow-agent/src/utils/prompt_utils.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ Prompt templates and utilities for agent system prompts. diff --git a/apps/miroflow-agent/src/utils/wrapper_utils.py b/apps/miroflow-agent/src/utils/wrapper_utils.py index 468bee15..fc6f6832 100644 --- a/apps/miroflow-agent/src/utils/wrapper_utils.py +++ b/apps/miroflow-agent/src/utils/wrapper_utils.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """Wrapper utilities for handling responses and errors in a type-safe manner.""" diff --git a/apps/visualize-trace/app.py b/apps/visualize-trace/app.py index 2058eefc..00a9a1c1 100644 --- a/apps/visualize-trace/app.py +++ b/apps/visualize-trace/app.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import os diff --git a/apps/visualize-trace/run.py b/apps/visualize-trace/run.py index f4ad60a7..da51cfcc 100644 --- a/apps/visualize-trace/run.py +++ b/apps/visualize-trace/run.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import os import subprocess diff --git a/apps/visualize-trace/trace_analyzer.py b/apps/visualize-trace/trace_analyzer.py index 13a990c6..d792bc37 100644 --- a/apps/visualize-trace/trace_analyzer.py +++ b/apps/visualize-trace/trace_analyzer.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import json import re diff --git a/assets/1.7_main_results.png b/assets/1.7_main_results.png new file mode 100644 index 00000000..47d1a004 Binary files /dev/null and b/assets/1.7_main_results.png differ diff --git a/assets/17_table.png b/assets/17_table.png new file mode 100644 index 00000000..8c14642b Binary files /dev/null and b/assets/17_table.png differ diff --git a/assets/miromind_wechat.png b/assets/miromind_wechat.png deleted file mode 100644 index 255f9010..00000000 Binary files a/assets/miromind_wechat.png and /dev/null differ diff --git a/assets/mirothinker_logo.png b/assets/mirothinker_logo.png new file mode 100644 index 00000000..0239f14f Binary files /dev/null and b/assets/mirothinker_logo.png differ diff --git a/libs/miroflow-tools/src/miroflow_tools/__init__.py b/libs/miroflow-tools/src/miroflow_tools/__init__.py index 00b71bcf..59a78141 100644 --- a/libs/miroflow-tools/src/miroflow_tools/__init__.py +++ b/libs/miroflow-tools/src/miroflow_tools/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. from .manager import ToolManager diff --git a/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/jina_scrape_llm_summary.py b/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/jina_scrape_llm_summary.py index f8cd1880..82dcd2e4 100644 --- a/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/jina_scrape_llm_summary.py +++ b/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/jina_scrape_llm_summary.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import json diff --git a/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/search_and_scrape_webpage.py b/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/search_and_scrape_webpage.py index 2a0484b5..e8d7355e 100644 --- a/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/search_and_scrape_webpage.py +++ b/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/search_and_scrape_webpage.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import json import logging @@ -58,15 +58,20 @@ async def make_serper_request( return response -def _is_huggingface_dataset_or_space_url(url): +def _is_banned_url(url: str) -> bool: """ - Check if the URL is a HuggingFace dataset or space URL. + Check if the URL is a banned URL. :param url: The URL to check - :return: True if it's a HuggingFace dataset or space URL, False otherwise + :return: True if it's a banned URL, False otherwise """ + banned_list = [ + "unifuncs", + "huggingface.co/datasets", + "huggingface.co/spaces", + ] if not url: return False - return "huggingface.co/datasets" in url or "huggingface.co/spaces" in url + return any(banned in url for banned in banned_list) @mcp.tool() @@ -160,7 +165,7 @@ async def perform_search(search_query: str) -> tuple[list, dict]: organic_results = [] if "organic" in data: for item in data["organic"]: - if _is_huggingface_dataset_or_space_url(item.get("link", "")): + if _is_banned_url(item.get("link", "")): continue organic_results.append(item) diff --git a/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/stateless_python_server.py b/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/stateless_python_server.py index 713d08ff..2a7b7f0e 100644 --- a/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/stateless_python_server.py +++ b/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/stateless_python_server.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import os diff --git a/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/task_planner.py b/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/task_planner.py index 9cd14958..39175b45 100644 --- a/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/task_planner.py +++ b/libs/miroflow-tools/src/miroflow_tools/dev_mcp_servers/task_planner.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import json import logging diff --git a/libs/miroflow-tools/src/miroflow_tools/manager.py b/libs/miroflow-tools/src/miroflow_tools/manager.py index b9ae5a0f..f97964f6 100644 --- a/libs/miroflow-tools/src/miroflow_tools/manager.py +++ b/libs/miroflow-tools/src/miroflow_tools/manager.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import functools diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/audio_mcp_server.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/audio_mcp_server.py index 15ecf440..cfb64cb6 100755 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/audio_mcp_server.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/audio_mcp_server.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import base64 diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/audio_mcp_server_os.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/audio_mcp_server_os.py index 0a40e229..aeb435cd 100755 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/audio_mcp_server_os.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/audio_mcp_server_os.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import base64 diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/browser_session.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/browser_session.py index 0d0142d2..72f26577 100755 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/browser_session.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/browser_session.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import json diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/python_mcp_server.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/python_mcp_server.py index 58534220..d8c94a58 100755 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/python_mcp_server.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/python_mcp_server.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import os @@ -180,8 +180,22 @@ async def run_python_code(code_block: str, sandbox_id: str) -> str: Returns: A CommandResult object containing the result of the command execution, format like CommandResult(stderr=..., stdout=..., exit_code=..., error=...) """ - if sandbox_id in INVALID_SANDBOX_IDS: - return f"[ERROR]: '{sandbox_id}' is not a valid sandbox_id. Please create a real sandbox first using the create_sandbox tool." + # If sandbox_id is invalid, fallback to stateless execution + if not sandbox_id or sandbox_id in INVALID_SANDBOX_IDS: + try: + sandbox = Sandbox( + template=DEFAULT_TEMPLATE_ID, + timeout=DEFAULT_TIMEOUT, + api_key=E2B_API_KEY, + ) + try: + execution = sandbox.run_code(code_block) + return truncate_result(str(execution)) + finally: + sandbox.kill() + except Exception as e: + error_details = str(e)[:MAX_ERROR_LEN] + return f"[ERROR]: Failed to run code in stateless mode. Exception type: {type(e).__name__}, Details: {error_details}" try: sandbox = Sandbox.connect(sandbox_id, api_key=E2B_API_KEY) diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reading_mcp_server.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reading_mcp_server.py index e9cb82b4..06f7de27 100644 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reading_mcp_server.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reading_mcp_server.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import argparse import logging diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reasoning_mcp_server.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reasoning_mcp_server.py index d2af9069..32014f06 100755 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reasoning_mcp_server.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reasoning_mcp_server.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import logging import os diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reasoning_mcp_server_os.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reasoning_mcp_server_os.py index 1308d663..e40c35fd 100755 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reasoning_mcp_server_os.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/reasoning_mcp_server_os.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import logging import os diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/searching_google_mcp_server.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/searching_google_mcp_server.py index 3e4265b1..480192d8 100644 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/searching_google_mcp_server.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/searching_google_mcp_server.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import calendar diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/searching_sogou_mcp_server.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/searching_sogou_mcp_server.py index 28218a67..e0c64e01 100644 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/searching_sogou_mcp_server.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/searching_sogou_mcp_server.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import json diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/serper_mcp_server.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/serper_mcp_server.py index e1523f35..b1571fa2 100644 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/serper_mcp_server.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/serper_mcp_server.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. """ adapted from diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/vision_mcp_server.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/vision_mcp_server.py index 6e78bf2d..d1ddb679 100755 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/vision_mcp_server.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/vision_mcp_server.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import asyncio import base64 diff --git a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/vision_mcp_server_os.py b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/vision_mcp_server_os.py index 78657fc7..2295961b 100755 --- a/libs/miroflow-tools/src/miroflow_tools/mcp_servers/vision_mcp_server_os.py +++ b/libs/miroflow-tools/src/miroflow_tools/mcp_servers/vision_mcp_server_os.py @@ -1,5 +1,5 @@ # Copyright (c) 2025 MiroMind -# This source code is licensed under the MIT License. +# This source code is licensed under the Apache 2.0 License. import base64 import os