# Creating a document hierarchy

Managing documents with different levels of authority or importance can be a real challenge, especially when information may overlap or potentially contradict itself.

AIsuru doesn't officially support document hierarchy management, but in this guide we'll see how to use AIsuru's other tools to achieve the same result.

### How to create a document hierarchy

#### Importing the documents

{% tabs %}
{% tab title="Intermediate users" %}

1. Go to the  **Import / Export** section of your Agent;
2. [**Upload the document**](/en/agent-training/document-import/importing-text-documents.md#access-to-the-import-section) and configure the various settings;
3. In the "**Instructions for question generation**" field, add the following: 'Add "- \[document name]" at the end of every question'. Remember to replace \[document name] with your actual document name!
4. **Repeat for all documents**.
   {% endtab %}

{% tab title="Advanced users and developers" %}

1. Go to the  **Import / Export** section of your Agent;
2. [**Upload the document**](/en/agent-training/document-import/importing-text-documents.md#access-to-the-import-section) and configure the various settings (keep a note of the set topic that "tags" the contents of each file);
3. [**Export the contents in CSV format**](broken://pages/pRiZgAUpWHMo0kttSnsg#esecuzione-del-backup);
4. Automatically append "- \[document name]" to the end of every question;
5. [**Delete the contents**](/en/agent-training/contents/editing-and-updating-contents.md#deleting-contents) from your Agent;
6. [**Re-upload the modified CSV file**](broken://pages/pRiZgAUpWHMo0kttSnsg#come-importare-il-file-csv);
   {% endtab %}
   {% endtabs %}

#### Update the AI settings

Now that you've uploaded the documents, you'll need to instruct your Agent to respect your hierarchy:

1. Go to your Agent's  **Settings**;
2. Click on the  **AI** tab;
3. **Enable the Generative AI toggle** if it's not already on;
4. **Edit the instructions** to clearly explain the priority to assign to each document. E.g. "When the user asks a question, respond by giving priority to the contents from \[document name]. Then consider the contents from \[document name] and \[document name]".
5. Check the "**Always respond with generative AI**" box.

### Ideal use cases

Document hierarchy is particularly useful for:

* Managing regulations and compliance documents;
* Layered technical documentation;
* Any scenario with information sources of different authority or recency.

### Important considerations

* Keep the **hierarchical structure simple, clear, and logical**;
* Carefully document the hierarchy you've established;
* Update priorities when needed;
* Periodically check the consistency of responses.

Creating a document hierarchy is a significant step forward in managing complex information, letting your Agent give more accurate and contextualized answers based on the authority of different sources.


---

# 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://docs.aisuru.com/en/agent-training/advanced/advanced-document-import/creating-a-document-hierarchy.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.
