Skip to main content
A query returns ranked chunks (passages of a source) with their source details. Choose what to search with type, how to match it with query_by, and how much retrieval work to do with mode.

Endpoint references

Decision flow

Parameters that matter

These parameters shape most queries. Query lists every request field and its rules.

Typical patterns

Each pattern is a complete request body. Query shows the same patterns as Python SDK, TypeScript SDK, and cURL calls.

Document Q&A from shared knowledge

Answer questions from files, tickets, pages, or other app sources.
Search the shared knowledge collection and the collection the user’s memories were ingested into. Both collections must already exist.
Search several collections and return one ranked result set. Use a list for equal weighting, or an object to give one collection more influence.
Top-level metadata_filters keys filter fields declared in database_metadata_schema. Free-form fields go under additional_metadata. All keys combine with AND. See Metadata Filters for operators.
Use query_by: "text" when literal wording matters: legal clauses, SKUs, error codes, IDs, or compliance references.

Response summary

By default, data.llm_prompt contains the question and retrieved context formatted for your model. Pass this string to the model to generate an answer. See Query for the model call and response formats. The response also includes ranked data.chunks[] with source IDs and titles, plus graph context and related chunks. Preserve chunk order when you format results yourself.
  • Query: every request and response field
  • Query guide: retrieval modes, ranking, and tuning
  • Metadata Filters: filter with schema-backed and free-form metadata
  • Query: graph context and forceful relations