# Importing text documents

AIsuru lets you import text documents and automatically transform them into knowledge for your Agent. This process lets you quickly enrich your virtual assistant's knowledge base by generating relevant question-and-answer pairs from your document content.

### Supported documents

**Supported formats** include: PDF (.pdf), plain text (.txt), Microsoft Word (.doc, .docx), Apple Pages (.pages), OpenDocument (.odt), Rich Text Format (.rtf), HTML (.html).

**AIsuru supports OCR technology**, but for best results we recommend uploading documents with already-selectable text. OCR works best on well-scanned documents with clear text, and may struggle with low-quality scans or complex formatting.

### Importing features from other Agents

Beyond document import, AIsuru also lets you import complete features from your other Agents. Through the "Import Functions and Intents" tab you can:

* Copy [**advanced functions**](/en/advanced-features/integrations/functions/advanced-functions.md) with all their configurations;
* Import [**dynamic intents**](/en/advanced-features/integrations/dynamic-intents.md) and their related **slots;**
* Transfer the [**custom dictionary**](/en/agent-training/dictionary.md)**;**

This is particularly useful when you want to replicate complex configurations across similar Agents or create backups of your implementations. For more details, see the guide on Copying dynamic intents, slots, and functions from another Agent.

### Accessing the import section

1. **Go to your Agent's management panel**;
2. Select  **Import / Export** in the sidebar;
3. Click the "**Choose file**" button and select the document to import.
4. Once the document is uploaded, scroll down to see a preview of the extracted text and adjust the various import settings.

You'll find two sections:

1. Import options;
2. Context management.

### Import options

#### Choosing what to import

After uploading the document, you can select:

* **Import only new contents**: if questions similar to existing ones are generated, AIsuru won't import them;
* **Import everything**: imports the full document content, even if similar questions already exist.

#### Content customization

You can choose, by checking the box, whether to set all contents as:

* **Non-random**: questions won't be randomly suggested during user inactivity (to learn more, go to the section on [timeout](/en/agent-training/advanced/content-customization/using-timeout.md)).

You can also **add a link to all imported questions** (for example, a link to the original file, so the source is always accessible).

#### **Other settings**

In the import options, you can also adjust the granularity: **this setting controls how many question-and-answer pairs are generated per paragraph**. You can set:

* **Low:** fewer contents per paragraph, faster to process — useful for discursive or narrative texts;
* **Medium:** the recommended option, generates a moderate number of contents;
* **High:** generates many contents per paragraph, takes longer but is very useful for information-dense texts with many concepts.

{% hint style="info" %}
For best results, **we recommend setting granularity to high**.
{% endhint %}

Next, there are **instructions for question generation**. This field is for **guiding the generative AI in how it creates questions**: it's crucial for getting relevant, high-quality question-and-answer pairs.

In the instructions you should provide:

* a brief **context about the document**: what is it about? what is it useful for?
* a brief **context about the end user**: who are they? what kinds of questions do they ask? what language do they use?
* some **clear and concise rules and instructions** for generating the questions.

Example:

```
This document describes company policies for workplace safety.

Instructions for question generation:
- Create questions covering the main safety topics mentioned in the document;
- Include questions about specific procedures, safety equipment, and employee responsibilities;
- Generate questions that test understanding of the consequences of not following safety rules;
- Create some scenario-based questions that require applying the policies to real situations.
```

#### Attach source (optional)

Select this option if you want to include the original text excerpt as an attachment for each generated question-and-answer pair.

### Context variables

In the context variables section you can add: tags, set topics, and required topics.

#### Tag

Tags are like categories you can assign to your contents. If you set a tag during a document import, all question-and-answer pairs generated from that document will be tagged with those categories.

By default, a tag is added to identify your import — this way, you can always trace which contents came from which imported document.

You can remove tags by clicking the red trash icon  next to each one, or click "Add" to add a new one.

#### Set topics

Add the [context to set](/en/agent-training/advanced/content-customization/context-topics-and-labels.md#set-context-and-required-context) when the user asks specific questions.

#### Required topics

Users won't have access to the question-and-answer pairs created from the document import unless they've first set a specific topic.

#### **Assigned to**

The contents extracted from the document can be assigned to a [**specific role**](/en/agent-training/advanced/content-customization/assigning-contents-to-roles.md) or to the **public**.

### Launching the import and Import history

Once you've configured all the settings, you can start the import by clicking the **Import** button at the bottom left.

After starting the import, you'll have access to a new tab in the Import / Export section:  **Import history**.

From this section you can see:

* **The progress** of the import you launched;
* **Past imports**.

For each import, you can see:

* File title;
* Start and end date of the process;
* Number of questions imported;
* If you click on "import data and settings" you'll also see:
  * File size;
  * File name;
  * Whether contents are set as non-random;
  * Granularity;
  * Instructions for question generation;
  * Source title;
  * Link handling.

Importing text documents into AIsuru is an effective and fast way to grow your Agent's knowledge base. Make the most of this feature to build a well-informed virtual assistant that can provide accurate and relevant answers to your users.


---

# 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/document-import/importing-text-documents.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.
