Context

Search for context data in the context processor

POST
/api/v1/context/search

This endpoint sends a search request to the context processor to retrieve relevant context data based on the provided query.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

metadata?string

Controls whether metadata is included in the response:

  • metadata=true → metadata will be included in each context item in the response.
  • metadata=false (or omitted) → metadata will be excluded from the response for better performance.
Default"false"

Value in

  • "true"
  • "false"
mode?string

Controls the search mode:

  • mode=fast → prioritizes speed over completeness.
  • mode=standard → performs a comprehensive search (default if omitted).
Default"standard"

Value in

  • "fast"
  • "standard"

Request Body

application/json

user_id?string
Deprecated

The ID of the user making the request

query*string

The search query used to search for context data

similarity_threshold*number

Maximum similarity threshold (must be >= minimum_similarity_threshold)

Range0 <= value <= 1
minimum_similarity_threshold*number

Minimum similarity threshold

Range0 <= value <= 1
scope?string

Search scope

Default"internal"

Value in

  • "internal"
  • "external"
body_metadata?

Additional metadata for the search

Default{}

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/context/search" \  -H "Content-Type: application/json" \  -d '{    "query": "What did the customer ask about pricing for the Scale plan?",    "similarity_threshold": 0.8,    "minimum_similarity_threshold": 0.5,    "scope": "internal"  }'
{  "contexts": [    {      "updatedAt": "2019-08-24T14:15:22Z",      "createdAt": "2019-08-24T14:15:22Z",      "metadata": {},      "content": "string",      "score": 0.001    }  ]}