Skip to content
focoit.com
Back to the canvas

Architecture

Orchestration and agentic retrieval

A workflow graph that drives a knowledge layer: query planning, parallel subqueries over per-study sources, and synthesis with references.

Orchestration and agentic retrieval A code-defined workflow graph receives requests from callers and other agents, checks a determinism cache and, on a miss, runs an agentic retrieval knowledge layer: query planning, parallel subqueries over per-study sources, and synthesis with references. Grounding returns to the graph, which routes each step to a model through a model router. Every step and the retrieval activity log land in audit. CONSUMERS Callers site users · other agents agents come in through a governed MCP tool Workflow graph code-defined order · checkpointed … → Draft → Verdict → Review → Deliver SHARED SERVICES Determinism cache reviewed answers only a hit costs no model call Model router Azure OpenAI: PHI (BAA) Claude: non-PHI reasoning pinned version → cache key Audit App Insights + compliance store every step · activity log token counts AGENTIC RETRIEVAL · KNOWLEDGE LAYER Query planning LLM decomposes the question into subqueries effort: min · low · med Parallel subqueries keyword · vector · hybrid + semantic rerank Synthesis merged grounding + citations + activity log Per-study sources one index per study REQUEST CACHE LOOKUP RETRIEVE (MISS) GROUNDING + REFERENCES MODEL PER STEP LEGEND Request path Audit Orchestrator Service Store / cache
Reference designOpen full size

What it shows

The orchestrator is a workflow graph with a fixed, checkpointed order. Callers and other agents reach it; agents come in through a governed MCP tool, under the same permissions as a person.

Retrieval is agentic: a model decomposes the question into subqueries, they run in parallel as keyword, vector or hybrid searches with semantic reranking, each over the index of one study, and a synthesis step merges the grounding with its citations.

Three shared services sit beside the graph. A determinism cache returns reviewed answers without a model call. A model router sends each step to the right model, with the version pinned. Audit receives every step, the retrieval activity log and the token counts.

This is a reference design for an agentic clinical-trials Q&A assistant. It is a design, not a description of a system built as shown.

Key decisions

  • One index per study: isolation is structural, not a filter that can be forgotten.
  • The effort of query planning is a setting per query class, because planning costs tokens and time.
  • Models are pinned by version, and the version is part of the cache key and of the audit record.
  • Other agents get one permissioned tool server, not a point-to-point integration each.