As enterprises build increasingly complex AI agents, a major challenge has emerged: managing and selecting from vast libraries of tools. Researchers from Alibaba have introduced SkillWeaver, a new framework designed to solve this problem by intelligently planning multi-step tasks, resulting in a dramatic accuracy boost and a token reduction of over 99%.
Quick Facts
- New framework named SkillWeaver.
- Reduces token consumption by over 99%.
- Improves task accuracy with a novel feedback loop.
The Enterprise AI Bottleneck
Modern AI agents rely on “skills”—modular tools that perform specific functions. When an agent has access to hundreds or thousands of these skills, routing a user’s request to the correct sequence of tools becomes a significant hurdle. The common approach of feeding the entire tool library into a Large Language Model’s (LLM) context window is highly inefficient, expensive, and often leads to confusion and incorrect tool selection.
This issue is especially prominent in business environments where a single request like “Download the dataset, transform it, and create visual reports” requires a chain of different tools—an API client, a data processor, and a visualization tool—to work together seamlessly.
How SkillWeaver Orchestrates AI Tools
SkillWeaver addresses this challenge by framing it as a “compositional skill routing” problem. Instead of trying to pick a tool in one shot, it uses a three-stage process:
- Decompose: An LLM first breaks the user’s complex query into a sequence of smaller, atomic sub-tasks.
- Retrieve: For each sub-task, an embedding model searches the skill library and pulls a shortlist of the most relevant candidate tools.
- Compose: A planner evaluates the shortlisted candidates, checks for compatibility between them, and assembles the final execution plan as a Directed Acyclic Graph (DAG), which maps out dependencies and allows for parallel execution where possible.
For the business report request, the system would first identify the sub-tasks (download, transform, visualize). It would then find potential tools for each step (e.g., “api-client” for downloading, “csv-parser” for transforming) before selecting the most compatible combination to create the final workflow.
The SAD Loop: A Smarter Approach to Planning
A core innovation within SkillWeaver is a technique called Iterative Skill-Aware Decomposition (SAD). LLMs often generate generic descriptions for sub-tasks that don’t match the specific technical vocabulary of the available tools. SAD solves this with a clever feedback loop.
The LLM drafts an initial plan, the system retrieves loosely matching skills, and then feeds those skill descriptions back to the LLM as “hints.” This allows the model to rewrite its plan, aligning the language and granularity of the sub-tasks with the actual tools that exist in the library. This simple loop was found to be the biggest driver of accuracy improvements.
Putting SkillWeaver to the Test
Researchers tested SkillWeaver on a custom benchmark of 300 multi-step queries using a library of over 2,200 real-world skills. The results were striking. The SAD feedback loop boosted the accuracy of a 7-billion parameter model from 51% to nearly 68%.
Interestingly, the study found that larger models could perform worse without guidance, as they tended to over-decompose tasks. The SAD hints helped anchor even large models, improving their performance.
The most significant takeaway was the cost savings. A naive approach of feeding all tools into a large model’s prompt consumed an estimated 884,000 tokens per query and achieved only 21.1% accuracy. SkillWeaver accomplished the same tasks with far greater accuracy while using only around 1,160 tokens—a 99.9% reduction.
Relevance for the MENA Tech Ecosystem
For the rapidly growing MENA tech scene, frameworks like SkillWeaver offer a direct path to building more powerful and cost-effective AI applications. Startups in the UAE, Saudi Arabia, and Egypt are increasingly integrating AI into their platforms, from fintech and e-commerce to logistics and enterprise SaaS.
The ability to orchestrate complex workflows without incurring massive API costs is a game-changer. It lowers the barrier to entry for developing sophisticated AI agents, allowing MENA-based developers and companies to create more competitive products. As regional enterprises continue their digital transformation journeys, technologies that improve AI efficiency and reduce operational expenses will be critical for scaling innovation.
About Alibaba Group
Alibaba Group’s mission is to make it easy to do business anywhere. The company aims to build the future infrastructure of commerce. It envisions that its customers will meet, work and live at Alibaba, and that it will be a good company that lasts for 102 years.
Source: VentureBeat


