Graph-Guided API Sequencing with Reinforcement Learning
Abstract
API sequencing involves the selection and execution of APIs, which can include REST APIs or function signatures, to achieve specific goals. Recent efforts have explored generating these sequences of API calls using Large Language Models in response to natural language utterances. In this work, we present a novel approach to API sequencing using Reinforcement Learning to determine the next API to add to an evolving sequence. Our approach leverages an API Graph that represents API endpoints as nodes and all possible call sequences as edges, allowing the RL agent to navigate and choose the next API based on the current sequence state. The agent repeats this process until a decision maker determines that no further additions are required or that the problem has become intractable. Our graph-based RL framework is designed to automate complex multi-step tasks through API sequencing.