Uncover the Future: Microsoft Autonomous AI Agents analyzing SAP Data Insights

As a professional in SAP, Data and , intimately involved with the latest developments in Microsoft Research, our focus has been keenly set on the advancements in Generative (GenAI) and Large Language Models (LLMs) such as GPT, Claude, Palm, and Llama. These groundbreaking technologies represent more than mere progress in natural language processing; They embody a paradigm shift in our approach to language generation and comprehension, propelled by the most recent achievements in artificial intelligence. This evolution signifies a transformative step in our interaction with digital language. In the expanding landscape of , we distinguish between two types of digital assistants to get: Copilots and AI Agents, each playing a unique role in how we harness AI.

To start with, let's understand the distinction between AI Copilot and AI Autonomous Agents”, before we explore the Microsoft Groundbreaking AI Frameworks that support SAP ERP, BW Applications like SAP ECC, SAP BW, SAP S/4HANA & Microsoft Dynamics 365.

AI Copilots: Your Helper
Copilots are like navigators, offering real-time support to enhance user decision-making and productivity without overstepping into the realm of action. They're silent whisperers of data, providing insights and answers upon request, perfect for scenarios where autonomy isn't necessary or desired. To put it simply, Copilots are software add-ons that offer instant assistance to users of application functions. GitHub Copilot and Microsoft 365 Copilots are some examples. Let's envision an intelligent SAP Copilot in an SAP S/4HANA or ECC system might show important inventory data to help with procurement decisions without ordering anything itself, provide comprehensive views to assist business users making a smart call without navigating through different SAP screens to get the numbers. Similarly, Microsoft's Copilot draws upon data from the SAP ERP system to deliver predictive analytics and trends, equipping business decision makers with the information they need to make smart, proactive decisions while preserving the human touch in final strategic determinations.

AI Autonomous Agents: Your Doer
In the field of AI, Agents are autonomous doers/workers, capable of independently carrying out tasks that align with predefined goals and parameters. They're the behind-the-scenes workhorses, streamlining workflows by taking on tasks such as auto-generating reports or proactively managing calendars based on learned user preferences. In the domain of Microsoft Dynamics, an AI Agent might not only flag a high-priority customer interaction but also draft a follow-up email, pending the user's final approval. Additionally, it can retrieve multiple SAP business tables for immediate analysis and create a dynamic report for business decision makers to examine. In the world of smart enterprises, the distinction between Copilots and Agents is based on how they assist business and technical users. Copilots, like helpers within your software, might do things like giving you a summary of your meeting in Microsoft 365. They're there to guide you, not to take over. Think of them as helpful chatbot in your program. However, AI Agents are different because they do things on their own, like making decisions and completing tasks with just a little bit of help from us.


In conclusion, enterprises running SAP on Azure can greatly benefit from the tailored support of AI Copilots and AI Agents. These advanced AI assistants play a crucial role in guiding enterprises through key decisions and strategies. Moreover, these Agents and Copilots have different ways of working because of the type of model engineering that is involved in answering a given prompt. Agents and Copilots differ in the training data that they use to model the LLM. Copilots usually have data from a specific domain that is relevant to the user. So, when GitHub Copilot makes a suggestion, it does so based on its knowledge of repositories. AI Agents usually have a wider range of resources that they use to form their conclusions and suggestions.

Let's dive deeper and explore how we can harness the power of two Microsoft's sophisticated AI frameworks to create autonomous AI agents specifically designed for analyzing complex data on SAP S/4HANA and ECC platforms in real-time scenario with practical examples. To provide some background, Microsoft research team recently released two innovative AI papers related to these sophisticated AI frameworks that have generated considerable buzz in the tech community, showcasing the commitment to pushing the boundaries of AI technology –

1. TaskWeaver: A Code-First Agent Framework, two sophisticated frameworks that are redefining the capabilities of AI in diverse scenarios and
2. AutoGen blogpost: Enabling Next-Gen LLM Applications via Multi-Agent Conversation.

TaskWeaver: Empowering LLMs with Enhanced Capabilities

taskweaver green.png

