retrieval command group is the CLI surface for the retrieval subsystem: the layer between agent queries and your knowledge.
Commands
retrieval search
<query>(positional): the text to search.--preset <preset-id>: use a saved preset (see below).--k <n>: top-K to return.--method vector|keyword|hybrid|kg_rooted: retrieval mode.--filters <json>: full FiltersBody shape (documentIds/pipelineIds/tags/kgInstanceId/kgOnly/kgScopeNodeId/excludeDocumentIds).@file/@-accepted.--include-subgraph: include the compact triples subgraph walked from the top KG-rooted hit (requires a bound KG).--graph-expansion: spreading activation over ontology edges (KG-in-scope required).--routing-mode pinned|auto:pinned(default, uses--preset) vsauto(router picks presets from query intent).--target-type <type-id>: aim the hybrid pool at these chunk types (reserved slots + boost, hybrid only). Repeatable. Valid ids come fromretrieval type-profile show.--target-entity <entity>: aim at chunks tagged with these entities. Repeatable.--expand-window <n>: pullnneighbour chunks around each hit for parent-section context (0 = off).--reserved-per-type <n>: min reserved top-k slots per target type.
--preset, uses the workspace default preset.
retrieval diagnose
Presets
Presets bundle retrieval settings (top-K, weights, filters, reranker) so multiple Agents can share one config.List
Get
Upsert
<id>(positional, required): the preset’s ID.--name <n>(required): display name.--config <json>(required): the full preset config. See Retrieval presets for the field reference.
Delete
Type-aware retrieval
Chunk typing tags each chunk with a type (heading, table, policy_clause, benefit_table, …) at ingest so retrieval can aim at the right shape of content. The workspace has one active typing profile: eithergeneric (domain-neutral default), a built-in domain profile like insurance, or a custom profile the operator defines.
type-profile show
retrieval search --target-type <id>.
type-profile set
generic, insurance) work, as do custom ids from custom put. Does not re-type existing chunks. Run backfill right after if you want the current corpus re-classified.
type-profile backfill
{scanned, typed, abstained}.
type-profile custom
Custom profiles are for domains that don’t ship built-in (e.g. legal, medical). Built-in profiles are managed in code.
custom put is a bulk replace: the full array is what gets stored, so anything not in the payload is removed. Each item shape:
id non-empty + unique + must not shadow generic / insurance.
Recipes
Iteratively tune a preset
Compare two presets side-by-side
Test retrieval isolation between tenants
Attach a preset via agents sources update
Once a preset is dialed in, attach it to an Agent’s data source:
nora agents for full source attachment options.
What the CLI does NOT do
- Save retrieval results to a dataset use the app’s Trace view for that (search a trace, add the retrieval step to a dataset).
- Configure grounding graphs directly grounding is enabled via preset config (
{"grounding": {"graph_id": "..."}}), but graph editing is vianora causal.
Debugging queries
- Add
--jsonfor the raw score breakdown per result. - Try
--method vector, then--method keywordseparately to see which pass is stronger. - If the right chunk exists but doesn’t rank,
retrieval diagnoseon a cluster containing similar queries usually explains why.