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

# Index Scope

> Decide which files get indexed: switch off whole file types you don't need, or leave out files and folders with rules written like .gitignore.

By default Linkly AI indexes every supported file in your folders. There are two ways to keep the parts you don't want out of the index:

* **File type switches**: turn a whole type off, such as images or video, for every folder.
* **Exclusion rules**: written like `.gitignore`, they leave out files and folders by name or path.

Both live on the **Rules** tab of the Index management page: click the index status at the bottom of the sidebar to open Index management, then switch to Rules.

Excluded files are removed from the index, so search, the library, AI chat and connected agents no longer see them. **Files on disk are not touched.**

***

## File type switches

There are 10 types in two groups, Documents and Images, audio and video: PDF, Word documents, Markdown and plain text, web pages, e-books, spreadsheets, presentations, images, audio and video. Each row shows how many files of that type there are now.

* **Turning a type off**: files of that type are no longer scanned, indexed or counted; the ones already in the index are removed after about a minute. You confirm before it happens.
* **Turning it back on**: the next scan brings the files back and indexes them again. Text already recognized in images and finished transcripts are reused while they're still cached; otherwise images go through text recognition again and audio and video are transcribed again, which takes a while when there are many.

> [!NOTE]
>
> If you only want to skip recognizing the text in images but still find them by filename, keep the image type on and turn off text recognition (OCR) under Extraction enhancements on the Index tab instead. The other way round, with the image type off, OCR only processes scanned PDFs and the images in the `Notes`, `Clips` and `Canvas` folders.

With audio or video turned off, the matching transcription switch under Extraction enhancements is greyed out.

## Exclusion rules

On the Rules tab there is one rule list for All folders and one for each folder. Click Edit or Add rules to open the rule editor.

You can also right-click a file or folder in the **library** and choose Add exclusion rule…: the editor opens with a rule that matches just that item. When the folder already has rules, the menu also offers Edit exclusion rules…. In the library, when a rule names a folder directly, the folder above it shows a funnel icon that opens the editor too.

### Writing rules

The same as `.gitignore`, one rule per line:

| Rule | Leaves out |
| - | - |
| `*.csv` | `.csv` files anywhere |
| `drafts/` | Folders named `drafts` at any level |
| `/drafts/` | Only the `drafts` folder at the folder's root, not deeper folders of the same name |
| `project-a/export/` | A rule with a `/` in the middle matches from the folder's root: just this one folder |
| `**/temp/**` | Everything inside `temp` folders at any level |
| `!important.md` | Exception: an earlier rule left it out, this one brings it back |

A few details:

