Logo Lanfrica

justinunderhill/medical_aid_navigator

Domaine:

healthcare
Créateur:
jus
Hôte:
Medical Aid Navigator is a proposed AI-assisted digital tool designed to help South African medical aid members understand what to do before, during, and after using their medical aid benefits. The product is not intended to provide medical diagnosis, treatment advice, financial advice, broker advice, or guaranteed claim outcomes. # Medical Aid Navigator — MVP An educational, AI-assisted tool that helps South African medical aid members understand what to ask, check, and document **before, during, and after** using their benefits. > **Not** medical, legal, broker, or financial advice. **Not** a guarantee of any > claim outcome. Scheme-neutral. Anonymous by default. --- ## Quick start (VS Code) ```bash # 1. Install dependencies npm install # 2. Set up environment cp .env.example .env.local # then edit .env.local and add your keys (see below) # 3. Run the dev server npm run dev # open localhost ``` ### Required environment variables Anthropic is the operative default provider for this MVP. OpenAI remains available through the same provider interface by setting `AI_PROVIDER=openai`. | Variable | Needed for | Notes | |---|---|---| | `AI_PROVIDER` | choosing AI | `anthropic` (default) or `openai` | | `ANTHROPIC_API_KEY` | AI (default) | from console.anthropic.com | | `ANTHROPIC_MODEL` | AI | defaults to `claude-sonnet-4-6` | | `OPENAI_API_KEY` | AI (only if `AI_PROVIDER=openai`) | required only for OpenAI mode | --- ## Scripts | Command | What it does | |---|---| | `npm run dev` | Local dev server | | `npm run build` | Production build | | `npm start` | Run the production build | | `npm run typecheck` | TypeScript check (no emit) | | `npm run lint` | ESLint | | `npm test` | Vitest safety and request-validation tests | --- ## How it works (the safety-first pipeline) A request to `/api/navigate` runs in this order: 1. **Rate limit** (basic per-IP safeguard). 2. **Deterministic emergency detection** — `src/lib/safety/emergency.ts`. This runs *before* and *independently of* the AI. If it's an emergency, the user gets static, hard-coded urgent-care guidance even if the AI is down. 3. **Grounded AI generation** — the AI is given only our own knowledge base (`/content`) and is told not to invent scheme rules. 4. **Output validation** — `src/lib/safety/outputValidator.ts …