Skip to main content
Every context type generates a {context_id}_itemsVectorSearch query that searches the context’s embedded chunks and returns them joined with parent-item metadata. It is the same retrieval engine agents use — available to you directly over GraphQL. The generated signature, for a context with ID product_docs:
The context must have an embedder configured; the query text is preprocessed (language detection and stemming) and, when the context defines a queryRewriter, rewritten before searching. limit defaults to 10 (or the context’s maxRetrievalResults) and is capped at 250.

Search methods

Despite its name, chunk_cosine_distance holds a similarity — computed as 1 - cosine distance — so 1.0 means identical direction and higher is better.

Cutoffs

Cutoffs are minimum scores; anything below is dropped. When omitted they fall back to the context’s configured cutoffs, and otherwise to 0 (no cutoff).
  • cosineDistance — minimum similarity, on the same 0–1 scale as chunk_cosine_distance. 0.35 is a reasonable starting floor for prose.
  • tsvector — minimum full-text rank.
  • hybrid — minimum hybrid score on a 0–100 scale, matching the returned chunk_hybrid_score. For hybridSearch you can additionally bound the components with the other two cutoffs.

Context expansion

Retrieval returns the chunks that matched — often mid-paragraph. expand fetches up to before/after neighboring chunks (by chunk_index, within the same item) around every hit, deduplicates, and returns the final list ordered by item and chunk index. Expanded neighbors carry score 0 — treat scores as ranking signals for matched chunks only. Defaults come from the context’s configuration, otherwise no expansion.

Item filters and access control

itemFilters uses the context’s regular filter type and applies to the parent items, not the chunks — for example, restrict a search to non-archived guides with [{ category: { eq: GUIDE } }, { archived: { ne: true } }]. Row-level RBAC is enforced on the parent items too: you only ever get chunks from items you are allowed to read.

Worked examples

Semantic search with a cutoff and expansion:
Hybrid search — best default when queries mix natural language with exact terms (error codes, product names):
Full-text only — exact keyword matching, no semantic smoothing:

Entity filters and insights

Contexts with the entity layer enabled can constrain and enrich searches with the entity graph:
Pass entity IDs, or type/name pairs to be resolved for you. mode is "any" (default — a chunk must mention at least one of the entities) or "all" (must mention every one):
When the entity layer is active, the engine also extracts entities from the query itself, applies a soft ranking boost to chunks sharing them (nothing is excluded), and reports what it found in entityInsights.

Result shape

The context object identifies what was searched — name, id, and the embedder model. (The generated type is named VectoSearchResultContext; the missing “r” is in the schema itself.) The returned query is the preprocessed form actually used for matching. Score fields are populated per method, as in the table above. To fetch a single chunk later — for example to render a citation — use the companion query:

Next steps

Knowledge pipeline

How items become chunks and embeddings in the first place.

Entities

Configure the entity layer that powers filters and insights.