opensearch-project / ml-commons

ml-commons provides a set of common machine learning algorithms, e.g. k-means, or linear regression, to help developers build ML related features within OpenSearch.
Apache License 2.0
96 stars 135 forks source link

[RFC] Dynamic tool support in agent framework #3202

Open zane-neo opened 2 days ago

zane-neo commented 2 days ago

The current tool implementation has quite a few drawbacks and we can enhance this by supporting dynamic tools in agent framework, the implementation of it needs a little change in /agents/_register and /agents/execute API, more details can be found in this issue: https://github.com/opensearch-project/skills/issues/459

mingshl commented 2 days ago

can you explain more details in the changes in ml_commons @zane-neo ?

zane-neo commented 1 day ago

Sure, there are limited changes in ml-commons. In agents/_register API:

I also have the plan to change ml-commons project structure and tool's interface to extract the MLToolSpec to a separate module so that it can be depended by ml-algorithms and spi modules to mitigate the seder effort between agent running and tool running, e.g. an object parameter might need to serialized to string to put it into Map<String, String> parameters and then deserialize it back to an object in tool's run method. This needs much more effort in both ml-commons and skills so this is a future plan.