Skip to content

darylalim/corti-agentic-assistant

Repository files navigation

Corti Medical Assistant

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.

Wired-up experts

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

Setup

  1. Get credentials from the Corti Console (Developer Quickstart → API credentials).

  2. Fill in .env (already scaffolded, gitignored):

    CORTI_TENANT_NAME=...
    CORTI_CLIENT_ID=...
    CORTI_CLIENT_SECRET=...
    CORTI_ENVIRONMENT=eu
  3. 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.

Architecture

  • lib/agent.ts — server-only CortiClient + singleton ephemeral agent (created once on boot) and an A2AClient subclass that injects Corti auth headers into every outbound request, including the agent-card fetch.
  • app/api/chat/route.ts — POST endpoint: buildParams(messages)sendMessageStreamtoUIMessageStream, wrapped in a 180s idle-timeout so a hung expert can't hold the request open forever.
  • app/page.tsx — chat UI on useChat from @ai-sdk/react: streamed markdown answers, orchestrator status cues, per-turn credit usage (4 decimals), and context-preserving multi-turn memory (the adapter propagates contextId; "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.

About

Build a clinical chat assistant with the Corti Agentic Framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors