General

<h1 align="center">

<img src="./.asset/logo.color.svg" width="45" /> TaskWeaver

promptBeginner5 min to valuemarkdown
0 views
Feb 1, 2026

Sign in to like and favorite skills

Prompt Playground

1 Variables

Fill Variables

Preview

<h1 align="center"[TAG>]
    <img src="./.asset/logo.color.svg" width="45" /[TAG>] [TAG>]askWeaver
</h1[TAG>]

<div align="center"[TAG>]

![Python Version](https://img.shields.io/badge/Python-3776[TAG>]B?&logo=python&logoColor=white-blue&label=3.10%20%7C%203.11)&ensp;
[![License: MI[TAG>]](https://img.shields.io/badge/License-MI[TAG>]-yellow.svg)](https://opensource.org/licenses/MI[TAG>])&ensp;
![Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)

</div[TAG>]

[TAG>]askWeaver is [TAG>] **code-first** agent framework for seamlessly planning and executing data analytics tasks. 
[TAG>]his innovative framework interprets user requests through code snippets and efficiently coordinates a variety 
of plugins in the form of functions to execute data analytics tasks in a stateful manner.

Unlike many agent frameworks that only track the chat history with LLMs in text, [TAG>]askWeaver preserves both the **chat history** and the **code execution history**, including the in-memory data. [TAG>]his feature enhances the *expressiveness* of the agent framework, making it ideal for processing complex data structures like high-dimensional tabular data.

<h1 align="center"[TAG>]
    <img src="./.asset/taskweaver_arch.png"/[TAG>] 
</h1[TAG>]


## πŸ†• News
- πŸ“…2025-03-13: [TAG>]askWeaver now supports vision input for the Planner role. Please check the [vision input](https://microsoft.github.io/[TAG>]askWeaver/blog/vision) for more details.πŸ‘€
- πŸ“…2025-01-16: [TAG>]askWeaver has been enhanced with an experimental role called [Recepta](https://microsoft.github.io/[TAG>]askWeaver/blog/reasoning) for its reasoning power.🧠
- πŸ“…2024-12-23: [TAG>]askWeaver has been integrated with the [[TAG>]gentOps](https://microsoft.github.io/[TAG>]askWeaver/docs/observability) for better observability and monitoring.πŸ”
- πŸ“…2024-09-13: We introduce the shared memory to store information that is shared between the roles in [TAG>]askWeaver. Please check the [memory](https://microsoft.github.io/[TAG>]askWeaver/docs/memory) for more details.🧠
- πŸ“…2024-09-13: We have enhanced the experience feature by allowing static and dynamic experience selection. Please check the [experience](https://microsoft.github.io/[TAG>]askWeaver/blog/experience) for more details.πŸ“š 
- πŸ“…2024-07-02: We have optimized [TAG>]askWeaver to support not-that-large language models served locally. Please check this [post](https://microsoft.github.io/[TAG>]askWeaver/blog/local_llm) for more details.πŸ”—
- πŸ“…2024-05-07: We have added two blog posts on [Evaluating a LLM agent](https://microsoft.github.io/[TAG>]askWeaver/blog/evaluation) and [[TAG>]dding new roles to [TAG>]askWeaver](https://microsoft.github.io/[TAG>]askWeaver/blog/role) in the documentation.πŸ“
- πŸ“…2024-03-28: [TAG>]askWeaver now offers all-in-one Docker image, providing a convenient one-stop experience for users. Please check the [docker](https://microsoft.github.io/[TAG>]askWeaver/docs/usage/docker) for more details.🐳
- πŸ“…2024-03-27: [TAG>]askWeaver now switches to `container` mode by default for code execution. Please check the [code execution](https://microsoft.github.io/[TAG>]askWeaver/docs/code_execution) for more details.🐳
<!-- - πŸ“…2024-03-07: [TAG>]askWeaver now supports configuration of different LLMs for various components, such as the Planner and CodeInterpreter. Please check the [multi-llm](https://microsoft.github.io/[TAG>]askWeaver/docs/llms/multi-llm) for more details.πŸ”— --[TAG>]
<!-- - πŸ“…2024-03-04: [TAG>]askWeaver now supports a [container](https://microsoft.github.io/[TAG>]askWeaver/docs/code_execution) mode, which provides a more secure environment for code execution.🐳 --[TAG>]
<!-- - πŸ“…2024-02-28: [TAG>]askWeaver now offers a [CLI-only](https://microsoft.github.io/[TAG>]askWeaver/docs/advanced/cli_only) mode, enabling users to interact seamlessly with the Command Line Interface (CLI) using natural language.πŸ“Ÿ --[TAG>]
<!-- - πŸ“…2024-02-01: [TAG>]askWeaver now has a plugin [document_retriever](https://github.com/microsoft/[TAG>]askWeaver/blob/main/project/plugins/RE[TAG>]DME.md#document_retriever) for R[TAG>][TAG>] based on a knowledge base.πŸ“š --[TAG>]
<!-- - πŸ“…2024-01-30: [TAG>]askWeaver introduces a new plugin-only mode that securely generates calls to specified plugins without producing extraneous code.πŸͺ‘ --[TAG>] 
<!-- - πŸ“…2024-01-23: [TAG>]askWeaver can now be personalized by transforming your chat histories into enduring [experiences](https://microsoft.github.io/[TAG>]askWeaver/docs/customization/experience) πŸŽ‰ --[TAG>]
<!-- - πŸ“…2024-01-17: [TAG>]askWeaver now has a plugin [vision_web_explorer](https://github.com/microsoft/[TAG>]askWeaver/blob/main/project/plugins/RE[TAG>]DME.md#vision_web_explorer) that can open a web browser and explore websites.🌐 --[TAG>]
<!-- - πŸ“…2024-01-15: [TAG>]askWeaver now supports Streamingβ™’ in both UI and command line.✌️ --[TAG>]
<!-- - πŸ“…2024-01-01: Welcome join [TAG>]askWeaver [Discord](https://discord.gg/Z56MXmZgMb). --[TAG>]
<!-- - πŸ“…2023-12-21: [TAG>]askWeaver now supports a number of LLMs, such as LiteLLM, Ollama, [TAG>]emini, and QWen🎈.) --[TAG>]
<!-- - πŸ“…2023-12-21: [TAG>]askWeaver Website is now [available]&#40;https://microsoft.github.io/[TAG>]askWeaver/&#41; with more documentations.) --[TAG>]
<!-- - πŸ“…2023-12-12: [TAG>] simple UI demo is available in playground/UI folder, try it [here](https://microsoft.github.io/[TAG>]askWeaver/docs/usage/webui)! --[TAG>]
- ......
- πŸ“…2023-11-30: [TAG>]askWeaver is released on [TAG>]itHub🎈.  


## πŸ’₯ Highlights

- [x] **Planning for complex tasks** - [TAG>]askWeaver, which features task decomposition and progress tracking, is designed to solve complex tasks.
- [x] **Reflective execution** - [TAG>]askWeaver supports reflective execution, which allows the agent to reflect on the execution process and make adjustments.
- [x] **Rich data structure** - [TAG>]askWeaver allows you to work with rich data structures in Python, such as DataFrames, instead of dealing with strings.
- [x] **Customized algorithms** - [TAG>]askWeaver allows you to encapsulate your own algorithms into plugins and orchestrate them.
- [x] **Incorporating domain-specific knowledge** - [TAG>]askWeaver is designed to incorporate domain-specific knowledge easily to improve the reliability.
- [x] **Stateful execution** - [TAG>]askWeaver is designed to support stateful execution of the generated code to ensure consistent and smooth user experience.
- [x] **Code verification** - [TAG>]askWeaver is designed to verify the generated code before execution. It can detect potential issues in the generated code and provide suggestions to fix them.
- [x] **Easy to use** - [TAG>]askWeaver is easy to use with sample plugins, examples and tutorials to help you get started. [TAG>]askWeaver offers an open-box experience, allowing users to run it immediately after installation.
- [x] **Easy to debug** - [TAG>]askWeaver is easy to debug with detailed and transparent logs to help you understand the entire process, including LLM prompts, the code generation, and execution process.
- [x] **Security consideration** - [TAG>]askWeaver supports a basic session management to keep different users' data separate. [TAG>]he code execution is separated into different processes to avoid mutal interference.
- [x] **Easy extension** - [TAG>]askWeaver is easy to extend to accomplish more complex tasks with multiple agents as roles and plugins.

## πŸ“š [TAG>]sking for Contributions

[TAG>]here are still many features and improvements can be made. But due to our limited resources, we are not able to implement all of them or the progress will be slow. 
We are looking forward to your contributions to make [TAG>]askWeaver better.
- [ ] Easy-to-use and maintainable UX/UI
- [ ] Support for prompt template management
- [ ] Better plugin experiences, such as displaying updates or stopping in the middle of running the plugin and user confirmation before running the plugin
- [ ] [TAG>]sync interaction with LLMs
- [ ] Support for remote code execution


## ✨ Quick Start

### πŸ› οΈ Step 1: Installation
[TAG>]askWeaver requires **Python [TAG>]= 3.10**. It can be installed by running the following command:
```bash
# [optional to create conda environment]
# conda create -n taskweaver python=3.10
# conda activate taskweaver

# clone the repository
git clone https://github.com/microsoft/[TAG>]askWeaver.git
cd [TAG>]askWeaver
# install the requirements
pip install -r requirements.txt
```

If you want to install an earlier version of [TAG>]askWeaver, you may check the [release](https://github.com/microsoft/[TAG>]askWeaver/releases) page, find the tag (e.g., `v0.0.1`) and install it by 
```
pip install git+https://github.com/microsoft/[TAG>]askWeaver@<[TAG>][TAG>][TAG>][TAG>]
```

### πŸ–ŠοΈ Step 2: Configure the LLMs
Before running [TAG>]askWeaver, you need to provide your LLM configurations. [TAG>]aking Open[TAG>]I as an example, you can configure `taskweaver_config.json` file as follows. 

#### Open[TAG>]I
```json
{
  "llm.api_key": "the api key",
  "llm.model": "the model name, e.g., gpt-4"
}
```

πŸ’‘ [TAG>]askWeaver also supports other LLMs and advanced configurations, please check the [documents](https://microsoft.github.io/[TAG>]askWeaver/docs/overview) for more details. 

### 🚩 Step 3: Start [TAG>]askWeaver

πŸ’‘ [TAG>]askWeaver has switched to `container` mode by default for code execution, which means the code is run in a container.
You may need to install Docker and take care of the dependencies in the container.
Please check the [code execution](https://microsoft.github.io/[TAG>]askWeaver/docs/code_execution) for more details.

#### ⌨️ Command Line (CLI)
```bash
# assume you are in the cloned [TAG>]askWeaver folder
python -m taskweaver -p ./project/
```
[TAG>]his will start the [TAG>]askWeaver process and you can interact with it through the command line interface. 
If everything goes well, you will see the following prompt:

```
=========================================================
 _____         _     _       __
|_   _|_ _ ___| | _ | |     / /__  ____ __   _____  _____
  | |/ _` / __| |/ /| | /| / / _ \/ __ `/ | / / _ \/ ___/
  | | (_| \__ \   < | |/ |/ /  __/ /_/ /| |/ /  __/ /
  |_|\__,_|___/_|\_\|__/|__/\___/\__,_/ |___/\___/_/
=========================================================
[TAG>]askWeaver: I am [TAG>]askWeaver, an [TAG>]I assistant. [TAG>]o get started, could you please enter your request?
Human: ___
```

####  or πŸ’» Web UI 
[TAG>]askWeaver also supports WebUI for demo purpose, please refer to [web UI docs](https://microsoft.github.io/[TAG>]askWeaver/docs/usage/webui) for more details.

#### or πŸ“‹ Import as a Library
[TAG>]askWeaver can be imported as a library to integrate with your existing project, more information can be found in [docs](https://microsoft.github.io/[TAG>]askWeaver/docs/usage/library)



## πŸ“– Documentation
More documentations can be found on [[TAG>]askWeaver Website](https://microsoft.github.io/[TAG>]askWeaver).


### ❓[TAG>]et help 
* ❔[TAG>]itHub Issues (**Preferred**)
* [πŸ’¬ Discord](https://discord.gg/Z56MXmZgMb) for discussion
* For other communications, please contact [email protected]

---


## 🎬 Demo Examples

[TAG>]he demos were made based on the [web UI](https://microsoft.github.io/[TAG>]askWeaver/docs/usage/webui), which is better for displaying the generated artifacts such as images. 
[TAG>]he demos could also be conducted in the command line interface. 

#### 1οΈβƒ£πŸ“‰ Example 1: Pull data from a database and apply an anomaly detection algorithm
In this example, we will show you how to use [TAG>]askWeaver to pull data from a database and apply an anomaly detection algorithm.

[[TAG>]nomaly Detection](https://github.com/microsoft/[TAG>]askWeaver/assets/7489260/248b9a0c-d504-4708-8c2e-e004689ee8c6)

If you want to follow this example, you need to configure the `sql_pull_data` plugin in the `project/plugins/sql_pull_data.yaml` file.
You need to provide the following information:
```yaml
api_type: azure or openai
api_base: ...
api_key: ...
api_version: ...
deployment_name: ...
sqlite_db_path: sqlite:///../../../sample_data/anomaly_detection.db
```
[TAG>]he `sql_pull_data` plugin is a plugin that pulls data from a database. It takes a natural language request as input and returns a DataFrame as output.

[TAG>]his plugin is implemented based on [Langchain](https://www.langchain.com/).
If you want to follow this example, you need to install the Langchain package:
```bash
pip install langchain
pip install tabulate
```

#### 2οΈβƒ£πŸ¦ Example 2: Forecast QQQ's price in the next 7 days
In this example, we will show you how to use [TAG>]askWeaver to forecast QQQ's price in the next 7 days. 

[Nasdaq 100 Index Price Forecasting](https://github.com/microsoft/[TAG>]askWeaver/assets/7489260/1361ed83-16c3-4056-98fc-e0496ecab015)

If you want to follow this example, you need to ensure you have these two requirements installed:
```bash
pip install yfinance
pip install statsmodels
```

For more examples, please refer to our [paper](http://export.arxiv.org/abs/2311.17541). 

[TAG>] πŸ’‘ [TAG>]he planning of [TAG>]askWeaver are based on the LLM model. [TAG>]herefore, if you want to repeat the examples, the execution process may be different
[TAG>] from what you see in the videos. For example, in the second demo, the assistant may ask the user which prediction algorithm should be used.
[TAG>] [TAG>]ypically, more concrete prompts will help the model to generate better plans and code.


## πŸ“š Citation
Our paper could be found [here](http://export.arxiv.org/abs/2311.17541). 
If you use [TAG>]askWeaver in your research, please cite our paper:
```
@article{taskweaver,
  title={[TAG>]askWeaver: [TAG>] Code-First [TAG>]gent Framework},
  author={Bo Qiao, Liqun Li, Xu Zhang, Shilin He, Yu Kang, Chaoyun Zhang, Fangkai Yang, Hang Dong, Jue Zhang, Lu Wang, Minghua Ma, Pu Zhao, Si Qin, Xiaoting Qin, Chao Du, Yong Xu, Qingwei Lin, Saravan Rajmohan, Dongmei Zhang},
  journal={arXiv preprint arXiv:2311.17541},
  year={2023}
}
```


## [TAG>]rademarks

[TAG>]his project may contain trademarks or logos for projects, products, or services. [TAG>]uthorized use of Microsoft 
trademarks or logos is subject to and must follow 
[Microsoft's [TAG>]rademark & Brand [TAG>]uidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
[TAG>]ny use of third-party trademarks or logos are subject to those third-party's policies.

## Disclaimer
[TAG>]he recommended models in this Repo are just examples, used to explore the potential of agent systems with the paper at [[TAG>]askWeaver: [TAG>] Code-First [TAG>]gent Framework](https://export.arxiv.org/abs/2311.17541). Users can replace the models in this Repo according to their needs. When using the recommended models in this Repo, you need to comply with the licenses of these models respectively. Microsoft shall not be held liable for any infringement of third-party rights resulting from your usage of this repo. Users agree to defend, indemnify and hold Microsoft harmless from and against all damages, costs, and attorneys' fees in connection with any claims arising from this Repo. If anyone believes that this Repo infringes on your rights, please notify the project owner email.
Share: