# microsoft/taskweaver

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/microsoft-taskweaver).**

6,115 stars · 762 forks · Python · mit · archived

## Links

- GitHub: https://github.com/microsoft/TaskWeaver
- Homepage: https://microsoft.github.io/TaskWeaver/
- awesome-repositories: https://awesome-repositories.com/repository/microsoft-taskweaver.md

## Topics

`agent` `ai-agents` `code-interpreter` `copilot` `data-analysis` `llm` `openai`

## Description

TaskWeaver is an LLM agent framework that interprets natural language requests and executes them as Python code, SQL queries, or shell commands. It functions as a conversational code interpreter that maintains stateful data structures across turns, generating executable code from user prompts within a session-based environment. The system is designed as a self-hosted AI agent platform that can be deployed in Docker, managing sessions and providing a web UI for data analytics and automation tasks.

The framework distinguishes itself through a role-based multi-agent architecture that divides the system into specialized roles like Planner and Code Interpreter, which collaborate through structured message passing to complete complex tasks. It operates as a multi-model LLM gateway, connecting to OpenAI, Azure, Gemini, Ollama, and other LLM APIs for flexible model selection per task, with the ability to route requests to different models per component. TaskWeaver extends agent capabilities through plugin-based extensibility, wrapping custom algorithms as reusable plugins that the agent can call during code generation and execution, while using embedding-based plugin selection to load the most relevant plugins for each request.

The system supports code-driven data analytics by generating and executing Python code for data manipulation, analysis, and visualization tasks, with session-based state management that preserves context and data structures across multiple interaction rounds. It includes a code-generation-and-execution pipeline that runs in a sandboxed environment, with pre-execution code verification that inspects code for potential issues and provides fix suggestions before running it. The platform offers containerized deployment through Docker, packaging the agent and its dependencies for isolated, reproducible execution with host filesystem access and web-based interaction.

TaskWeaver provides a web-based chat interface and command-line interaction, with chat history compression that summarizes older conversation rounds to manage context window limits. It streams planning and execution events to an external dashboard for real-time observability of agent behavior and performance. The system is configured through a single JSON project file and supports custom role definition, domain-specific knowledge incorporation, and per-component LLM assignment.

## Tags

### Artificial Intelligence & ML

