AgentKit: Structured LLM Reasoning with Dynamic Graphs
Yue Wu, Yewen Fan, So Yeon Min, Shrimai Prabhumoye, Stephen McAleer, Yonatan Bisk, Ruslan Salakhutdinov, Yuanzhi Li, Tom Mitchell
TL;DR
AgentKit presents a node-based prompting framework that represents an end-to-end AI agent as a dynamic DAG of natural-language subtasks. Each node encapsulates a subtask with a prompt and dependencies, processed via a Compose step, an LLM query, and an optional After-query, all sharing a central database. The framework supports on-the-fly graph modifications, enabling conditional branching and loops, and leverages topological traversal (Kahn’s algorithm) with safeguards to maintain reliability. Through Crafter and WebShop benchmarks, AgentKit demonstrates state-of-the-art performance and cost-efficient operation, powered by hierarchical planning, short- and long-term reflection, and continuous knowledge integration. The work argues for natural-language based coding of agents, broadening accessibility while preserving sophisticated reasoning capabilities for complex, real-world tasks.
Abstract
We propose an intuitive LLM prompting framework (AgentKit) for multifunctional agents. AgentKit offers a unified framework for explicitly constructing a complex "thought process" from simple natural language prompts. The basic building block in AgentKit is a node, containing a natural language prompt for a specific subtask. The user then puts together chains of nodes, like stacking LEGO pieces. The chains of nodes can be designed to explicitly enforce a naturally structured "thought process". For example, for the task of writing a paper, one may start with the thought process of 1) identify a core message, 2) identify prior research gaps, etc. The nodes in AgentKit can be designed and combined in different ways to implement multiple advanced capabilities including on-the-fly hierarchical planning, reflection, and learning from interactions. In addition, due to the modular nature and the intuitive design to simulate explicit human thought process, a basic agent could be implemented as simple as a list of prompts for the subtasks and therefore could be designed and tuned by someone without any programming experience. Quantitatively, we show that agents designed through AgentKit achieve SOTA performance on WebShop and Crafter. These advances underscore AgentKit's potential in making LLM agents effective and accessible for a wider range of applications. https://github.com/holmeswww/AgentKit
