Skip to main content
Workspace search is semantic, not substring: you ask in natural language and get back the passages that mean the same thing. Indexing covers more than text - images, audio, video, and PDFs are indexed by content too, so “the slide with the revenue waterfall” is a workable query. For exact strings and regular expressions, use grep instead. It is faster, needs no index, and never guesses.

Search a workspace

Check indexState before trusting an empty result

An empty results array with indexState: "unindexed" is not “nothing matched” - it is “ask again later”. Handle the two differently in any code that acts on the outcome.

Search an organization

One call fans out across every workspace in the organization you can access:
Pass workspaceIds to narrow it to a few workspaces instead of all of them.

Results respect file permissions

Search never leaks the existence of a file the caller cannot read. For members with access to specific files rather than the whole workspace, hits are filtered before the response is built, so counts cannot be used to infer what is hidden.

Managing the index

Files are indexed as they change, so a reindex is for recovery and for after a bulk import, not for routine use.

Agents search too

semantic_search is a built-in agent tool, so an agent working in the workspace can find a file it was never told about. That is the main reason to keep an index healthy on a workspace agents work in: it is the difference between an agent that can answer from your documents and one that can only read what you named.