---
title: "Find your images"
video_id: QpNde4Jx6GQ
url: https://www.youtube.com/watch?v=QpNde4Jx6GQ
workflow_page: https://workflows-of-ai.com/workflow/find-your-images
language: en
captions: generated
---

0:00 This video is sponsored by freely give.
0:02 If you want to help have help with
0:04 Drupal and AI, get in contact with us or
0:07 in AI in general.
0:09 So, in this video, I will showcase how
0:11 you can get your Drupal CMS assistant or
0:14 basically anything
0:16 to search for
0:18 uh images on your website. So, I'm just
0:20 going to go ahead here and ask my
0:22 assistant,
0:24 "Can you find images of someone with
0:28 white beard?"
0:30 So, not santa.jpeg and not in the old
0:33 text that says Santa Claus,
0:36 but it's still going to find this
0:37 santa.jpeg image then.
0:40 This is available now as a recipe and it
0:43 works. There's two recipes. One recipe
0:46 if you can't install the vector database
0:48 and another one if you can install the
0:51 vector database.
0:52 So, let's go through it.
0:55 So, the video will be split up into two
0:57 parts. I will talk a little bit about
1:00 the the recipes and what they actually
1:02 install on your website. And the second
1:05 part will just show how you install it
1:07 and how you can set it up with an
1:09 assistant for instance because it is
1:10 just in the end installing one agent
1:12 that is supposed to
1:14 mainly be a sub agent for other other
1:17 agents.
1:18 So, there are two agent recipes. There's
1:21 a image search agent for database search
1:24 and there's a image search agent for
1:26 vector search and those in their turn
1:30 are using another recipe.
1:32 So, one for image search for DB
1:36 uh and one for image search for vector
1:39 and both of those in the end are then
1:41 using this the AI image classification
1:44 recipe
1:46 that takes care of classifying
1:48 uh actual content. So, it's a
1:51 three-level
1:52 uh structure where the agent is the
1:56 um well, it's the end goal, so to speak,
1:59 but you can, of course, if you want, you
2:01 can just uh
2:03 do the image classification recipe,
2:06 uh
2:07 and that helps with making the media
2:09 search, the internal media search, a lot
2:12 better.
2:13 Uh it also adds a taxonomy, so you can
2:15 get
2:16 categorize the actual media.
2:19 On top of that, then, is two different
2:21 uh
2:22 um
2:23 search recipes, and what those does is
2:26 that they take the classification, the
2:28 extra fields that the classification
2:30 adds. So, it adds a description of the
2:32 image, it adds a taxonomy, and it
2:35 indexes this in a search uh API index.
2:39 And the difference is then that this is
2:40 using the normal database search,
2:43 and this is using a vector search.
2:46 And then, in the end, we have a agent
2:48 wrapped around it. So, a agent that can
2:51 use a tool
2:52 that searches in either the database
2:55 search or searches in the vector search,
2:57 and they have a little bit different
2:58 system prompts. So, mainly the
3:00 difference between a normal traditional
3:04 uh uh search and then vector search or
3:06 semantic search
3:08 is that in traditional search, you have
3:10 to find the search words, and you have
3:12 to use those search words and try to
3:14 find have the agent read it and kind of
3:17 find a meaning in it, while semantic
3:20 search, you don't actually need to fit
3:23 uh
3:23 uh hit on the actual
3:25 search word. You just have to hit on the
3:27 meaning or something similar to what
3:30 what you're looking for.
3:32 Uh so, they work a little bit different,
3:34 but what is important to know is that if
3:38 you're using the database search one,
3:40 the only thing you need uh prepared on
3:43 your website
3:45 is that you have set up a AI provider
3:47 that can do chat with tools, and you
3:49 have set this up as the default chat
3:51 with tools model.
3:53 That is the only requirement. So, we
3:55 actually have in our recipes a check. It
3:58 will check this before it actually
4:00 starts applying.
4:01 Uh and tell you something you know,
4:04 something is wrong. You haven't added
4:05 this. So, you need to add this. But,
4:07 this also means that it's very flexible
4:09 because you can choose your own model.
4:11 You can choose your own provider.
4:13 If you want to use a llama locally for
4:15 this, no problems. If you want to use
4:16 open AI and tropic, no problems as well.
4:19 If you want to you know, use more
4:21 enterprise-y like ABS or Azure, that's
4:24 no problem as well. You can choose.
4:28 It gets a little bit more complex with
4:30 the vector search because you need a
4:32 vector search engine.
4:34 And you need also a embeddings
4:38 embeddings provider.
4:40 And please note for instance that
4:42 Anthropic, while it's a very good chat
4:44 provider, it doesn't actually provide
4:46 embeddings. This means that you need
4:48 another provider for this. If you're
4:50 using open AI, it can take care of both
4:52 embeddings and the chat provider.
4:55 Uh but then you also need a vector
4:56 database. So, you need something like
4:58 Milvus or PostgreSQL with PG vector,
5:01 Pinecone. We have a lot of choices you
5:03 can find there as well. So, you just
5:06 need to install one of these and it's
5:07 the same thing there. We have a setting
5:10 under everything around default
5:13 operation types, we also have a
5:15 a setting for a default vector database
5:17 and a default embeddings provider. So,
5:20 you need to set those up before you can
5:22 actually run this specific recipe.
5:25 So, let's get started.
5:29 Okay. So, I I just installed Drupal CMS
5:31 and the AI assistant, but of course you
5:34 can run with core and
5:36 any provider that has chat with tools,
5:39 basically.
5:40 But, this makes sure that
5:43 well, I have to reload here. So, if I go
5:46 to
5:48 Let's see here. Where are we?
5:51 AI
5:53 AI infrastructure and default models for
5:55 AI operations, you will be able to see
5:58 then
5:59 uh
6:00 that this sets up a chat with tools
6:03 function calling by default. So, most
6:05 most popular providers actually
6:08 will
6:09 set this up when you you set up when you
6:12 set them up give API key and so on. But,
6:14 of course, as I said, you can use
6:16 whatever provider you want in this case.
6:18 You don't have to use Drupal CMS. This
6:19 is just
6:21 uh to give example because what I want
6:22 to do is have this assistant here. So,
6:25 uh no, let's show here. So, here is all
6:28 the agents I have, right?
6:30 So,
6:31 uh what I want to do is here run the
6:33 assistant
6:35 and ask it something like
6:38 uh
6:39 what content types
6:41 >> [snorts]
6:41 >> do I have?
6:44 And this will then go ahead and
6:47 uh
6:48 call the content type agent and give me
6:50 answer. There's utility page, right? So,
6:52 what we want to do now
6:55 is to install the recipe.
6:57 And that is
7:00 just done via Well, first you have to
7:04 run the composer command to get it. And
7:06 then you just run brush recipes to run
7:08 it. And that's basically it. After that,
7:10 you can start searching for images
7:14 depending on what you basically want to
7:16 do.
7:17 So,
7:18 uh
7:20 Well, I will show here what's going to
7:23 happen, what we're going to do
7:25 while this is uh running. Oh, one thing
7:28 I can say as well because we're using
7:30 Drupal CMS is 15 steps because this is
7:32 using Drupal CMS media uh recipe
7:36 uh on top of the three recipes that's
7:38 running, which means that there's less
7:39 steps than if you do it on core. We're
7:42 going to go ahead and add a media here.
7:43 We're just going to upload an image.
7:46 Uh let's do so.
7:48 And
7:49 uh I'm going to take a picture of
7:51 something
7:54 I don't know.
7:56 Let's just take a picture of a family
8:00 here.
8:01 And I'm just going to write something
8:03 else
8:04 just to make sure that so you can see I
8:07 it's we're not getting this from the
8:09 Alt text then.
8:11 Now you're going to see it takes a
8:12 little bit longer to save than normally.
8:15 So what's happening is here is that it's
8:17 going to be looking at the image.
8:20 It's going to describe it. It's going to
8:22 categorize it.
8:24 So you we get this right.
8:26 And it's going to
8:29 um
8:29 also index it. So we have these two new
8:33 fields. They came from the recipe. They
8:35 have been filled out. If you happen to
8:36 have medias, you can just resave the
8:38 medias and it's going to fill out.
8:41 Uh
8:43 So if we go to search API, we just show
8:45 that yeah, we have a new index here. It
8:48 has filled out one thing.
8:51 So now we want to go ahead and try this
8:53 out. We're just going to go to extend.
8:55 I'm just going to
8:57 install two
8:59 uh
9:00 two different module here.
9:02 So
9:03 uh you shouldn't really be using Agents
9:05 Explorer if you do something complex.
9:06 There is AI Agents Debugger contrib
9:09 module that you should be using. It just
9:11 gives so much more information. In this
9:13 case, this is a really stupid agent. So
9:16 while this is loading, if we just reload
9:18 here,
9:19 you're going to see that all of a sudden
9:21 image search agent exists. We can just
9:23 click edit on this so you can see what
9:25 the agent actually is that we have
9:26 installed.
9:28 So there's just a system prompt. It
9:30 looks a little bit different between the
9:33 um
9:34 database agent and the the vector based
9:38 agent, but they have the same tools and
9:41 so it has a tool basically that forces
9:43 that you use this index that we're using
9:45 forces Yeah, I'm going to show how the
9:47 tool works. So it forces some values
9:50 when using this tool to make sure you
9:51 can't
9:52 prompt injected to look into other
9:54 search indexes. You will also see when
9:57 you read the description. This is very
9:59 much a helper agent. It's supposed to be
10:01 used by
10:03 assistants or other parent agents.
10:05 So that's why it has a description where
10:07 it tells the parent agent, you have to
10:10 tell me how to how I should query and
10:12 what you want back, right?
10:14 So now when we have installed this, we
10:17 can just go to AI search and discovery.
10:20 There's AI API Explorer. There's
10:23 a lot of different explorer for
10:24 everything that your providers can do
10:26 and there's tool explorer. So these are
10:28 the tools that agents were uses.
10:30 MCP could be using, ECA could be using
10:34 and there we have them the search index.
10:36 We just search for it.
10:37 We say we want to search this index and
10:39 search for family in this case.
10:42 You see there's a lot of other settings
10:44 here. The important one it's so that the
10:47 agent can basically, you know, look for
10:49 hundred of images paginate paginate and
10:52 so on.
10:52 There is check access. If you know that
10:54 your media library is completely public,
10:57 you can tell the agent to not
11:00 check access. This makes it more
11:02 performance so it doesn't have to do
11:03 access check on anything.
11:06 Uh but we're just going to run this tool
11:08 and you're going to see it find
11:09 something, right?
11:12 Uh now
11:13 uh
11:14 a family is a happy moment, right? If I
11:17 search for that, most likely, yeah, I
11:19 don't find anything. So this is the main
11:22 difference between
11:24 a vector search
11:25 uh uh no yeah, vector semantic search
11:28 and normal search, right? Where it's
11:30 just searching for the actual words.
11:34 Um
11:36 So, that's how the tool works. So, now
11:39 we can actually go back here and try the
11:40 agent. So, we're going to click on
11:43 explore. This shows up because I
11:45 installed the explorer and then we can
11:47 prompt it. Can you find images of
11:50 a family?
11:53 Let's try a family of three. It might
11:55 suggest this image anyway and tell it
11:57 it's a little bit wrong.
12:00 See here. So, it's using the tool to
12:03 search for family of three and then it's
12:05 uh searching for family of three, family
12:07 three parents and child. Gives back a
12:10 response.
12:12 Uh I searched sites but not that I
12:14 should be doing the family of three. The
12:17 only match returned a family portrait of
12:18 five. So, it actually didn't give it
12:20 back because I was very specific. Let's
12:23 do instead can you find a images of a
12:25 family then?
12:29 Then it will search for family and give
12:31 back a response right away that it found
12:33 this image.
12:34 Uh this is the data we tell it to give
12:37 back by default but it can also give
12:39 back other uh information.
12:43 So, what we're going to do now as the
12:45 last step to get it working with a
12:47 Drupal CMS agent. It's supposed to be
12:49 working with the CMS agent, that's why
12:51 we built it so you can it can have the
12:53 CMS agent find images for the pages
12:56 you're building.
12:57 Uh it's going to be a recipe that also
12:59 attaches to the CMS agent in the future
13:01 so you don't have to do anything.
13:03 But I'm just going to showcase in this
13:05 case how you can connect it then to the
13:07 Drupal CMS agent. So, if you go to
13:09 automation, Drupal assistant
13:11 configurations and the Drupal CMS
13:13 assistant we're just editing this and
13:16 we're just saying it can use the image
13:18 search agent as well.
13:20 And in the instructions we're just
13:22 adding
13:23 image search.
13:25 If someone asks for
13:29 the
13:30 for finding
13:33 finding
13:35 images use the image search agent
13:39 and return and
13:43 ask it for the URL
13:47 and the edit link of media
13:51 and return this.
13:55 So very simple, right?
13:57 So now we can actually use this for this
13:59 and we can search here then. Can you
14:02 find
14:04 me images of families?
14:08 And hopefully now it's going to contact
14:10 the image search agent. The image search
14:12 agent is going to go out and search and
14:14 give back a response.
14:16 That
14:18 hopefully has two links then, one to the
14:19 image and one to the edit page.
14:25 Yeah. So it says here is the photo.
14:28 Well, we can tell it to make this maybe
14:30 a little bit nicer.
14:32 But it works, right? It goes to the edit
14:35 page and you all of a sudden now you
14:37 have something that can actually go
14:38 ahead and search all the images for you.
14:42 Yeah,
14:43 that's it. Try the recipe out. It's
14:45 currently in dev. It's going to be in
14:46 stable any day now. It's being reviewed.
14:50 Thank you.
