Skip to main content
POST
/
api
/
v1
/
context
/
search
curl --request POST \
  --url https://platform-backend.getalchemystai.com/api/v1/context/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "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": "2023-11-07T05:31:56Z",
      "createdAt": "2023-11-07T05:31:56Z",
      "metadata": {},
      "content": "<string>",
      "score": 1.001
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Query Parameters

metadata
enum<string>
default:false

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.
Available options:
true,
false
mode
enum<string>
default:standard

Controls the search mode:

  • mode=fast → prioritizes speed over completeness.
  • mode=standard → performs a comprehensive search (default if omitted).
Available options:
fast,
standard

Body

application/json
query
string
required

The search query used to search for context data

Example:

"search query for user preferences"

similarity_threshold
number
required

Maximum similarity threshold (must be >= minimum_similarity_threshold)

Required range: 0 <= x <= 1
Example:

0.8

minimum_similarity_threshold
number
required

Minimum similarity threshold

Required range: 0 <= x <= 1
Example:

0.5

user_id
string
deprecated

The ID of the user making the request

Example:

"user123"

scope
enum<string>
default:internal

Search scope

Available options:
internal,
external
metadata
object

Additional metadata for the search

Response

Context search request successfully processed. Response structure varies based on metadata query parameter: if metadata=true, each context includes metadata; if metadata=false or omitted, metadata is excluded from the response.

contexts
object[]