Add Oracle database tools for the agent framework, enabling LLM agents to query and discover Oracle database schemas#450
Conversation
pyproject.toml
Outdated
| ] | ||
|
|
||
| [project.optional-dependencies] | ||
| oracle = ["oracledb>=2.0.0"] |
There was a problem hiding this comment.
why do we need this outside the container?
There was a problem hiding this comment.
You're right, no need for it outside the chat container. I'll remove it.
|
|
||
| # Auto-detect Oracle database config and set INSTALL_ORACLE build arg | ||
| base_config = (context.config_manager.get_configs() or [{}])[0] | ||
| oracle_dbs = base_config.get("services", {}).get("chat_app", {}).get("tools", {}).get("oracle_databases") |
There was a problem hiding this comment.
tools are determined via the agents.md now, so i think this wouldn't work.
but I agree with your concern about installing oracle in the docker even if you don't want it. How large / slow is this?
another option would be to set up an external MCP server, and ping it?
There was a problem hiding this comment.
My thinking was to install oracledb only when it's needed to keep the container lightweight. I use thick mode by default because the CERN Oracle databases require it and it will cover everything if we use this mode(thin mode). So the size of package is about 145 MB.
I haven't looked into the MCP server approach yet, but I'll have a look.
1a15e02 to
0984c6d
Compare
|
@LinaresToine can you please take a look at this from the Tier0 angle? I'm curious what you think about this |
|
Thanks for pinging me @haozturk. I really like this feature, I can see it being of great use for Tier-0 day to day operations. Thank you @Viphava280444. What is the cost of this tool? I mean, would it require heavy use of the higher-end models? |
|
@haozturk @Viphava280444 I would also like to point out that this tool is not to be used blindly. There are cases in which the operator needs to be very critical of what is going on. One example is for data invalidation whenever we must reprocess something. Although this is unlikely now with the Run3 coming to an end, I think it is valuable to keep such cases in mind. |
| build: | ||
| context: . | ||
| dockerfile: archi_code/cli/templates/dockerfiles/Dockerfile-data-manager | ||
| {% if host_mode %} |
There was a problem hiding this comment.
Why have you added these host_mode conditionals? How are they relevant to the purpose of this PR?
There was a problem hiding this comment.
Hi Hasan, No, it's not directly relevant to this PR. I added it in the build section as an ad hoc solution because when I tried to install Archi on a Tier 0 machine, it couldn't build the image. Somehow, Docker's network on the Tier 0 machine behaves differently and needs host mode to reach the network to install packages (pip install, apt install, etc.).
There was a problem hiding this comment.
I can remove them once I finish development on this PR, since I still need to deploy it on Tier 0 for testing the Oracle tool.
Hi @LinaresToine, No, it doesn't require heavy use of a higher-end model. It just needs the same model to call this tool as it does for the other tools. |
@LinaresToine Thank you for pointing this out Antonio. Yesterday, I modified the output of the tool to also show the query that the AI uses, so that people can validate it for correctness. |
Key changes
New files:
allowlists, timeouts, and thick mode for CERN NNE.
describe_oracle_schema (list databases/tables/columns). Includes error hints for common Oracle errors so
the LLM can self-correct.
row limits.
Modified files:
configured.
Oracle databases are configured under services.chat_app.tools.oracle_databases
Examples
Example 1

Example 2

Example 3

Example 4
