Utility AI development: Moving from general to specific actions

Hi, I’m working on a Utility AI system for my university thesis. I’ve been exploring the topic for a few days, experimenting with some ideas, but I’ve realized that without a clear vision, I’m not making much progress.

Most of the examples I’ve seen focus on general agent actions (like eating, sleeping, or defending), but what if the agent has an inventory with several types of potions, each with different effects? For instance, the “heal” action doesn’t seem sufficient because potions could have side effects, such as also restoring mana.

Let’s say the agent is missing 10 health, and there’s a mana potion that restores 10 health and 50 mana. On one hand, drinking it makes sense because it would fully restore health, but on the other hand, it wastes 50 mana.

My question is: am I approaching this correctly? Do I understand the functionality of Utility AI properly? Right now, it feels like this system is primarily designed for choosing among fairly generalized actions, but my goal is to have it make more specific decisions, such as which potion to use in this situation.

I would like to create something that allows to make concrete decisions, for example EatConsumable.
AI should dynamically generate Actions list, in our case based on Inventory System, pick all items that match definition “Consumable” and calculate Utility based on positive and negative effects, also it should compare item with other items. For instance we have apple (+10 hp) and healing potion (+50 hp), for us it is better to use potion on low health and apple for almost full health, but there is no way without comparation to determine consumable item utility because we don’t know full context

The best approach I can suggest for system like this is


red - apple, orange - orange, purple - pizza, grey - healing potion, x - health amount
But if we make actions depend on each other we can have result

but this case requires a lot of resources (every tick you should rearrange 20 consumables and decide which of them to use)
And it makes me think that simple Eat action do what it should do takes list of consumables and gets the best option

It is not necessary to run the decision-making every tick; instead, you could run it every 0.1 seconds. This saves a lot of performance.