As we know, Large Language Models (LLMs) have demonstrated remarkable skills in natural language understanding and generation, leading to their use in applications such as chatbots and virtual assistants. However, current LLM frameworks have limitations in dealing with domain-specific data analytics tasks with rich data structures. Furthermore, they have difficulty with flexibility to satisfy diverse user demands. To tackle these challenges, TaskWeaver is introduced as a code-first framework for building LLM-powered autonomous agents. It translates user requests into executable code and treats user-defined plugins as callable functions. TaskWeaver supports rich data structures, flexible plugin usage, dynamic plugin selection, and harnesses LLM coding capabilities for complex logic. It also incorporates domain-specific knowledge through examples and ensures the secure execution of generated code. TaskWeaver offers a strong and flexible framework for creating smart conversational agents that can handle complex tasks and adapt to domain-specific situations. TaskWeaver's capacity to handle domain-specific data analytics tasks, default plugins and its support for rich data structures make it a distinguished framework in the field of AI. Its customizable plugins enable developers to adjust the framework to their specific needs, providing a level of refinement and efficiency that distinguishes it from other AI frameworks. By leveraging the power of LLMs and enabling developers to adapt the framework to different industries, TaskWeaver is ready to lead the way in transforming how we exploit the potential of AI, we'll explore with an example in a moment.

Framework Components

TaskWeaver consists of several key components that work in tandem to provide a seamless workflow:

  1. Planner Agent: Acts as the master strategist, orchestrating the workflow by creating a comprehensive list of tasks based on user requests.
  1. Code Generator: Translates the Planner Agent's instructions into Python code, leveraging TaskWeaver's plugins to perform specific functions.
  1. Code Interpreter/Executor: Executes the generated code and reports results back to the user.

This workflow demonstrates TaskWeaver's efficiency in using AI to handle tasks from planning to execution, transforming complex requests into actionable insights.


TaskWeaver Features and Capabilities –

TaskWeaver stands out with its advanced capabilities that cater to a wide range of applications:

  • Integration with Large Language Models: TaskWeaver is compatible with LLMs, which are the backbone of the framework, enabling the creation of autonomous agents that can navigate through intricate logic and specialized knowledge domains.
  • Customizable Plugins: Users can create custom Python function-based plugins to execute domain-specific tasks, interact with external data sources, or perform specialized analytics.
  • Secure Execution: Microsoft ensures the secure execution of code within TaskWeaver, allowing developers to focus on their work without concern for security vulnerabilities.
  • User-Friendly Interface: Designed to prevent developers from getting bogged down in complicated processes, TaskWeaver offers a smooth user experience.
  • TaskWeaver's ability to integrate with large language models (LLMs) and its customizable plugins sets it apart from other AI frameworks. By leveraging the power of LLMs and allowing developers to tailor the framework to their specific needs, TaskWeaver offers a level of sophistication and efficiency that is unmatched in the field.
  • As AI continues to advance, TaskWeaver is well-positioned to lead the way in reshaping how we harness the potential of AI in various industries.

Microsoft TaskWeaver is a framework that lets developers build and manage tasks across different platforms and applications. Frameworks such as Langchain, Semantic Kernel, Transformers Agent, Agents, AutoGen and JARVIS, which use LLMs for task-oriented conversations, are crucial in this transformation. They allow easy, natural language interactions with AI systems, making complex data analytics and domain-specific tasks more available. However, the real challenge and opportunity are in improving these frameworks to overcome current limitations, especially in specialized areas like SAP and data analytics. This involves adding domain-specific knowledge into GenAI models, improving their ability to process and analyze industry-specific data and workflows. There are many examples of how TaskWeaver can handle different tasks effectively. For example, developers can build smart agents that communicate with users fluently and helpfully, improving user satisfaction through clever conversation. TaskWeaver's skill to understand user needs, control plugins, and run code safely makes it a very useful tool for various applications, from financial prediction to data exploration.

connect TaskWeaver with SAP S/4HANA for Data Insights?

To demonstrate the TaskWeaver approach, and to learn more about how TaskWeaver works in this situation, let's examine the specific requirements for using it with SAP S/4HANA workload on Azure and HANA DB plugin creation for data analysis and insights. This example presents common actions in a data analysis task, which include getting data, analyzing the data, and displaying the results. By reviewing the steps in this use case, we can identify the main requirements that this example demands:

