Skip to main content
POST
/
deepSearch
Create a deep search
curl --request POST \
  --url https://api.cloudglue.dev/v1/deepSearch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "knowledge_base": {
    "source": "collections",
    "collections": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "filter": {
      "metadata": [
        {
          "path": "<string>",
          "operator": "NotEqual",
          "valueText": "<string>",
          "valueTextArray": [
            "<string>"
          ],
          "scope": "file"
        }
      ],
      "video_info": [
        {
          "path": "duration_seconds",
          "operator": "NotEqual",
          "valueText": "<string>",
          "valueTextArray": [
            "<string>"
          ],
          "scope": "file"
        }
      ],
      "file": [
        {
          "path": "bytes",
          "operator": "NotEqual",
          "valueText": "<string>",
          "valueTextArray": [
            "<string>"
          ]
        }
      ]
    }
  },
  "query": "<string>",
  "scope": "segment",
  "limit": 20,
  "exclude_weak_results": false,
  "include": [
    "search_queries"
  ],
  "stream": false,
  "background": false
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "object": "deep_search",
  "status": "in_progress",
  "created_at": 123,
  "query": "<string>",
  "scope": "segment",
  "text": "<string>",
  "results": [
    {
      "type": "segment",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "collection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "score": 123,
      "context": "<string>",
      "segment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "start_time": 123,
      "end_time": 123,
      "title": "<string>",
      "filename": "<string>",
      "thumbnail_url": "<string>",
      "metadata": {},
      "summary": "<string>",
      "generated_title": "<string>"
    }
  ],
  "total": 123,
  "limit": 123,
  "search_queries": [
    {
      "query": "<string>",
      "search_modalities": [
        "<string>"
      ],
      "scope": "<string>",
      "filter": {},
      "result_count": 123
    }
  ],
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "total_tokens": 123,
    "search_calls": 123
  },
  "error": {
    "message": "<string>",
    "type": "<string>",
    "code": "<string>"
  }
}

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>
default:segment

The scope of results to return. 'segment' returns individual segments, 'file' returns file-level results.

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>

The scope of the search results

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

Token and search call usage

error
object

Error details if the deep search failed