Description
TaskWeaver is an innovative agent framework that operates on a "code-first" principle, enabling seamless planning and execution of data analytics tasks. It interprets user requests through code snippets and efficiently coordinates a variety of plugins, which are essentially functions, to perform data analytics in a stateful manner. A key differentiator of TaskWeaver is its ability to preserve not only the chat history with Large Language Models (LLMs) but also the code execution history, including the in-memory data. This comprehensive history tracking significantly enhances the framework's expressiveness, making it particularly well-suited for processing complex data structures such as high-dimensional tabular data.
The framework is built to handle complex tasks through its inherent capabilities of task decomposition and progress tracking. It supports reflective execution, allowing the agent to review its own execution process and make necessary adjustments. TaskWeaver allows users to work with rich data structures in Python, such as DataFrames, moving beyond simple text-based interactions. Users can also encapsulate their own algorithms into plugins and orchestrate them within the framework. Furthermore, TaskWeaver is designed for easy incorporation of domain-specific knowledge to boost reliability and ensures stateful execution of generated code for a consistent user experience. It includes code verification mechanisms to detect and suggest fixes for potential issues before execution.
TaskWeaver prioritizes ease of use and debugging. It comes with sample plugins, examples, and tutorials to facilitate a quick start, offering an open-box experience that can be run immediately after installation. Detailed and transparent logs are provided to help users understand the entire process, from LLM prompts to code generation and execution. Security considerations include basic session management to isolate user data and separation of code execution into different processes to prevent interference. The framework is also designed for easy extension, supporting multiple agents as roles and plugins for more complex tasks. Contributions are welcomed to further enhance features like UX/UI, prompt template management, and asynchronous LLM interactions.
TaskWeaver's Core Features
Code-first agent framework for data analytics
Seamless planning and execution of tasks
Interprets user requests via code snippets
Orchestrates plugins (functions) for task execution
Preserves chat history and code execution history
Maintains in-memory data for stateful execution
Supports rich data structures like DataFrames
Task decomposition and progress tracking
Reflective execution for process adjustments
Encapsulates custom algorithms into plugins
Incorporates domain-specific knowledge
Code verification before execution
Easy to use with examples and tutorials
Detailed and transparent logging for debugging
Security considerations for data separation and process isolation
Getting Started with TaskWeaver
Installation: Clone the repository and install requirements using pip.
Configuration: Set up LLM configurations, for example, by creating a taskweaver_config.json file.
Execution: Start TaskWeaver via the command line interface or integrate it as a library.
Interaction: Interact with TaskWeaver through the command line or its Web UI.
Development: Extend TaskWeaver by adding new roles and plugins for complex tasks.
TaskWeaver's Use Cases
- Data Analytics Planning
- Code Execution Orchestration
- Stateful Agent Development
- Plugin-based Task Execution
- Complex Data Structure Processing
- Domain-Specific AI Agents
- Algorithm Encapsulation