Rationale and Prerequisites for TaskWeaver, SAP S/4HANA and HANA DB Plugin:

  • Using Custom HANA Plugins: TaskWeaver should support custom plugins for doing things like getting data from SAP S/4HANA product and sales or custom tables, using specific SAP data extraction algorithms, and making the connection plugin with the ‘hdbcli' python package deployment.
  • Handling Complex Data Structures: It must handle complex data formats, like pandas DataFrame, for advanced data processing and facilitate easy data transfer between plugins.
  • Stateful Execution: TaskWeaver should maintain state across conversations, processing user inputs and executing tasks in an iterative manner throughout the session.
  • Data Schema Inspection and Action: Prior to executing tasks, TaskWeaver needs to inspect the data schema in the database and use this information for actions before analyzing the SAP product and sales data.
  • Natural Language Responses: The system should provide user-friendly responses in natural language, summarizing execution results, such as the amount of sales order per product details.
  • Dynamic Code Generation: TaskWeaver must generate code on-the-fly to meet ad-hoc user requests, including tasks not covered by existing plugins, like visualizing SAP data related to Sales and product tables.
  • Incorporating Domain Knowledge: The framework should integrate domain-specific knowledge to enhance LLM's planning and tool usage, ensuring accurate and reliable results in complex domains.
  • Persisting Results: It should offer a mechanism to save outcomes, such as DataFrames or images, to persistent , with options for business users to download these artifacts.

Installation and Setup

Getting started with TaskWeaver AI Agent and SAP HANA DB Plugin setup, it involves cloning the repository from GitHub and setting up a virtual environment to ensure smooth operation. AI Developers can then install the necessary requirements and begin leveraging TaskWeaver's advanced AI functionalities.

1. Assuming SAP S/4HANA or SAP Suite on HANA(SoH) is operational.

2. Follow below link for instructions to set up TaskWeaver on your local environment for testing.
TaskWeaver-SAP-AI-AGENT· amitlals/TaskWeaver-SAP-AI-AGENT

Example prompt –>

 _____         _     _       __

|_   _|_ _ ___| | _ | |     / /__  ____ __   _____  _____

  | |/ _` / __| |/ /| | /| / / _ / __ `/ | / / _ / ___/

  |_|__,_|___/_|_|__/|__/___/__,_/ |___/___/_/


TaskWeaver: I am TaskWeaver, an AI assistant. To get started, could you please enter your request?

Human: ___Fetch Product HT-1001 and related sales orders, and visualize in pie chart

Conclusion –

2024: A Year of New Opportunities and AI Agents.
It's 2024, and the AI field is buzzing with excitement, particularly about autonomous AI Agent technology and its advancement as AI Agents as a Service (AIAaaS). Following the success of LLM apps in 2022 & 2023, AI Agents are poised to take over this year. Right now, many of these agents are still like new gadgets – fun for experimentation but not yet widely adopted in everyday life. However, the foundation is being laid, and we're about to see these AI agents evolve from novelty concepts to practical, real-world solutions.

AI agents have the power to shape our future in amazing ways. The speed of technological progress is remarkable, and the possibilities for AI agents to change the way we work and live are huge. They can make our tasks easier, boost creativity, and improve efficiency, all with little effort. This change will surely reshape the business world, giving us a chance to grow with these innovative technologies. As we move towards this AI-led future, it will be an exciting adventure full of new findings and inventions.

For any feedback or issues related to this blog, please feel free to reach out to Amit Lal

Reference –



….Up next: Explore the synergy of AutoGen Framework with SAP platforms in our upcoming post. Stay tuned for more!

Amit Lal

Disclaimer: The announcement of the Microsoft AI Framework is intended for informational purposes only. Microsoft reserves the right to make adjustments or changes to the product, its features, availability, and pricing at any time without prior notice. This blog does not constitute a legally binding offer or guarantee of specific functionalities or performance characteristics. Please refer to the official product documentation and agreements for detailed information about the product and its use. Microsoft is deeply committed to the responsible use of AI technologies. It is recommended to review and comply with all applicable laws, regulations, and organizational policies to ensure the responsible and ethical use of AI.



This article was originally published by Microsoft's Azure AI Services Blog. You can find the original article here.