Skip to content

Search and filters

Agents search datasources automatically. You can also search them directly, for example to test your data or to build your own search feature.

EndpointUse it for
GET /api/v1/retrieveSemantic search by meaning
GET /api/v1/retrieve_with_rerankSemantic search where the best candidates are ranked again for higher precision
GET /api/v1/retrieve_hybridCombined semantic and keyword search. Good for part numbers, error codes and other exact terms.
POST /api/v1/data/datasources/{name}/filtersFind content by metadata only, without a search text. See Filter by metadata only.
ParameterEndpointsDescription
searchAllThe search text
datasourcesAllComma-separated datasource names
similarity_top_kAllNumber of results, or of candidates for reranking and hybrid search
metadata_filtersAllOptional RQL filter, see below
search_contextRerankAdditional context for ranking, for example the user’s previous question
rerank_top_nRerankNumber of results returned after reranking
sparse_top_kHybridNumber of keyword candidates

Example:

GET /api/v1/retrieve_hybrid?search=error%20E23%20CAM-45&datasources=ProductManuals&similarity_top_k=5&sparse_top_k=5
Authorization: Bearer ${SQE_TOKEN}
X-Tenant-ID: ${TENANT_ID}

Filters use RQL expressions on document metadata:

ExpressionMatches
eq(device_model, "CAM-45")Equal
gt(date, "2025-01-01")Greater than
in(category, ["hardware", "software"])One of several values
and(eq(device_model, "CAM-45"), eq(document_type, "manual"))All conditions
or(eq(error_code, "E23"), eq(error_code, "E24"))Any condition

Filters only work well if metadata is consistent. See Ingestion best practices.

When you know exactly which attributes you are looking for, you do not need a semantic search. The filter endpoint returns the nodes of one datasource whose metadata matches an RQL expression:

POST /api/v1/data/datasources/ProductManuals/filters?metadata_filters=and(eq(device_model,"CAM-45"),eq(document_type,"manual"))&top_k=20&sort=-page_number
Authorization: Bearer ${SQE_TOKEN}
X-Tenant-ID: ${TENANT_ID}
ParameterDescription
metadata_filtersRequired. RQL expression, see Metadata filters.
top_kMaximum number of nodes. Default: 10.
sortOptional. Comma-separated metadata fields. Prefix a field with - for descending order, for example -created.

URL-encode the query parameters in your client.

Typical uses:

  • List the latest documents of a type, for example the five most recent shift reports.
  • Check which content exists for a device or a plant after loading data.
  • Retrieve content by an exact attribute, for example a ticket number, where meaning does not matter.

The caller needs access to the datasource. See Roles and permissions.

SituationRecommended
Natural language questionsretrieve
Many similar documents, precision mattersretrieve_with_rerank
Questions with codes, IDs or exact product namesretrieve_hybrid
A known subset of documentsAny endpoint with metadata_filters
Exact attributes, no search textThe filter endpoint