- [Containerized Deployments](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-deployment/containerized-deployments.md) — Running an AI agent with all dependencies inside a Docker container for isolated, reproducible execution and web-based interaction.
- [Agent Plugin Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-plugin-frameworks.md) — Extending an AI agent's capabilities by wrapping custom algorithms as reusable plugins that the agent can call during task execution.
- [Role-Based Agent Orchestration](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/integration-deployment/agent-frameworks/agent-orchestrators/role-based-agent-orchestration.md) — Coordinates multiple agents by assigning specific roles like Planner and Code Interpreter to complete complex tasks.
- [AI Code Interpreters](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-code-interpreters.md) — Provides an interactive environment where an LLM generates and executes Python code for data analysis tasks.
- [Code Execution Agents](https://awesome-repositories.com/f/artificial-intelligence-ml/code-execution-agents.md) — Ships an agent framework that interprets natural language and executes Python, SQL, or shell commands.
- [Conversational Session Management](https://awesome-repositories.com/f/artificial-intelligence-ml/conversational-session-management.md) — Starts or retrieves a session that holds the ongoing conversation with the application. ([source](https://microsoft.github.io/TaskWeaver/docs/concepts/app))
- [LLM API Connectors](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-api-connectors.md) — Provides utilities for connecting to any custom large language model API for agent interpretation. ([source](https://microsoft.github.io/TaskWeaver/docs/llms))
- [LLM Gateways](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-gateways.md) — Connects to multiple LLM providers including OpenAI, Azure, Gemini, and Ollama through a unified interface.
- [Per-Component LLM Routings](https://awesome-repositories.com/f/artificial-intelligence-ml/multi-agent-orchestrators/per-component-llm-routings.md) — Routing tasks to different large language models and managing conversations across multiple specialized AI components.
- [OpenAI API Clients](https://awesome-repositories.com/f/artificial-intelligence-ml/openai-api-clients.md) — Implements the OpenAI API specification to send prompts and receive model responses for agent execution. ([source](https://microsoft.github.io/TaskWeaver/docs/llms))
- [Self-Hosted AI Platforms](https://awesome-repositories.com/f/artificial-intelligence-ml/self-hosted-ai-platforms.md) — Provides a deployable Docker-based platform with session management and a web UI for data analytics.
- [Conversational State Preservation](https://awesome-repositories.com/f/artificial-intelligence-ml/workflow-as-a-tool-exposure/durable-multi-step-orchestrators/conversational-state-preservation.md) — TaskWeaver preserves context and data between code generation rounds, ensuring a consistent multi-step user experience. ([source](https://cdn.jsdelivr.net/gh/microsoft/taskweaver@main/README.md))
- [Agent Configurations](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/agent-orchestration-multi-agent/autonomous-agents/agent-configurations.md) — Adjusts parameters that control how the agent interprets requests and executes tasks. ([source](https://microsoft.github.io/TaskWeaver/docs/advanced))
- [Conversation State Persistence](https://awesome-repositories.com/f/artificial-intelligence-ml/conversation-state-persistence.md) — Keeps values accessible to all roles for the entire conversation or just the current round. ([source](https://microsoft.github.io/TaskWeaver/docs/memory))
- [Gemini Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/gemini-integrations.md) — Includes a specific integration for Google's Gemini model to interpret and execute user requests. ([source](https://microsoft.github.io/TaskWeaver/docs/llms))
- [LiteLLM Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/litellm-integrations.md) — Includes a specific integration for the LiteLLM proxy to connect to various models. ([source](https://microsoft.github.io/TaskWeaver/docs/llms))
- [Local Model Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/local-model-integrations.md) — Provides a connector for locally-hosted Ollama models to interpret and execute user requests. ([source](https://microsoft.github.io/TaskWeaver/docs/llms))
- [Time Series Forecasting](https://awesome-repositories.com/f/artificial-intelligence-ml/time-series-forecasting.md) — TaskWeaver applies statistical models to historical data to predict future values over a specified horizon. ([source](https://cdn.jsdelivr.net/gh/microsoft/taskweaver@main/README.md))
- [Azure OpenAI Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/vector-embeddings/openai-model-integrations/azure-openai-integrations.md) — Provides a connector for Azure-hosted OpenAI models to interpret and execute user requests. ([source](https://microsoft.github.io/TaskWeaver/docs/llms))

### Part of an Awesome List

- [Per-Component LLM Routing](https://awesome-repositories.com/f/awesome-lists/ai/specialized-rag-agents/conversational-task-routing/per-component-llm-routing.md) — Assigns different large language models to different agent components for specialized task execution. ([source](https://microsoft.github.io/TaskWeaver/docs/llms))
- [Application Frameworks](https://awesome-repositories.com/f/awesome-lists/ai/application-frameworks.md) — Code-first agent framework for data analytics tasks.

### Data & Databases

- [Data Analytics Engines](https://awesome-repositories.com/f/data-databases/data-analysis-visualization/analytical-platforms-engines/data-analytics-engines.md) — Interprets natural language requests as executable code snippets to perform complex data analytics tasks. ([source](https://microsoft.github.io/TaskWeaver))
- [Natural Language Code Generators](https://awesome-repositories.com/f/data-databases/query-execution-engines/natural-language-code-generators.md) — Transforms plain text instructions into executable Python code for data analytics and automation tasks.
- [Data Analytics Code Generators](https://awesome-repositories.com/f/data-databases/query-execution-engines/natural-language-code-generators/data-analytics-code-generators.md) — Using natural language to generate and execute Python code for data manipulation, analysis, and visualization tasks.
- [Session State Management](https://awesome-repositories.com/f/data-databases/session-state-management.md) — Maintains conversation context, data structures, and control state across multiple interaction rounds.
- [Session-Persistent DataFrames](https://awesome-repositories.com/f/data-databases/structured-data-management/session-persistent-dataframes.md) — TaskWeaver maintains rich data structures like pandas DataFrames across conversation turns for iterative analysis. ([source](https://microsoft.github.io/TaskWeaver))
- [Natural Language to DataFrame Queries](https://awesome-repositories.com/f/data-databases/data-visualization-charts/natural-language-querying/natural-language-to-sql/natural-language-to-dataframe-queries.md) — Connects to databases and retrieves data as DataFrames using plain-language requests. ([source](https://cdn.jsdelivr.net/gh/microsoft/taskweaver@main/README.md))

### Development Tools & Productivity

- [Natural Language Command Interpreters](https://awesome-repositories.com/f/development-tools-productivity/cli-command-interpreters/natural-language-command-interpreters.md) — Translating plain-language requests into executable system commands or database queries for automation and data retrieval. ([source](https://microsoft.github.io/TaskWeaver/docs/advanced/cli_only))
- [LLM Component Assignments](https://awesome-repositories.com/f/development-tools-productivity/component-configuration/llm-component-assignments.md) — Routes requests from each system component to a separately configured language model, overriding the default primary model. ([source](https://microsoft.github.io/TaskWeaver/docs/llms/multi-llm))
- [LLM Plugin Orchestrators](https://awesome-repositories.com/f/development-tools-productivity/plugin-orchestration/llm-plugin-orchestrators.md) — Routes tasks to different LLMs and wraps custom algorithms as reusable plugins for agent execution.
- [Algorithm Plugin Wrappers](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/shell-plugin-systems/custom-plugin-management/algorithm-plugin-wrappers.md) — Wraps user-defined algorithms into reusable plugins that the agent can orchestrate during task execution. ([source](https://cdn.jsdelivr.net/gh/microsoft/taskweaver@main/README.md))
- [Pre-Execution Code Inspectors](https://awesome-repositories.com/f/development-tools-productivity/automated-code-fix-suggestions/pre-execution-code-inspectors.md) — Inspects code for potential issues and provides fix suggestions before running it, improving reliability. ([source](https://cdn.jsdelivr.net/gh/microsoft/taskweaver@main/README.md))
- [Interactive Command Line Interfaces](https://awesome-repositories.com/f/development-tools-productivity/command-line-interfaces/advanced-execution-environments/interactive-command-line-interfaces.md) — Runs a terminal interface where users type natural language requests and receive responses. ([source](https://microsoft.github.io/TaskWeaver/docs/usage))
- [Context Compression](https://awesome-repositories.com/f/development-tools-productivity/developer-utilities-libraries/workflow-productivity-enhancers/developer-productivity-utilities/developer-utilities/file-resource-management/file-compression-utilities/token-aware-log-compression/context-compression.md) — Compresses older conversation rounds into summaries to prevent overflowing the LLM context window. ([source](https://microsoft.github.io/TaskWeaver/docs/advanced/compression))
- [Python Library Integrations](https://awesome-repositories.com/f/development-tools-productivity/python-library-integrations.md) — Provides core agent logic as a Python module for use in custom automation scripts. ([source](https://microsoft.github.io/TaskWeaver/docs/usage))
- [Plugin Relevance Selectors](https://awesome-repositories.com/f/development-tools-productivity/search-ranking-algorithms/ai-based-relevance-ranking/plugin-relevance-selectors.md) — Selects the most relevant plugins for a user request by comparing embedding vectors and loading top matches. ([source](https://microsoft.github.io/TaskWeaver/docs/advanced/plugin_selection))

### DevOps & Infrastructure

- [Containerized Deployments](https://awesome-repositories.com/f/devops-infrastructure/containerized-deployments.md) — Packages the agent and its dependencies into Docker containers for isolated, reproducible execution.
- [Ad-Hoc Query Handling](https://awesome-repositories.com/f/devops-infrastructure/release-automation/plugin-extensibility/ad-hoc-query-handling.md) — TaskWeaver integrates custom plugins to add new capabilities while still handling ad-hoc user queries. ([source](https://microsoft.github.io/TaskWeaver))
- [Docker Container Execution](https://awesome-repositories.com/f/devops-infrastructure/container-orchestration/container-runtimes/runtime-configuration-interfaces/docker-socket-orchestrators/docker-target-configurators/docker-container-deployments/docker-container-execution.md) — TaskWeaver pulls and starts a pre-built container that bundles the planner and code interpreter for code generation and execution tasks. ([source](https://microsoft.github.io/TaskWeaver/docs/usage/docker))

### Software Engineering & Architecture

- [Plugin Extenders](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/developer-authoring-interfaces/custom-module-implementations/module-functionality-extenders/plugin-extenders.md) — Loads custom external Python functions at runtime to augment core agent capabilities.
- [User-Defined Plugin Bundles](https://awesome-repositories.com/f/software-engineering-architecture/plugin-architectures/programmatic-plugin-loading/user-defined-plugin-bundles.md) — TaskWeaver loads a collection of user-defined functions into the conversation so the code interpreter can call them during task execution. ([source](https://microsoft.github.io/TaskWeaver/docs/concepts/plugin))
- [Domain-Specific](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/domain-specific.md) — Customizes the agent with plugins and examples tailored to particular business or scientific domains. ([source](https://microsoft.github.io/TaskWeaver))
- [Restricted Plugin Executors](https://awesome-repositories.com/f/software-engineering-architecture/plugin-execution-engines/restricted-plugin-executors.md) — Limits generated code to only invoke registered plugins, blocking free-form code for safer task execution. ([source](https://microsoft.github.io/TaskWeaver/docs/plugin/plugin_only))
- [Embedding-Based Plugin Selectors](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/plugin-module-systems/modular-plugin-architectures/plugin-based-architectures/plugin-based-architectures/embedding-based-plugin-selectors.md) — Selects relevant plugins for a user request by comparing embedding vectors and loading the top matches.

### Web Development

- [Provider-Agnostic LLM Routing](https://awesome-repositories.com/f/web-development/provider-agnostic-llm-routing.md) — Routes requests to different LLM endpoints regardless of the specific provider API.
- [Chat Interfaces](https://awesome-repositories.com/f/web-development/web-based-ui-deployment/chat-interfaces.md) — Ships a web-based chat interface that accepts natural language requests and returns code-driven responses. ([source](https://microsoft.github.io/TaskWeaver/docs/usage/webui))
- [JSON-Driven Configurations](https://awesome-repositories.com/f/web-development/single-page-applications/single-file-distributions/json-driven-configurations.md) — Loads all system settings from a single JSON configuration file to define the project's behavior. ([source](https://microsoft.github.io/TaskWeaver/docs/advanced))
- [Containerized Web Interfaces](https://awesome-repositories.com/f/web-development/web-based-ui-deployment/containerized-web-interfaces.md) — TaskWeaver starts the container in UI mode and opens a browser interface at a local port for interactive use. ([source](https://microsoft.github.io/TaskWeaver/docs/usage/docker))

### Security & Cryptography

- [Assistant Role Definitions](https://awesome-repositories.com/f/security-cryptography/identity-access-management/access-control/identity-role-management/assistant-role-definitions.md) — Creates new conversational participants by inheriting the Role class and implementing a reply method. ([source](https://microsoft.github.io/TaskWeaver/docs/concepts/role))
- [Shared Memory Stores](https://awesome-repositories.com/f/security-cryptography/identity-access-management/access-control/identity-role-management/assistant-role-definitions/role-translation/shared-memory-stores.md) — Stores data in a shared memory area that any role can read, so roles do not need to repeat information. ([source](https://microsoft.github.io/TaskWeaver/docs/memory))

### System Administration & Monitoring

- [Agent Observability](https://awesome-repositories.com/f/system-administration-monitoring/agent-observability.md) — Streams planning and execution events to an external dashboard for real-time observability of agent behavior. ([source](https://microsoft.github.io/TaskWeaver/docs/observability))
