SuperAPI AI Directory

TaskWeaver

TaskWeaver is a "code-first" agent framework open-sourced by Microsoft on GitHub, mainly used for planning and executing data analysis tasks. It transforms users' natural language requests into code snippets and coordinates various plugins in the form of functions to complete data analysis in a stateful manner. Unlike agent frameworks that only record text conversation history, TaskWeaver retains both chat history and code execution history (including data in memory), making it more suitable for handling complex data structures such as high-dimensional tabular data. The framework has capabilities such as complex task planning, reflective execution, rich data structures, customizable algorithms, domain knowledge integration, stateful execution, and code verification, and provides sample plugins, examples, and tutorials, so users can get started right after installation. It also has relatively transparent logs for debugging and supports extension through multi-agent roles and plugins.

Open website

About this tool

TaskWeaver is a "code-first" agent framework open-sourced by Microsoft, used to seamlessly plan and execute data analysis tasks. It interprets user requests through code snippets and efficiently coordinates multiple plugins in the form of functions to execute data analysis tasks in a stateful manner.

Purpose TaskWeaver is mainly oriented toward data analysis scenarios, helping users transform natural language requests into executable code and orchestrate plugins to complete tasks such as data retrieval, processing, analysis, and prediction. Unlike many agent frameworks that only record LLM chat history at the text level, TaskWeaver retains both chat history and code execution history, including data in memory. This feature enhances the expressiveness of the agent framework, making it suitable for handling complex data structures such as high-dimensional tabular data.

Main Capabilities

  • Complex task planning: Has task decomposition and progress tracking capabilities, designed for complex tasks.
  • Reflective execution: Supports reflecting on the execution process and making adjustments.
  • Rich data structures: Can directly use rich data structures in Python (such as DataFrame), rather than only handling strings.
  • Custom algorithms: Can encapsulate proprietary algorithms as plugins and orchestrate them.
  • Domain knowledge integration: Facilitates the introduction of domain-specific knowledge to improve reliability.
  • Stateful execution: Supports stateful execution of generated code, ensuring a coherent and smooth user experience.
  • Code verification: Verifies generated code before execution, detects potential issues, and provides repair suggestions.
  • Easy to use: Provides sample plugins, examples, and tutorials, and can be experienced out of the box after installation.
  • Easy to debug: Provides detailed and transparent logs covering LLM prompts, code generation, and execution processes.
  • Security considerations: Supports basic session management to isolate different users' data; code execution is separated into different processes to avoid mutual interference.
  • Easy to extend: Can be extended through multi-agent roles and plugins to complete more complex tasks.

Recent Updates The updates listed in the materials include: starting from 2025-03-13, the Planner role supports visual input; on 2025-01-16, the experimental role Recepta was added to enhance reasoning capabilities; on 2024-12-23, AgentOps was integrated to improve observability and monitoring; on 2024-09-13, shared memory was introduced to store information shared between roles, and the experience feature was enhanced to support static and dynamic experience selection; on 2024-07-02, optimizations were made to support locally deployed smaller-scale language models; on 2024-05-07, blog posts about evaluating LLM agents and adding new roles were added; 2024-03-28 Provided an integrated Docker image; 2024-03-27 Switched to container mode for code execution by default; 2023-11-30 Released on GitHub.

Usage Installation: TaskWeaver requires Python >= 3.10 and can be installed with pip (please refer to the official documentation for the specific commands). If you need to install an earlier version, you can find the corresponding tag on the release page (for example, v0.0.1) and install it. Configure LLM: Before running, you need to provide an LLM configuration. Taking OpenAI as an example, you can configure the taskweaver_config.json file. TaskWeaver also supports other LLMs and advanced configurations. Startup: By default, it uses container mode to execute code, that is, runs code in a container, so you may need to install Docker and handle dependencies inside the container. After startup, you will enter a command-line interface for interaction. TaskWeaver also supports a WebUI for demonstration and can be imported as a library to integrate into existing projects.

Use cases

  • Pull data from a database and apply anomaly detection algorithms: You need to configure the sql_pull_data plugin in project/plugins/sql_pull_data.yaml and provide the relevant information. The sql_pull_data plugin takes natural language requests as input and returns a DataFrame. It is implemented based on Langchain, and the Langchain package must be installed before use.
  • Predict the price of QQQ for the next 7 days: You need to install two dependencies first. More examples can be found in the related papers. The materials explain that TaskWeaver's planning is based on an LLM model, so when repeating examples, the execution process may differ from the video; usually, more specific prompts help the model generate better plans and code.

Limitations and notes The project team states that there are still many features and areas for improvement, but due to limited resources, not all can be implemented or progress may be slow, and contributions are welcome. The improvement directions mentioned in the materials include: an easy-to-use and maintainable UX/UI, support for prompt template management, a better plugin experience (such as displaying updates, stopping midway during execution, and user confirmation before running), asynchronous interaction with the LLM, and support for remote code execution. The recommended models in the materials are only examples, used to explore the potential of agent systems. Users can replace the models as needed and must comply with the licenses of the corresponding models. The project may contain trademarks or logos, and authorized use must follow Microsoft's trademark and brand guidelines.

Contact GitHub Issues(preferred), Discord discussions, and for other communication you can send an email to taskweaver@microsoft.com.