Documents

Search documents

Finds passages in the project's Datasphere knowledge store that are semantically relevant to a query. Use the results as grounded context for an AI application; use List documents to browse the source documents instead.

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: DataSphere.

Learn more about API scopes.

post/api/datasphere/documents/search

Request body

tagsstring[]

Document tags.

document_idstring uuid

Universal Unique Identifier.

query_stringstring required

Search term.

distancenumber

Specifies how closely related the query is to the document. Low distance means high relevance and similarity. High distance means low relevance and similarity.

countinteger

Specifies number of returned Chunks.

languagestring

Language of the Document.

pos_to_expandstring[]

Part of Speech considered for expansion or analysis.

max_synonymsinteger

Maximum number of synonyms to consider.

Example request

{
  "tags": [
    "sports",
    "football",
    "game"
  ],
  "query_string": "Most paid athlete",
  "distance": 2,
  "count": 5,
  "language": "fr",
  "pos_to_expand": [
    "NOUN",
    "VERB"
  ],
  "max_synonyms": 7
}

Response

The request has succeeded.

Example response

{
  "chunks": [
    {
      "text": "Cristiano Ronaldo is the highest-paid football player in the world in 2024"
    }
  ]
}

Changes

No changes found, but 3 of the 137 revisions have a changelog that could not be searched — this endpoint may have changed in one of them.