Skip to main content

Research AI — Overview

Seven specs (SPEC-01 through SPEC-07) deliver the full research / AI infrastructure. All shipped as of 2026-04-23.

SPECService(s)Capability
SPEC-01memory-storeKnowledge graph (entities / relationships / claims) + consent-hardened repo + BAA governance + MCP server
SPEC-02research-engine5 agents (Researcher · Critic · Correlator · Replicator · Librarian) · 12 trusted sources · change-stream promotion pipeline · dual-LLM w/ audited fallback
SPEC-03orchestrator6-phase hypothesis candidate lifecycle · emergency path · detectors · scheduler · feasibility scoring · stakeholder approval
SPEC-04model-optimizationDecision graph (15 node types) · eval harness (DPO pair builder) · outcome feedback loop · Socket.IO real-time UI
SPEC-05memory-storeHybrid Retrieval Core — rule-based query classifier + 4 routes (GRAPH · AGG · TEXT · HYBRID) + context serializer + HTTP + SDK
SPEC-06research-engine + orchestratorConsumer integration — Researcher · Critic · Correlator · Detectors all wired to MemoryClient.retrieve() with rollout flags + fail-soft fallback
SPEC-07model-optimization250-query × 5-strategy benchmark harness + Azure Monitor KQL + workbooks + alerts + compliance-probe regression gates
SPEC-063research-engine + memory-storeSource authority tiers (NEJM/JAMA/Cochrane/NCCN tier-1, PubMed/Elsevier/Wiley/LWW/CT.gov/ClinVar/DrugBank tier-2, patient-note tier-3) + Critic verdict.score persistence + opt-in FreshnessConfidenceJob
SPEC-064memory-store + apps/webNumeric 0..1 freshness scorer (compute_freshness) + RetrievalResult.per_claim_freshness + FreshnessBadge UI chip

See the Research AI block diagram for the full mermaid chart of these services + agents + routes + sources.

Design commitments

  1. Evidence traceability — every AI output cites its sources. Every retrieval emits memory.retrieval.hybrid with count-only entity references.
  2. Dual-LLM with audited fallback — OpenAI GPT-4o primary; Gemini 2.0 Flash fallback. Every fallback emits llm_provider_fallback audit + HCP toast.
  3. FDA CDS-exemption posture — every AI response carries metadata: disclaimer, model, confidence, fda_cds_exemption_ref, fallback_occurred. Never the sole basis for a clinical action.
  4. Progressive rollout flags — 4 consumer flags (USE_HYBRID_RETRIEVAL_RESEARCHER, USE_HYBRID_CRITIC_EXPANSION, USE_HYBRID_CORRELATOR_EXPANSION, USE_HYBRID_ORCHESTRATOR) for staged cutover from legacy BM25.
  5. Fail-soft everywhereMemoryRetrievalError on 503 → legacy BM25 fallback + consumer.retrieval_fallback audit. LLM 5xx/429 → Gemini fallback. Source connector error → empty hits + WARNING log (no exceptions).
  6. Source authority weighting (spec 063) — 12 connectors mapped to 3-tier SourceTier enum; Critic prompt rule #8 forbids tier-3 → tier-1 supersession. Unknown connector → tier-3 fail-safe.
  7. Per-claim freshness (spec 064) — every retrieval response carries per_claim_freshness: list[{claim_id, freshness, freshness_half_life_days}]. Tier-driven exponential decay (2^(-age/half_life)). Surfaces as the FreshnessBadge UI chip and as the optional FreshnessConfidenceJob re-research trigger.

Subsections