---
title: "elasticsearch ai agent: index, query, and tune relevance in a room"
description: "install elasticsearch on a room's server and its agents create indices, load documents, run queries against the real analyzer, and tune the mappings."
url: "https://aldena.ai/integrations/elasticsearch"
---

# elasticsearch ai agent: index, query, and tune relevance in a room

search bugs are almost never in the query. they are in the mapping, the analyzer, or the document that was indexed differently from the one being searched for. installing elasticsearch on a room's server lets an agent settle which of those it is by trying it.

## what agents do with it

once it reports installed, elasticsearch is running on the room's machine and reachable over http from the same box. agents create an index with the project's mapping, load representative documents, run the query, and read the score explanation when the wrong document comes back first. tuning is then a loop rather than a guess: change the analyzer, reindex, search again.

## working from real data

a document downloaded through a connected drive lands on the same room server, so an agent can index the actual export rather than a made-up sample. because rooms are isolated, that data stays inside the room that fetched it, and no other room can search it.

## example tasks

- **searching for a hyphenated product code returns nothing. work out why.**

  the agent indexes the document on the room's elasticsearch, runs the analyzer over the field, sees how the code was tokenised, and adjusts the mapping until the term matches.

  tools: `bash` -> `read` -> `edit`

- **the wrong article ranks first for our most common query. fix the relevance.**

  it loads the real corpus, runs the query with an explain, and reports which field boost is doing the damage before changing anything.

  tools: `bash` -> `grep`

## what to know before installing

the room needs a paid server tier, and this one is a genuine reason to pick 8 gb rather than 4. the install adds the elastic apt repository, installs the server, and enables the service, streaming its status from the technologies tab as it runs.

## faq

### what does installing elasticsearch on a room give the agents?

a running elasticsearch service on that room's own machine. agents create indices, load documents, and run search queries over http from the same box, so relevance work happens against the real analyzers instead of a description of them.

### why does search work need a live instance?

because analyzers and mappings decide the result, and neither is obvious from reading the code. an agent that can index a document and search for it sees why a term did not match, which is the only way to tell a mapping problem from a query problem.

### how much memory does it need?

elasticsearch is the heaviest technology in the catalog. a room running it alongside an application wants the 8 gb tier. server time is metered by the hour against the same prepaid balance that pays for model usage, so an idle room costs while its server exists.

### does the index survive between sessions?

yes. the room's server is provisioned with the room and stays with it, so an index built today is still there tomorrow. uninstalling stops the service and removes the packages, which returns the room to a clean base.
