> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ainomos.ch/llms.txt
> Use this file to discover all available pages before exploring further.

# Import documents

> Add PDF, Word, Markdown and text files to a room so answers can cite them, and see how Ainomos reads each file.

Importing documents gives a room the knowledge its answers draw on: policies, regulations, handbooks, notes. Ainomos takes the text out of each file, checks it, and splits it into passages it can search. It also reads each document for rules, exceptions and details such as version and validity, and files them for a person to review.

For decision records, see [Import decision files](https://docs.ainomos.ch/import/decision-files.md).

## Supported files

| Format | What Ainomos reads |
| - | - |
| PDF (`.pdf`) | The text of every page. Scanned pages go through text recognition. Password-protected PDFs cannot be read. |
| Word (`.docx`) | Headings, lists and tables. Older `.doc` files are not supported. |
| Markdown (`.md`) | The text as written. A header block at the top can give the title, key, owner and validity dates. |
| OKF | A Markdown file with a complete header: key, title, type and status. Ainomos takes it as written, without guessing. |
| Plain text (`.txt`) | Text in UTF-8. |
| ZIP archive (`.zip`) | Each file inside, as above. |

Ainomos recognises the format by its content, not by the file name. Images and other binary files are skipped.

Limits: up to 25 files per import and 20 MB per file. A ZIP archive may hold up to 25 files and 20 MB once unpacked.

## Import documents

Who can do this: room owners and curators of the room. A platform admin can import only where they hold one of these responsibilities.

Choose the room in the room picker at the top, open **Knowledge**, then **Import**, and drop the files on **Drop any file to add it**. When the card shows **Done** or **Done with notes**, choose **Open the documents**. The [Import overview](https://docs.ainomos.ch/import/overview.md) describes every step.

## How Ainomos reads a document

**1. Takes the text out**

From a PDF, Ainomos lays the text out as paragraphs and headings. It removes page numbers, running headers and footers, and joins words broken at a line end. It changes no word. From a Word file it keeps headings, lists and table rows.

**2. Reads scanned pages**

A page without a text layer goes through text recognition (OCR), inside Ainomos. By default it reads up to 60 such pages per file, in German, French, Italian and English. Whoever runs your installation can switch it off. A page it cannot read stays empty.

**3. Removes credentials**

Passwords, API keys, private keys and access tokens are replaced before anything else reads the text. The file's note says what was removed.

**4. Checks for personal data**

What Ainomos does with names, email addresses and other personal data depends on the room's data class. See [Personal data](https://docs.ainomos.ch/privacy/personal-data.md).

**5. Finds rules, exceptions and details**

A model approved for the room's data class proposes each rule the document states and each exception it grants, with the sentence it comes from. It also reads what the document says about itself: reference, version, issuer, owner, valid from and valid until. A detail is kept only when the words it came from appear in the text.

**6. Splits the text into passages**

The passages answer questions as soon as the import is done.

If you import one document in several formats at once, for example `Policy.pdf` and `Policy.docx`, Ainomos reads the richest copy and skips the others with a note.

## What the data class changes

| | Rooms that keep personal data out (C1 by default) | Other rooms |
| - | - | - |
| Personal data in the text | Replaced by a marker that names its kind, before any model reads it and before anything is stored | Kept as written |
| Note on the file | "Personal data found and masked", with the kinds | "Personal data found", with the kinds |
| Original file | Never kept | Kept when your organisation has set up [file storage](https://docs.ainomos.ch/admin/file-storage.md) |
| Personal-data check unavailable | The file fails and nothing from it is stored | The file is imported |

In every room, only a model approved for the room's data class reads the files. If none is approved, Ainomos adds the documents but finds no rules, exceptions or details. A C3 room also needs a model approved for C3 that makes text searchable. Without one, its documents stay unsearchable and the room says it is paused.

Originals are kept only for PDF and Markdown files, never for a file from which a credential was removed or one that came in a ZIP archive. A kept original is downloaded with **Original PDF** on the document.

## After the import

* **Check the details.** Open the document under **Documents**. Details read from a PDF wait as suggestions, next to the words they came from, until you accept them. **Edit details** corrects the title, reference, version, issuer, owner or validity dates. See [Documents](https://docs.ainomos.ch/knowledge/documents.md).
* **Decide the rules.** **Review the rules** opens the rules waiting under **Pending approval**. The room owner approves or rejects each one. See [Rules](https://docs.ainomos.ch/knowledge/rules.md).
* **Exception requests** go to the Inbox of the owners of the rule's room. See [Exceptions](https://docs.ainomos.ch/knowledge/exceptions.md).

## Knowledge drafts from connected apps

Connected apps can submit knowledge they worked out during a task. It never enters the room directly. It arrives in the **Inbox** as a **Knowledge draft**, with the app's summary, its source note and any **Personal-data hints**. Choose **Accept** to add it to the room, or **Reject** to close it.

Who can do this: room owners and curators of the room.

Knowledge an app submitted for you is listed under **My knowledge submissions** in the Inbox, with its state.

## Fix a failed or stuck import

> [accordion] The whole import failed
>
> The card names the reason. "The same key appears more than once in these files": give each file its own key in its header and import again. "Nothing in these files could be read": no file had usable text. "The import was interrupted when the server restarted": import the files again.

> [accordion] A file was skipped or failed
>
> The file's note gives the reason, for example empty, password protected, not a type that can be imported, or too large. Fix the file and import it again. In a room that keeps personal data out, a file also fails while the personal-data check cannot be reached. Try again later.

> [accordion] Something was left out
>
> Each line says why. "Already in the room, unchanged" needs nothing. "Differs from the version in the room, which was changed here since" means someone edited the document after the last import, so Ainomos did not overwrite it. Other reasons concern rules and exceptions, such as a rule key that exists already.

> [accordion] The import seems stuck
>
> If the service restarts while files are being read, Ainomos picks the import up again. During maintenance, new imports wait and running ones finish. Check the **Import history** before you import again. Importing the same files again is safe: unchanged documents are left out.

> [accordion] Scanned text reads badly
>
> Import a better copy, such as a PDF with a text layer, under the same file name. It updates the document imported before.

> [accordion] An older PDF shows one word per line or page numbers
>
> Open the document under **Documents** and choose **Read again**. Ainomos lays out the stored text like a new import, changes no word, and reads the details again as suggestions. This works for PDF documents whose text was not edited after the import. Room owners and curators can do this.

> [accordion] No rules were found
>
> Either the document states none, or no model is approved for the room's data class. A platform admin can approve one under **Settings**, then **Models**.

## Related

* [Import overview](https://docs.ainomos.ch/import/overview.md)
* [Documents](https://docs.ainomos.ch/knowledge/documents.md)
* [Personal data](https://docs.ainomos.ch/privacy/personal-data.md)
* [File storage](https://docs.ainomos.ch/admin/file-storage.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.