This project implements an AI agent designed to autonomously explore and interact with RESTful APIs that follow the HATEOAS (Hypermedia as the Engine of Application State) constraint. The agent leverages hypermedia links provided by the API to discover available actions and resources without prior knowledge of the API structure.
In order to test the agent, we need a HATEOAS compatible API to interact with. You can use i.e. Spring Restbucks.
git clone https://github.com/odrotbohm/spring-restbucks.git
cd spring-restbucks
git reset --hard d215c68534505822f637a328eb7485c246c95041
cd server
mvn clean package
java -jar target/*.jar
After starting Spring Restbucks you can use the HAL-Explorer to add some data (i.e. drinks or orders) if you like. If url of the API is not http://localhost:8080/
, please update the variable ENTRY_POINT
in prompts.py
.
- We use openai-agents library. Therefore you have to set the
OPENAI_API_KEY
environment variable. - For dependency management we use uv.
- Setup project by
uv sync
- Run the agent by
uv run agent.py --prompt "Who are you?"
- Change the value of the command line argument
--prompt
as you like. Below, you find some examples.
- "How many orders are there?"
- "What is the total amount to be paid?"
- "Which drinks do we have available?"
- "Create a new drink called MySpecialDrink! It should cost 50 cent."
- "Update the price of MySpecialDrink. It should cost 2 Euro now!"
- "Delete the MySpecialDrink. We do not sell it anymore!"
Please contact Tim Wüllner or Arne Limburg.