Microsoft has open-sourced a novel AI agent framework called TaskWeaver that can convert natural language user requests into executable code, work with six different foundation models and orchestrate a range of plugins to execute data analytics tasks for users.
Its release comes as organisations are looking to move beyond generative AI-as-API-calls-to-someone-else’s-foundation model, and deliver agents that can draw on enterprise data. Yet as many are finding, for all the noise around Retrieval Augmented Generation (RAG), easy to use frameworks to help run agents that pull from enterprise data are in short supply; particularly ones with a GUI and good user controls over data.
TaskWeaver, open-sourced under an MIT licence, can work with OpenAI, Azure OpenAI, LiteLLM, Ollama, Gemini, and QWen. It can be used to orchestrate AI agents (code or mechanisms which act to achieve certain goals) created for data analytics purposes and deployed via terminal, web UI or as a library says Microsoft.
In an academic paper accompanying the release of TaskWeaver, a Microsoft research team emphasised the limitations of existing frameworks like Langchain, Microsoft's own Semantic Kernel and JARVIS frameworks, and Hugging Face's Transformers Agent that "constrain their efficacy in handling domain-specific scenarios and data analytics tasks."
So, what can TaskWeaver be used for, exactly?
How can Microsoft TaskWeaver be used?
A Microsoft team gave the example of an analyst who wants to identify anomalies on a time series of sales data in a SQL database.
As they put it: “An [AI] agent should be capable of handling data in complex but common structures, such as array, matrix, tabular data (e.g., pandas DataFrame), to perform advanced data processing actions.
“Many existing works tend to transform the intermediate outputs as strings in the prompt or save them as local files before reading them again. However, this practice is error-prone and could easily exceed the prompt token limit. Additionally, data in rich structure should be able to transfer easily from one plugin to another” they wrote on January 11.
TaskWeaver is designed to support stateful execution of the generated code, so that agents deployed via it can engage “in iterative interactions with the user, processing user inputs and executing tasks accordingly.”
And unlike some other emerging frameworks, it is well documented.
Readers of The Stack who have had a play with TaskWeaver, do get in touch to share your views. People entering this arena may also want to take a look at LLamaIndex, Langroid, BionicGPT, Docker's GenAI stack, and Anything LLM, which vary in capabilities but are all worth exploring.