Indexed
IndexingConnectors

Code & Local Files

Index any local directory — Markdown, PDFs, DOCX, source code — into a searchable collection.

Local Files & Code

By the end of this guide, you will have a local directory indexed into a searchable collection, with filters configured to include only the files you care about.

Quick start

Terminal
indexed index create files -c my-docs -p ./documents

For every flag and default, see Index commands (indexed index create files --help).

Prerequisites

What gets indexed

  • Text extracted from each supported file type (see Supported file formats)
  • File path and modification metadata
  • Directory hierarchy
  • Code structure when AST chunking is enabled (function/class boundaries for supported languages)

Create a Collection

Point Indexed at your folder. It recursively scans, parses every supported format, chunks, and embeds — all on your machine.

Terminal
indexed index create files -c project-docs -p ~/work/docs

Indexing is always recursive — all subdirectories are scanned. There is currently no depth-limit flag.

Obsidian vaults

Point -p at your vault root (e.g., ~/Documents/ObsidianVault). Indexed scans nested folders recursively and indexes the Markdown files themselves — wiki-link syntax and frontmatter are not interpreted.

Verify the collection was created:

Terminal
indexed index inspect project-docs

Filter what gets indexed

On the CLI, --include and --exclude take regexes matched against the full file path (repeat the flag for each pattern). When both are set, includes are applied first.

Persistent defaults for a workspace live in [sources.files]: include_patterns accepts globs or regexes, and prefixing a pattern with ! excludes matching files (for example ["*", "!*.pyc"]) — see Files connector. With --gitignore (on by default; disable with --no-gitignore), .gitignore rules and common noise dirs like node_modules and .git are skipped; see the same Index command reference for all indexed index create files flags.

Terminal
# Only index Markdown and text files
indexed index create files -c docs-only -p ~/work/docs \
  --include ".*\.md$" --include ".*\.txt$"

# Skip drafts and work-in-progress files
indexed index create files -c final-docs -p ~/work/docs \
  --exclude ".*\.draft\.md$" --exclude ".*WIP.*"

Configuration (OCR, change tracking, chunking)

Tune OCR, change tracking, table extraction, and code chunking under [sources.files] (or indexed config set sources.files.<key> <value>). Defaults and key names are in Config commands; narrative setup is in the Configuration guide.

.indexed/config.toml
[sources.files]
path = "./documents"
include_patterns = ["*.md", "*.pdf", "*.py", "!*.tmp"]
fail_fast = false
respect_gitignore = true
ocr_enabled = true
table_structure = true
code_chunking = true
max_chunk_tokens = 512
change_tracking = "auto"

ocr_enabled defaults to true; set it to false to skip OCR for scanned PDFs and images. max_chunk_tokens applies in the parsing pipeline; embedding chunk size is core.v1.indexing.chunk_size (see Config commands).

Code Files

Code files with a tree-sitter grammar (.py, .ts, .go, .rs, .java, .c, .cpp, and more) always route to the code chunker. With code_chunking enabled (the default) it splits code at AST boundaries — functions, classes, and methods — rather than arbitrary line counts. Other code files fall back to line-based splitting.

Supported languages and formats

See Supported File Formats for the full list of file types, code languages with AST support, and plaintext formats.

Keep the Index Fresh

When your documents change, update only what's new:

Terminal
indexed index update project-docs

Indexed picks a change tracking strategy from sources.files.change_tracking (auto, git, content_hash, mtime, or none). See Parsing architecture and Config commands.

To automate updates:

crontab
# Update all Indexed collections every day at 8am (use the path from `which indexed`)
0 8 * * * /path/to/indexed index update 2>&1 >> ~/.indexed/update.log

If you need a clean re-index (e.g., after changing chunk size), use --force:

Terminal
indexed index create files -c project-docs -p ~/work/docs --force

Additional options

All indexed index create files flags and defaults: Index commands. OCR, change tracking, and patterns: Files connector and Configuration guide.

Troubleshooting

Unsupported file format error — Check the Supported File Formats list. If your format isn't listed, convert it to PDF or Markdown, which parse most reliably.

No results returned — Verify the collection exists with indexed index inspect <name>, then test from the CLI:

Terminal
indexed index search "your query here" -c project-docs

OCR not working on scanned PDFs — OCR is on by default (sources.files.ocr_enabled = true). If it was disabled in config, set it back to true, then re-create or update the collection (see Parsing architecture).

What's Next

On this page