A clinical chat assistant built on the Corti Agentic Framework: type a clinical question, the agent routes it to the right specialist expert, and streams back an evidence-backed answer with inline activity indicators.
| Expert | What it does |
|---|---|
pubmed-expert |
Biomedical literature search and abstracts |
coding-expert |
ICD-10 / CPT diagnosis and procedure codes |
clinical-trials-expert |
Active and past clinical trials |
medical-calculator-expert |
Clinical calculators and scores |
web-search-expert |
Current information from the web |
-
Get credentials from the Corti Console (Developer Quickstart → API credentials).
-
Fill in
.env(already scaffolded, gitignored):CORTI_TENANT_NAME=... CORTI_CLIENT_ID=... CORTI_CLIENT_SECRET=... CORTI_ENVIRONMENT=eu
-
Install and run:
npm install npm run dev
Open http://localhost:3000 (desktop, ≥1280px). Use the "Try sample" buttons to exercise each expert. Multi-expert answers can take 30–90s — watch the inline "calling …-expert" status indicators and the elapsed counter; Cancel aborts an in-flight request.
lib/agent.ts— server-onlyCortiClient+ singleton ephemeral agent (created once on boot) and anA2AClientsubclass that injects Corti auth headers into every outbound request, including the agent-card fetch.app/api/chat/route.ts— POST endpoint:buildParams(messages)→sendMessageStream→toUIMessageStream, wrapped in a 180s idle-timeout so a hung expert can't hold the request open forever.app/page.tsx— chat UI onuseChatfrom@ai-sdk/react: streamed markdown answers, orchestrator status cues, per-turn credit usage (4 decimals), and context-preserving multi-turn memory (the adapter propagatescontextId; "New chat" starts a fresh context).
Dependency versions are pinned exactly — ai@6.0.0, @corti/ai-sdk-adapter@0.1.1,
and @a2a-js/sdk@0.3.0 are version-sensitive; don't upgrade without testing.