Skip to content

There

There is a huge gap in the patient to doctor ratio in India and especially in the rural villages, patients have no access to even primary care.

Core trick

Claude calls MCP database tools while a post-session agent extracts structured clinical notes from bilingual English and Hindi voice consultations.

Tags

Description

There is a huge gap in the patient to doctor ratio in India and especially in the rural villages, patients have no access to even primary care. LLMs like Claude are great at reasoning but are not accessible to remote villages due to language barriers. In addition to this doctors don't have access to the latest agentic workflows to update EHRs and get SOAP notes. Second opinion AI is a completely agentic app that is multi-lingual uses routing to optimize for extended thinking and automatically compresses context from huge EHRs Doctor Portal: https://second-opinion-ai-doctor.vercel.app Login: Email: doctor@demo.secondopinion.ai password: doctor123456 Patient portal: https://second-opinion-ai-patient.vercel.app Login: Email: demo@secondopinion.ai Password: demo1234
nikhil-nakhate/second-opinion-ai★ 00 forksTypeScriptCreated Feb 12, 2026 · last push Feb 18, 2026

README excerpt

# Second Opinion AI

AI-powered medical second opinion platform with bilingual voice support. Patients consult an AI doctor through text or voice (English and Hindi), and doctors review AI-generated clinical records on a separate portal.

Built with an agentic architecture — Claude uses MCP tools for all database operations and autonomously extracts structured clinical data from conversations.

## Architecture

```
apps/
  patient/          Next.js 16 — Patient portal (text + voice consultations)
  doctor/           Next.js 16 — Doctor review dashboard
packages/
  shared/           Shared library (conversation engine, speech APIs, prompts)
mcp/
  tools/            10 MCP tool handlers (all database operations)
  server.ts         MCP server (stdio transport)
  post-session-agent.ts   Agentic post-session extraction pipeline
server/
  ws-server.ts      WebSocket server for voice consultations
  session-manager.ts
supabase/
  migrations/       Database schema (patients, sessions, visit records, etc.)
```

### Key Design Decisions

- **MCP tool layer**: All Supabase operations go through 10 typed tool handlers, used both as importable functions and via the MCP protocol
- **Agentic conversation engine**: Claude calls tools during conversation (`flag_emergency`, `update_session_notes`, `get_patient_context`) via a `tool_use` loop
- **Agentic post-session pipeline**: After a session ends, a Claude agent autonomously extracts a structured visit record, writes a clinical summary, and

Team