Skip to main content
POST
Create a deep search

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Deep search creation parameters

knowledge_base
object
required

Knowledge base configuration. Determines which content to search.

Three source modes are supported:

  • collections: Search within specific collections
  • files: Search specific files by URL or file ID (uses default index)
  • default: Search all default-indexed files for the account
query
string
required

The search query.

Minimum string length: 1
scope
enum<string>

The scope of results to return. 'segment' returns individual segments, 'file' returns file-level results — explicit values behave exactly as before, and every collection in the knowledge base must be searchable at the requested scope (metadata and file-level entities collections require 'file'; segment-level entities collections require 'segment'). Omit for auto: the search planner picks a scope per search plan, each collection is searched at the scopes its documents support, and results from both scopes are fused — so a knowledge base can mix collection types (e.g. rich-transcripts + metadata + entities) without a scope.

Available options:
segment,
file
limit
integer
default:20

Maximum number of results to return. Actual count may be lower when exclude_weak_results is enabled.

Required range: 1 <= x <= 500
exclude_weak_results
boolean
default:false

When true, removes results tagged as weak matches by the synthesis LLM.

include
enum<string>[]

Additional fields to include in the response. 'search_queries' includes the intermediate search query plan.

Available options:
search_queries
stream
boolean
default:false

Stream the response via SSE. Mutually exclusive with background.

background
boolean
default:false

Process in the background. Returns immediately with status 'in_progress'. Mutually exclusive with stream.

Response

Deep search created successfully

id
string<uuid>

Deep search ID

object
enum<string>

Object type identifier

Available options:
deep_search
status
enum<string>

Current status of the deep search

Available options:
in_progress,
completed,
failed,
cancelled
created_at
number

Unix timestamp of when the deep search was created

query
string

The original search query

scope
enum<string> | null

The scope the caller requested. Null when the request omitted scope (auto: the planner chose scopes per search plan, so results may mix segment and file types).

Available options:
segment,
file
text
string | null

LLM-generated synthesis text summarizing the results

results
object[] | null

Array of search results

total
integer

Total number of results

limit
integer

Maximum number of results requested

search_queries
object[] | null

Intermediate search query plans (included when requested via include=['search_queries'])

usage
object | null

Token and search call usage

error
object | null

Error details if the deep search failed