Connect an Elasticsearch cluster once, and your AI can use it in three ways: an AI node can search and read only the indices you list, an AI node can keep its memory in an index of yours, and a vector store can keep its chunks there. All of it lives in your cluster, so none of it counts against your plan. The node itself, with its operations and its trigger, is in Connect Elasticsearch to your flows.
The AI can do whatever its key can do.
Make a key of its own for the AI, with only the privileges it needs (see step 01), and never the superuser role. The settings below limit what the AI asks for; the key limits what the cluster allows.
Connect your cluster and make the keys for the AI
In HostWebhook, click Settings in the left sidebar, then Credentials, start a new credential and choose the Elasticsearch type. It works with Elastic Cloud (Hosted and Serverless) and with your own cluster. You will make two credentials: one with a key that only reads, for an AI toolkit, and one for the memory and the vector stores.
In Kibana, open Dev Tools and make two keys for HostWebhook. The first one only reads, and it is for an Elasticsearch node in AI toolkit mode. The second one is for the memory and the vector stores, which save in indices that start with hostwebhook-. The first can never reach the indices of the second, and the second can't read your own data.
POST /_security/api_key
{
"name": "hostwebhook-ai-toolkit",
"role_descriptors": {
"hostwebhook-ai-toolkit": {
"indices": [
{ "names": ["orders-*", "logs-*"], "privileges": ["read"] }
]
}
}
}POST /_security/api_key
{
"name": "hostwebhook-ai-memory-and-stores",
"role_descriptors": {
"hostwebhook-ai-memory-and-stores": {
"indices": [
{ "names": ["hostwebhook-*"], "privileges": ["create_index", "read", "write"] }
]
}
}
}Copy the encoded value of each answer into the API key field of its own credential, save each one and click Test connection. On Serverless, or if you prefer the screen, use Stack Management and then API keys in Kibana.
| What it does | The privilege it needs |
|---|---|
| An AI node that only searches and reads | read on the indices it can use |
| A memory or a vector store: look at the index, search it | read on its index (or view_index_metadata) |
| A memory or a vector store: create its index, save | create_index and write on its index |
| Delete a conversation, a document or the oldest messages | read and write on its index |
| Delete a vector store and its data | delete_index on its index |
| A vector store where Elasticsearch makes the vectors: check that its inference endpoint exists | monitor_inference on the cluster (monitor includes it). It is optional: without it the check is skipped |
| An AI node that writes into an index that does not exist yet | manage_index_templates on the cluster (manage includes it), or make the index first |
Use the key with no write privilege for an AI that only reads: a tool that writes then says the key can't, instead of changing anything. Never give the key of the toolkit a role of the hostwebhook- indices, and never the superuser role. A 403 from your cluster is the key missing one of these on that index, not a failure of HostWebhook.
Before an AI node writes into a name that does not exist yet, HostWebhook reads the templates of your cluster to see what the new index would be created with, and that read needs manage_index_templates on the cluster. It also lets the key change templates, so the narrower choice is to create the index first and let the AI write into it. An index with a percolator field is never written by the AI.
Let an AI node use your indices (optional)
OptionalAdd an Elasticsearch node to a flow, pick the credential of the key that only reads and, under Mode, choose AI toolkit. The node becomes 23 tools that an AI node, an MCP client or a voice agent can call. The model never writes the call itself: each tool builds the request, and HostWebhook runs it.
Fill in these fields of the node:
| Field | What to put |
|---|---|
| Indices the AI can use | The names or patterns it can touch, one per line, like orders-2026 or logs-*. Up to 50. Empty means none: until you add one, every tool that touches an index refuses |
| Fields the AI can see | The fields that come back in the documents it reads, one per line, like title or user.*. Empty means all of them |
| Allow scripts from the AI | Off. On, the AI can write scripts in its queries and updates, and they run inside your cluster |
| Allow deleting indices | Off. Without it the tool that deletes an index is not offered at all |
HostWebhook checks the indices before it connects, and the refusal tells the model which indices it can use, so it doesn't have to guess. A pattern the model asks for is allowed only if one of yours covers it as it is written: logs-2026-* under logs-*, never *. An alias or a data stream is not a way round: if the name reaches an index HostWebhook made for a memory or a vector store, the call is refused.
Fields the AI can see limits what comes back. It is not a permission.
A query can still filter by a hidden field. For a hard limit, use a role with field-level security in the key. With the list filled in, ES|QL, SQL, the free API request and aggregations are refused, because they can name any field.
Nine tools only read and are on from the start: they list the indices and the fields of one, search, count, get one or several documents, search by vector, search by meaning, and give the cluster's version and health. The other fourteen start blocked: the ones that add, change or delete documents, bulk, change by query, reindex, create or delete an index, change aliases, run ES|QL or SQL, run a model, or call the API directly. Turn on only the ones the agent should have. The ten that can replace or delete data are also stopped by the AI node's Block destructive tool calls switch.
What no call can do
A query of the model can't read another index. Searches, counts and gets are capped at 50 results, a Bulk at 100 items, an SQL query at 100 rows, and what goes back to the model is cut at 20,000 characters, unless you raise Characters per call sent to the model (never above 100,000), with a note to the model. A change by query or a reindex always has its brake on, with the limit of the node (1,000 if it has none), and Return all is never on for the AI. The free API request has to start with an index of your list and can only use a closed set of calls (search, count, get, mapping and settings reads, refresh and the document calls): it can't clone, shrink, split, roll over or close an index.
To try a tool, call it from an AI node or an MCP client.
A node in toolkit mode is not part of the flow: remove its connections.
Only an AI node, an MCP client or a voice agent picks the tool. What reaches the node any other way (a connection of the flow, a webhook, Run Test) follows one rule. With no operation in it, the node refuses, and its answer says it is an AI toolkit and that the call named no tool. With an operation equal to the one saved on the node, it runs the saved operation, with its saved settings and its templates, as if the node were not in toolkit mode. With any other tool it refuses. A tool you blocked is refused too. Whoever calls a public webhook can put an operation in the body, so a connection that leads into a toolkit node can make it run its saved operation: take the connection out when you switch the mode.
Remember conversations in your Elasticsearch cluster (optional)
OptionalOpen the AI node, go to its Memory tab, turn Memory on and choose Elasticsearch.
| Field | What to put |
|---|---|
| Elasticsearch connection | The credential of the key for the memory and the stores (step 01) |
| Index | Fixed text, hostwebhook-memory to start: lower case letters, numbers, _ and -, up to 100. HostWebhook makes it. Pick one that nothing else of yours uses |
| Keep a conversation for | How long a message is remembered, counted from the message itself: 30 days to start, from 1 hour to 365 days, or Never. Past it the AI no longer recalls it, and it is deleted the next time the node writes to the memory |
| Turns kept per conversation | 100 to start, 1,000 at most. A turn is what a person said and the answer. The oldest are dropped |
Set the Session ID to what identifies one conversation, usually a value of the event like {{payload.from}}.
Each message is one document in your index, with the node, a hash of the Session ID (so the field you can search doesn't carry a phone number or an email address), the real Session ID's first 256 characters (only so the Memory tab can show it), who said it, the text and the time. A message that expired is no longer recalled, and each time the node writes to the memory it also deletes what expired in any conversation of that node. A node that stops writing keeps what it has, out of the AI's reach, until you delete it in the Memory tab or delete the node. It recalls the latest turns of the conversation, in order, so it calculates no embeddings: nothing goes to an embeddings provider. For the same reason AI-extracted facts isn't offered with it. A message longer than 16 KB is cut and ends with [cut].
One index can serve several nodes: each message carries its node and its conversation, and a node never reads or deletes what belongs to another. HostWebhook uses an index only if it made it: one that exists and wasn't made as a memory is refused with a line, and never changed.
Under Settings, AI Memory, each node lists its conversations, including a message that expired and hasn't been deleted yet (the tab shows what is in your cluster). You can read the messages (newest first), forget one conversation, delete the messages older than a date, or empty the node. Deleting a single message isn't available. Deleting the AI node empties its own messages in your cluster, and never the index.
If your cluster doesn't answer, the node still answers, just without its memory, and Monitoring shows an AI Memory warning with the reason. A key your cluster rejected says to reconnect, and the credential shows Needs reconnect.
A memory on your cluster doesn't count against your plan.
Its messages are in your cluster, so the storage of your plan isn't used. You pay Elastic, or whoever runs the cluster, for the space.
Search your documents with your Elasticsearch cluster (optional)
Optional| Your cluster | Vector store |
|---|---|
| Elasticsearch 8.0 or later (Elastic Cloud, Serverless, your own) | Works. Up to 1,024 numbers in each vector before 8.11, and up to 4,096 since. On 8.18 or later, and on Serverless, your cluster can also make the vectors itself (see below) |
| Elasticsearch 8.0 to 8.17 | Works with the vectors of your embedding model. Letting Elasticsearch make them doesn't |
| Elasticsearch 7.17 | No: its vector field can't be indexed. Documents and search work |
| OpenSearch | Not yet |
Open Settings, then Vector Stores, click New, choose the embedding model and, as the backend, Elasticsearch (your own). To let your cluster make the vectors instead of an embedding model, read Let Elasticsearch make the vectors below first.
| Field | What to put |
|---|---|
| Elasticsearch connection | The credential of the key for the memory and the stores (step 01) |
| Index name | Fixed text: lower case letters, numbers, _ and -, up to 100. Leave it empty and HostWebhook picks one for the store |
| Metadata fields | Up to 10 fields you can filter by, each Text or Number, like language or year. You can't add one after the store exists |
Click Test connection. If it says Vector search: available. the cluster can hold vectors; if it doesn't, it says why, and Create store refuses with the same line. The test makes nothing in your cluster. Then click Create store.
HostWebhook makes one index and saves one document per chunk, with its text, its vector (an indexed dense_vector with cosine similarity, the size of your embedding model), the document it comes from and your declared fields. The algorithm and the distance are fixed, so there is nothing to choose. HostWebhook uses an index only if it made it for this store: an index that already exists and wasn't made by this store is refused, never used and never repaired, with a line like Index «orders-2026» already exists and HostWebhook did not create it. Pick another index name.
Let Elasticsearch make the vectors. By default the embedding model you pick makes the vectors, with your own key. If your cluster has an inference endpoint (the ELSER that comes with it, or a model you run or connect there; check that your subscription (or a trial) includes inference), the store can let Elasticsearch make them instead: HostWebhook sends your cluster the text of each chunk and of each question, and no embedding service, and the cluster turns them into vectors. What a search finds comes back through HostWebhook, and an AI node hands it to its model, as with any other store. The store then has no embedding model, no vector size and no embedding key. It needs Elasticsearch 8.18 or later, or Serverless.
| Field | What to put |
|---|---|
| Who makes the vectors | Elasticsearch makes them. The embedding model and its key leave the form |
| Inference endpoint | The id of an endpoint of your cluster, like .elser-2-elasticsearch. Empty means that one, the ELSER that comes with the cluster (check that your subscription (or a trial) includes inference, or the endpoint answers 403). It has to exist and make vectors (text_embedding or sparse_embedding), and it can't be changed later |
Test connection says Semantic search: available. when the cluster can do it and the endpoint is there. A cluster that answered and can't shows Not available on this cluster, with its line, and Create store refuses with the same line. HostWebhook checks the endpoint by reading the list of your cluster's inference endpoints (it keeps only the id, the kind and the service of each). A key without the monitor_inference privilege isn't refused: the check is skipped and the store is made, so HostWebhook can't tell you if the name is wrong. Any other failure of that read, such as a rejected key, stops the store. A 403 that comes from the license looks the same as a missing privilege, so the store is made and fails when it first writes.
The index is the same, with a field your cluster keeps its vectors in in place of the vector of an embedding model. The score of a match is the one of the model, so what it looks like depends on the model. A dense model like e5 gives scores from 0 to 1 that sit close together (in a live test, the best three matches of one question scored 0.906, 0.869 and 0.862), while a sparse one like ELSER has no top and a score can be above 1. In the Vector Store node, Min score for such a store is the model's own number (the node takes up to 1000): above 1 only makes sense with ELSER or a similar sparse model, and with a dense one the useful floor is between 0 and 1 (a Min score of 2 returns nothing). With any other store, 1 is the highest value that can match, and a bigger number is refused when the node runs. If the endpoint is itself a connection to an outside service that you made in Elasticsearch, your cluster sends the text there, under your terms with that service: HostWebhook isn't part of that call.
A search can be narrowed by the document a chunk comes from and by the metadata fields you declared. A Text field matches exact values (one, or a list of up to 10) and a Number field an exact number or a range. A field you didn't declare can't be filtered on later: create a new store.
Because the chunks are in your cluster, deleting a store asks you what to do with them, and never chooses for you. Delete store, keep my data is the main button: HostWebhook forgets the store and your cluster isn't touched. Also delete my data drops the index of this store, with every chunk in it, and nothing else, and only if it still carries the mark HostWebhook put in it for this store. It can't be undone. Flush deletes the chunks and keeps the store.
A store on your Elasticsearch cluster doesn't count against your plan.
Its chunks are in your cluster, so the storage of your plan isn't used. Elastic Cloud charges for what the cluster uses, and Serverless charges the queries as compute.
Troubleshooting
The AI says it can't use an index. The index isn't in Indices the AI can use. The line lists the ones it can use: add the one you want, or a pattern that covers it. An empty list means none.
A tool says it isn't available. Nine tools start on and fourteen start blocked: turn the one you need on in the node, and check the AI node's Block destructive tool calls switch. The tool that deletes an index also needs Allow deleting indices on the node.
This pattern includes an index that holds the chunks of a vector store. A memory or a store index is never readable through a toolkit, whatever its name. Pick a narrower pattern, or another name for the memory or the store: HostWebhook refuses it from both sides, and counts two credentials of the same cluster as one.
Index «…» already exists and HostWebhook did not create it. A memory or a store only uses an index it made. Pick another index name, or delete the index yourself if it isn't needed.
This embedding model gives vectors of 1536 numbers and the index holds 768. The index was made for another model. Create a new store. A cluster older than 8.11 also takes vectors of up to 1,024 numbers.
Letting Elasticsearch make the vectors needs Elasticsearch 8.18 or later, or Serverless. The cluster is older. The store with the vectors of your embedding model works on 8.0 or later: create it with the embedding model instead.
The inference endpoint «…» doesn't exist in your cluster. Create it in Elasticsearch, or pick another endpoint. It doesn't make vectors means the endpoint is for something else (rerank, say): pick one for text embeddings or sparse embeddings. The endpoint of a store can't be changed: create a new store.
A search says the cluster took too long. It waited 10 seconds and the answer isn't complete. Run it again with a narrower filter.
A write says «That index does not exist yet». The AI wanted to write into a new index and the templates of the cluster could not be read: the key lacks manage_index_templates on the cluster. Give it that privilege, or create the index first (the tool create_elasticsearch_index, or Kibana) and write to it. If the line says a template would create the index with a percolator field, use another name or change that template.
That index has a percolator field. The AI never writes into an index with a field of that type: the cluster runs the queries stored in it when a document is written, and they can read other indices. Use an index without one.
The memory says to reconnect, or a 403 shows up. Open the credential: a rejected key says Reconnect, which opens Edit keys and settings for a new key, and a 403 means the key lacks a privilege of step 01 on that index.
Elasticsearch is a trademark of elasticsearch B.V., registered in the U.S. and in other countries. Elastic is a trademark of elasticsearch B.V.