Skip to main content
Use this page to choose the right query shape before opening the full Query endpoint reference. Query has three main decisions: what to query (type), how to match (query_by), and how much retrieval work to spend (mode).

Parameters that matter

For filter design, read Usage - Metadata before creating database schemas. For exact request fields, defaults, and response shape, use Query.

Typical patterns

Document Q&A from shared knowledge

Use this for standard RAG over docs, PDFs, tickets, pages, or app sources.
Use this when the answer should combine shared knowledge with user-specific context. Always pass the same collection used at memory ingestion.
Use this when the same question should search several collection scopes and return one globally ranked result set. Use a list for equal weighting, or an object when one scope should influence ranking more strongly.
Use metadata_filters when you already know the slice you want. Top-level keys match schema-backed metadata fields; declare hot filters in database_metadata_schema with enable_match: true. Free-form per-source fields go under additional_metadata (document_metadata is a legacy alias). Multiple filters are ANDed exact-match constraints.
Use text query when literal wording matters: legal clauses, SKUs, error codes, IDs, or compliance references.

Response summary

POST /query returns ranked data.chunks[], deduplicated data.sources[], optional data.graph_context, and optional data.additional_context from forceful relations. Preserve data.chunks[] order when building prompts; HydraDB has already ranked the results. For prompt formatting and citation patterns, see How to Use API Results.