* `*` matches any characters within one level, `?` matches one character, `[abc]` matches one of the characters inside, and `**` on a level of its own matches any number of levels. `?` and `[…]` only match plain ASCII characters — unaccented English letters, digits and common symbols; for Chinese, accented letters and the like, use `*`.
* A trailing `/` matches folders only.
* Rules apply from top to bottom and the last matching rule wins, so an exception goes after the rule it overrides.
* **Once a folder is excluded, files inside it can't be brought back with `!`.** To leave out a folder but keep one or two of its files, write `drafts/*` followed by `!drafts/important.md`.
* Matching ignores the case of the letters A to Z: `*.PNG` is the same as `*.png`. This holds on case-sensitive Linux file systems too, where `Draft/` also leaves out `draft/`. Other letters, such as accented ones, must match the case of the name: `Été/` doesn't leave out `été/`.
* `\` always counts as `/`, so there's no backslash escaping; write `*`, `?`, `[`, `{` and `}` in a name as `[*]`, `[?]`, `[[]`, `[{]` and `[}]` (`{a,b}` matches either `a` or `b`).
* Paths start at the folder's root; don't write full disk paths.

### All folders and single folders

Each folder applies the All folders rules first and then its own. A folder's own rules can therefore use `!` to bring back files that an All folders rule left out.

When folders are nested (say you added both `Docs` and `Docs/Project A`), a file is judged only by the rules of the deepest folder that contains it.

### The rule editor

* As you type a rule, the line below tells you whether it's written correctly and how many files it would leave out, and suggests a fix when something is off.
* The preview lists which files exactly. Click a rule in the list to see only the files that rule leaves out.
* You can paste several lines of rules at once; they're split into rules and checked one by one.
* After you save, a message tells you how many files will leave the index and offers Undo for 10 seconds.

### When rules take effect

Excluded files leave the index about a minute after you save, and you can still find them until then. That way, Undo and changing your mind cost no reprocessing. When you lift a rule, the next scan brings the files back and parses them again.

If excluded files had been pushed to a [cloud library](/docs/en/use-cloud-library), the next sync deletes them from the cloud as well. With auto sync on, when a lot would be deleted at once, syncing pauses until you confirm by pushing manually; a manual push deletes them right away.

## .ignore files in your folders

Rules can also live in a file: put a file named `.ignore` in a folder and write it like `.gitignore`.

* It applies to the folder it sits in and everything below it.
* It doesn't need a Git repository.
* `.gitignore` only works inside Git repositories; `.ignore` works in any folder.
* It's matched exactly like `.gitignore`: case-sensitive, and `\` escapes the next character, so paths use `/` only.
* Editing a `.ignore` file doesn't start a scan: files already in the index leave it at the next full scan, for example when Linkly AI restarts.

It suits rules that should travel with the folder, such as a project's own export directory.

## Built-in rules

These always apply and can't be turned off; they're also listed at the bottom of the Rules tab:

* Hidden files and folders: names starting with `.`, such as `.git`, `.obsidian`, `.DS_Store`
* Folders created by the system and sync apps: `node_modules`, `__pycache__`, `#recycle`, `#SynoRecycle`, `@eaDir`, `@Recycle`, `$RECYCLE.BIN`, `System Volume Information`
* Linkly AI's own data files: the index, settings, logs and other app data (the `ai.linkly.desktop` folder)
* Temporary files: the `~$` files Office creates while a document is open, and `Thumbs.db`
* Files ignored by `.gitignore` in a Git repository
* Rules written in `.ignore` files in your folders
* Unsupported formats, such as archives, installers and code files

Your own rules can only leave out **more** on top of these; they can't bring back files these keep out.

> [!NOTE]
>
> The `Notes`, `Clips` and `Canvas` folders in the [Linkly AI Space](/docs/en/linkly-space) are always indexed, whatever the type switches and exclusion rules say — note search, tags and agents reading your notes all rely on them being in the index.

## Let an agent write rules for you

Rules are saved as plain text in the `indexScope` field of Linkly AI's `config.json`, so an agent can read them.

To have an agent help, tell it what you want to leave out and ask it for the rule text. Then paste the whole text into the rule editor, check the rules and save.

> [!WARNING]
>
> Don't let an agent edit `config.json` directly: the app doesn't reread the file while running, and the next time a setting is saved, the agent's change is overwritten. If the app restarts before that, the change takes effect at startup as written — without the editor's checks, the one-minute wait or Undo.

When an agent browses a folder with `list` and finds nothing indexed in it, the hint mentions that index rules may have left the files out; the `explore` overview also notes which types aren't indexed and how many folders have rules.

## FAQ

> **I turned a type off, but its files still show up?**
>
> That's expected. So that you can undo, excluded files leave the index about a minute after the last change to the switches or rules. After that, search and the library no longer show them.

> **Why doesn't !drafts/important.md work?**
>
> Because `drafts/` leaves out the whole folder: an excluded folder isn't scanned anymore, so files inside it can't be brought back one by one. Write `drafts/*` followed by `!drafts/important.md` instead.

> **My rules disappeared after downgrading?**
>
> Older versions don't know the rules field and rewrite the config file at startup, so the rules are lost and the excluded files are indexed again. After upgrading again, set them up once more.

***

## Further reading

* [Index Settings](/docs/en/indexing) — every indexing switch and how to troubleshoot
* [FAQ](/docs/en/faq) — what to do when a file can't be found even by name
* [Linkly AI Space](/docs/en/linkly-space) — where notes, clips and canvases are stored


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