Agentic AI -strange issue

Hello,

I am encountering a strange issue on the Agentic AI prototype I am building.
The objective of it is to return available flights between 2 cities the user inputs,
but using a Tool that retrieves the flights from a database I set up for this.

Apparently it works, the tools get called correctlly, but the flights the Agent Prompter node do NOT correspond to the flights from my database. I have no clue where the node (or more likely the model gets them from).
The Data Outputs table that the Agent Prompter returns DOES show the correct flights.
At the bottom of the attached webpage you can see what I mean.

Can anyone give me a clue ??
The Model I am using is gpt-4.1-mini

Hi Marc,

Happy to see that you’ve been playing around with the new agentic framework! If I understood correctly: the tool retrieves the data from your database, you can see the data in the output of the Agent Prompter node, but somehow the model replies with a different information. Is that correct?

If that’s the case, it might be that there is some confusion regarding the two layers of interactions in the agentic framework. Let me try to summarize

  • Communication layer
    • Usage: handle messaging between agent and tools
    • Nodes: Configuration nodes and Tool message output node
    • Behavior: information in this layer is part of the conversation and is processed by the LLM
  • Data layer
    • Usage: moves data between tools
    • Nodes: Workflow Input and Workflow Output nodes
    • Behavior: information in this layes is not fully part of the conversation and is not processed by the LLM. More specifically, the LLM can see the table specs of the tables in this layer, but not the actual content inside them.

In your example, the information that you are looking for (the list of flights) lives in the data layer. That’s because it is produced by a tool and output via a Workflow Output node. The LLM replying to you at the end can see that there’s a table with the list of flights, can see its table specs, but can’t actually see what’s inside it! Therefore, it probably just makes some information up.

The key point here is that the LLM behind the agent can only formulate a response based on the information that is included in the conversation (i.e. the information living in the communication layer and the table specs of the data layer).

If you want your agent to be able to use that data table in a response, you have different options, for example by enhancing the tool that retrieves the list of flights so that it also outputs a summary of the available flights via the Tool Message Output node. That summary will then be part of the communication layer, allowing the agent to use it in its response.

I hope that answers your question! It’s indeed a new and complex topic!
For reference, here is the link to the guide explaining the two layers:
https://docs.knime.com/latest/analytics_platform_ai_extension_guide/index.html#_how_to_create_tools

6 Likes

Thanks a lot Emilio. I will try this out asap

Sounds like a beautiful hallucination in the absence of getting the results into the message history (via Tool Message Output Node as Emilio explained).

Hint: I initially spent a lot of time “crafting” a nice message to the agent… until I realised that the agent receiving the output from Tool Message Output uses that information for its final response…

Since then I have become a little “lazier” and typically turn any table-based information into a JSON object via Table to JSON node and pass that to Tool Message Output… more than good enough for the agent in most cases :slight_smile:

3 Likes

Thanks a lot Martin!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.