Skip to main content

Agents (Unified Architecture)

Clinical Corvus uses specialized agents inside its own control plane. Corvus retains responsibility for policy, budgets, state, evidence, and response shape so outputs remain reviewable across runtimes.

Architecture Overview

Corvus coordinates the clinical flow. BAML provides structured functions, and Langroid participates in selective agent or task paths when the same contracts are preserved:

┌─────────────────────────────────────────────────────────────────┐
│ Frontend (UI) │
│ AgentQueryInterface │ CorvusAgentPanel │ SmartClipboard │
└─────────────────────────────┬───────────────────────────────────┘
│ HTTP/SSE
┌─────────────────────────────▼───────────────────────────────────┐
│ API Layer (FastAPI) │
│ /api/agents/tasks/* │ /api/agents/chat │ /api/clipboard/* │
└─────────────────────────────┬───────────────────────────────────┘

┌─────────────────────────────▼───────────────────────────────────┐
│ Agent Orchestration Layer │
│ TaskOrchestrator │ BudgetManager │ ProblemProfile │
└─────────────────────────────┬───────────────────────────────────┘

┌─────────────────────┼─────────────────────┐
▼ ▼ ▼
┌───────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ CDA │ │ Compass │ │ CRA │
│ (Clinical │◄─►│ Controller │◄─►│ (Clinical │
│ Reasoning) │ │ Plan/Verify/ │ │ Research) │
│ │ │ Pivot/Stop │ │ │
└───────┬───────┘ └─────────────────┘ └────────┬────────┘
│ │
▼ ▼
┌───────────────┐ ┌─────────────────────┐
│ BAML Layer │ │ Search Policy │
│ (Structured │ │ Service │
│ Outputs) │ │ Tier 1: RAG+PubMed │
│ │ │ Tier 3: Paid APIs │
└───────────────┘ └─────────────────────┘
│ │
▼ ▼
┌───────────────┐ ┌─────────────────────┐
│ Patient │ │ Hybrid RAG │
│ Context │ │ BM25 + Vector + │
│ Manager │ │ HyDE + Reranking │
└───────────────┘ └─────────────────────┘

Core Components

Clinical Discussion Agent (CDA)

The primary clinician-facing agent. Responsibilities:

  • Clinical reasoning: case synthesis, differential diagnosis discussion
  • Conversation management: maintains context across turns
  • Escalation decision: decides when to invoke the CRA or request clarification
  • Structured answer: produces structured responses with evidence and uncertainty

The CDA classifies each request into reusable dimensions (task_type, decision_horizon, context_sufficiency, answer_shape).

Clinical Research Agent (CRA)

Specialized evidence retrieval agent. Invoked when the CDA identifies a need for research:

  • Federated search: simultaneous queries to PubMed, Europe PMC, OpenAlex, Lens
  • Local hybrid search: BM25 + vector search via Hybrid RAG Service
  • Tiered search policy: Tier 1 (free), Tier 3 (paid APIs, opt-in)
  • Bounded retrieval: controlled recovery paths to avoid excessive expansion
  • Evidence ledger: record of admitted, rejected, weak, contradictory evidence

Compass Controller

Orchestrates the CDA reasoning loop following Plan/Verify/Pivot/Stop:

  • Plan: what is needed to answer? (guideline, tool, knowledge)
  • Verify: does the draft meet safety and evidence standards?
  • Pivot: if evidence insufficient, delegate to CRA or request clarification
  • Stop: terminate when there is sufficient support or budget is exhausted

Task Orchestrator

Manages multi-agent task lifecycle:

  • Async execution: tasks run in background
  • Response shaping: formats the final response with all required metadata

Other Components

  • BudgetManager: controls per-task token limits
  • EscalationPolicy: governs when to escalate, stop, or request clarification
  • Patient Context Manager: aggregates patient data for agent context

Response Contract

All agent responses follow a structured contract:

  • primary_answer: main response
  • research_telemetry: execution mode, evidence ledger
  • evidence: all evidence with IDs, admitted/rejected counts
  • safety: safety flags, review recommended
  • answer_state: normalized answerability state (ready/partial/insufficient/blocked/review)
  • citations: references with title, URL, date, journal

Response States

StateMeaning
readyResponse with adequate evidence
partialPartial response with stated uncertainty
insufficientInsufficient evidence to answer
blockedRequest blocked (out of beta scope)
reviewRequires clinical review before use

Governance and Safety

  • Data sharing controls disabled by default
  • Audit logging for all actions with hashed identifiers
  • HITL (Human-in-the-Loop) pause support