# AI Search using UI

## 1. Policy Fields

Several new fields have been incorporated into policy formulation to enhance AI search capabilities. These fields include:

1. Sectoral scope
2. Project Scale
3. Conditions for applicability
4. URL on policy details page
5. Typical projects, Description
6. Important parameters (at validation / monitored)
7. Applied Technology by Type
8. Mitigation Activity Type
9. Sub Type

<figure><img src="/files/SgiHwuspEOU6FuYw1jPh" alt=""><figcaption></figcaption></figure>

## 2. .env file parameters

The .env file contains the following parameters:

| Parameter             | Meaning                                                    |
| --------------------- | ---------------------------------------------------------- |
| OPENAI\_API\_KEY      | OpenAI API Key                                             |
| GPT\_VERSION          | GPT version; by default, it is set to 'gpt-5-nano'         |
| VECTOR\_STORAGE\_PATH | The path where vector will be stored                       |
| DOCS\_STORAGE\_PATH   | The path where generated methodology files will be stored. |

{% hint style="info" %}
These parameters are essential for configuring the AI Search tool.
{% endhint %}

## 3. Vector Construction

Vector construction is a pivotal process that involves compiling policy data and extracting descriptions from policy schemas. This process ensures the AI Search tool accurately interprets and utilizes policy-related information.

Every time a user publishes a policy, the vector is rebuilt through the following step-by-step process:

* Retrieving the required data from the newly added fields in the "create policy" modal window for each published policy from the database
* Retrieving the descriptions from the policy schemas and adding them to the resultant policy files. Descriptions containing fewer than 5 words are avoided to exclude unnecessary data for the language model.
* Creating separate files based on the fetched data, with each file containing the information describing one policy. Additionally, a file named metadata.txt is created, which contains shared data about all policies.
* Generating a new vector to replace the previous one.

Once the vector is ready, standard registry users can utilize the AI search feature to find the most suitable methodology:

<figure><img src="/files/h8odfiXJ1ckA6K0WimHR" alt=""><figcaption></figcaption></figure>

Every response contains text and may include tiles with methodology data if the language model identifies relevant methodologies to suggest. Each tile comprises the policy name, a short description, and two links: as shown below:

<figure><img src="/files/wmtMBJF8BO0el1wDmtp9" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guardian.hedera.com/guardian-dev/guardian/users/ai-search/ai-search-using-ui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
