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: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
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.
Related
- Tools - exact-match search with
grep - Files - reading what search points at
- Search API reference - every parameter