Problem/Motivation

AI Agents can execute the tools, which are on its own plugins. For add/edit form of AI Agent it would be nice to have a better way to search for the correct tool. Also, showing all of the tools can occupy a lot of space on the form page, therefore having this in a modal (like entity browser for example) looks like a proper way.

Proposed resolution

Create a special form element for tools plugin selection with a modal window where it should be possible to search for plugins, filter them and select.

Issue fork ai-3519692

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Issue fork ai_agents-3519692

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

a.dmitriiev created an issue. See original summary.

anjaliprasannan’s picture

Assigned: Unassigned » anjaliprasannan
anjaliprasannan’s picture

Changed the project to aiagent

anjaliprasannan’s picture

Project: AI (Artificial Intelligence) » AI Agents
Component: AI Core module » Code
Issue tags: -ddd2025
anjaliprasannan’s picture

anjaliprasannan’s picture

Work done:

  • Correctly process the tools selected in the modal.
  • Rebuild the detailed tool usage section when tools are selected.

Remaining work

  • Update the save method in ai agent form to handle the data from the modal form on click apply.

To continue with the remaining work, I am a bit confused with the implementation of how to take the values in the modal form on apply click to the ai agent form and save them in the ai agent form?

Will fix the pipeline error along with the remaining work.

anjaliprasannan’s picture

Status: Active » Postponed

a.dmitriiev changed the visibility of the branch 1.1.x to hidden.

a.dmitriiev changed the visibility of the branch 3519692-create-tools-function to hidden.

a.dmitriiev changed the visibility of the branch 1.2.x to hidden.

a.dmitriiev changed the visibility of the branch 1.1.x to hidden.

a.dmitriiev’s picture

Version: 1.1.x-dev » 1.2.x-dev
Assigned: anjaliprasannan » Unassigned
Status: Postponed » Needs review
yautja_cetanu’s picture

Yes that may help, the issue is I think we need this Base Tools things figured out. So for me, I think having some Designs of how the Base Tools, Tools API will work is important first and then we want a plugin finder/ browser imo. Base tools may not change the browser that much but I think it might. I also think we want to use AI to help people find the right tool.

Also can we see some designs and screenshots of it here?

marcus_johansson’s picture

Issue tags: +Needs screenshots
a.dmitriiev’s picture

Tools form element with 1 tool selected:

Tools form element

Modal dialog that is opened when clicking on "Select tools":

Tools library modal dialog

Filtering and selection of tools inside modal dialog:

Filtering inside modal dialog

Tools form element after tool selection:

Two tools selected

a.dmitriiev’s picture

Issue tags: -Needs screenshots

The tools library is done in the same way the core media library is done, so this design and look should be familiar to all Drupal users.

yautja_cetanu’s picture

From a look and feel this is just better than what exists now however:

- It feels mostly a repaint of what exists now. One feedback I got from what exists now is that things like "Modification tools" - Sub-agents tools were confusing to people.
- We have the ability to configure the tools but it appears at the bottom of the page. Which is confusing.
- The UI for configuring the tools is really bad (just having to know the machine names of all bundles for example, know that you would have to limit the content seeder by entity type etc).
- Cannot have multiple versions of the same tool.

However, as mentioned the would get solved with Base Tools.

So given the above is just better in every way than what we have now, happy for this to go in. But it will likely need to be rethought from scratch with base tools

marcus_johansson’s picture

Project: AI Agents » AI (Artificial Intelligence)
Component: Code » ...to be triaged

Moving to AI

marcus_johansson’s picture

Status: Needs review » Needs work

This is awesome work - I've tested it with and without a modeler and it works fine.

I've added some comments, not everything is obvious that it needs changes, just a discussion. One thing that I didn't mark everywhere in the MR, but that needs to be redone:

  • This is copied and pasted from the media module, which is all good - its a good inspiration. But there are 44 mentions of media in the comments, so that needs to have comments that are specific for this.

So the biggest issue I see for the UX:

  • Its currently not possible to filter on all tools - just when you know what group the tool you are looking for is in. Also when I switch tabs the filter does not stay persistant, meaning that if I want to search for "taxonomy" but I don't know in what group, I have to rewrite it. I know they are not entities, so its not as easy as the Media Browser, but it would be nice to have some way of setting a global overaching search (and later AI assistant). I would call this regression, but in general everything else is better, so we could merge and create a follow up issue.
  • We will sooner or later need a pager, either via backend or at least a frontend pager that keeps it all in JS memory. Can be a follow up issue for 1.3.0 when we have many many tools.
  • This is completely decoupled from this issue, but we need icons for tools. With this many, you need some visual component to diffirentiate.

Other notes:

  • The modeler api + bmpn.io just works without issues together with this, which is awesome.
  • We should add this to the AI API Explorer as well - also outside of the scope of this issue.
marcus_johansson’s picture

BTW - I've rebased the AI Agents branch, but you can also feel free to create an issue specifically for this in AI Agents, so you get credit for both changes.

a.dmitriiev changed the visibility of the branch 3519692-create-tools-function to hidden.

a.dmitriiev changed the visibility of the branch 3519692-create-tools-function to active.

a.dmitriiev’s picture

Status: Needs work » Needs review

I tried to address all comments. There are phpcs and phpstan issues, but they are not related to the changes from this MR.

marcus_johansson’s picture

Status: Needs review » Reviewed & tested by the community

Tested, approved and remerged 1.2.x after fixes of phpcs, phpstan.

marcus_johansson’s picture

marcus_johansson’s picture

Status: Reviewed & tested by the community » Needs work

Seems like a minor fix is needed based on that I added DrupalPractice

a.dmitriiev’s picture

Status: Needs work » Needs review

Fixed phpstan problems!

marcus_johansson’s picture

Component: ...to be triaged » AI Core module
Status: Needs review » Reviewed & tested by the community

I will set RTBC and merge it into AI core. The AI Agents part we might have to wait on, since we might have 1.2.0 release there before the 1.2.0 of AI core is released and the dependency there.

marcus_johansson’s picture

Status: Reviewed & tested by the community » Fixed

Ok, we are on 100% track with the releases, so this is getting merged into AI Agents as well for 1.2.0 release. Thank you everyone!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.