Skip to main content
An index organizes your project’s files into a searchable tree. Leaf nodes (level 0) represent individual files, and higher-level nodes (level 1+) hold generated summaries that group related files—like folders. You can run fast lexical (BM25) search over the files, or navigate the hierarchy level by level.
Indexing is a newly released Dex capability. The API may change in future SDK versions.
The index lifecycle is: create → add/remove files (async) → search/navigate (sync) → delete.

Index vs. Vector Store

Indexes and vector stores are both retrieval primitives, but they serve different access patterns: Both can be combined as inputs to a research job.

Creating an Index

Indexing currently supports only the file-system index engine (FileSystemIndexCreateRequest). This engine builds the tree from the folder structure of your Dex project: folders are inferred from each file’s name, treating everything before the last / as the folder path. For example, a file named finance/2016/report.pdf becomes a leaf under a finance/2016 folder, with a parent finance folder above it. Folder nodes are summarized using the configured model and prompts.

Adding Files

add_files starts an async job and blocks until it completes. Adding files is best-effort per file, so the result reports which files succeeded and which failed.
To start the job without blocking, use start_add_files_job, which returns immediately so you can poll the job yourself:

Searching

search runs BM25 over the leaf nodes (files) and returns the most relevant matches.
Restrict the search to a subtree by passing current_node_id:

navigate ranks the children of a node so you can walk the tree from broad summaries down to individual files. Pass current_node_id=None to start from the root.

Removing Files and Deleting

Removing files is all-or-nothing: on success, every requested file is removed from the index.

Listing and Retrieving Indexes


Appendix: Essential Imports


Next Steps

  • Research: Run agentic research jobs that use indexes as input
  • Vector Stores: Semantic and hybrid search for RAG-enhanced extraction
  • Extract: Extract structured data from parse results or vector stores