It seems the Agents in KNIME do have a problem when accessing tables or databases from tools that try to access ‘external’ data like tables or (local) databases.
In this example (the original is by @MartinDDDD ) an AgentPropter tries to use a local LLM via Ollama to access information from a set of tools that provide details about products (just dummy data).
The underlying tool tries to access a local H2 SQL database and retrieve the information. But it seems the agents are being refused the use of local/relative sources. Is there a way to set this up since it would be really useful to be able to work with databases - also with local LLMs.
I had a quick look at the tool - where is the DB you connect to living? Inside the tool workflow data area?
If not: That may be the cause - I think it does not work to access data sources using workflow relative paths…
To Debug: Maybe use Agent Chat Widget and switch on Debug mode. Then you get a meta node to appear on the canvas and inside that you can see all the tools as they were executed…
It is in the /data/ folder so that several tools can share a database. You think it should work if it is within the /data/ folder of the workflow-tool itself? I might give this a try. But then the tools could no easily share a database.
How could one organize the access to external information for an agent? Any ideas?
Correct - I have tried different ways, but was not able to get “relative to workflow” path references to work. I think I have seen a topic where maybe mountpount relative can work:
Hi @mlauber71, in principle, mountpoint-relative path should work - like suggested by Keerthan in the comment.
In addition to that, just a few considerations around agent design that could come in handy:
If you want the same DB table to be accessible by different tools, why not providing the data to the Agent Prompter node by adding a data input port? The agent will take care of passing the table to the tools, as deemed necesssary-
Alternatively, if you want several tools to access the same DB (but different tables), you could create a dedicated tool (e.g., DB_Access_Tool) that connects to the DB and includes Configurations nodes. The Configuration nodes parameterize the table and data selection using SQL commands that are automatically written by the Agent. At this point, the output table of the DB_Access_Tool can be sent to other tools by the Agent.
@roberto_cadili , @MartinDDDD I came up with this solution where I dynamically create the path to the H2 database in a subfolder relative to the Tools folder. It seems to work.