Documentation

Vapi

@mnemix-ai/vapi-kit is a real, published integration kit: assistant-request enrichment, per-turn caching, and post-call memory write-back for a Vapi voice assistant. It calls the same two frozen routes documented on Voice integration patterns — POST /v1/recall_and_enrich before the call, POST /v1/calls/end after — and nothing else. This is a Northsun-built, Northsun-maintained kit against Vapi's documented webhook contract — not a native Vapi feature or a certified Vapi integration.

Prefer zero package dependencies? The custom-HTTP Vapi guide maps the same two calls with plain fetch and no npm install at all.

Install

npm install @mnemix-ai/vapi-kit @mnemix-ai/client

Verified in a clean directory: @mnemix-ai/vapi-kit@0.3.0's peer dependency on @mnemix-ai/client@^0.2.1 resolves against the published @mnemix-ai/client@0.2.2, install exits 0, and both packages import clean.

@mnemix-ai/* is today's published scope. If your integration will outlive a possible future move to @northsun-ai/*, pin the version above rather than tracking latest.

Set your key

MNEMIX_KEY=sk_live_...
MNEMIX_BASE_URL=https://mcp.mnemix.ai   # optional; this is the default
VAPI_WEBHOOK_SECRET=...                 # shared secret from your Vapi assistant, recommended

MNEMIX_KEY is your Northsun API key — see Installation for how to get one. Set it as a platform secret (wrangler secret put MNEMIX_KEY on Cloudflare Workers, or your platform's equivalent), never as a plaintext environment value in a repo or client bundle.

MNEMIX_KEY is the kit's own Env binding name (matches its published source and README), a different name than the CLI's MNEMIX_API_KEY from Installation — same key value, two independent surfaces, name whichever variable you're setting for whichever tool reads it.

Wire the webhook

The kit's Cloudflare Worker example exposes one route, /vapi/server, that handles Vapi's assistant-request, per-turn function-call, and end-of-call-report messages:

import { Mnemix } from "@mnemix-ai/client";
import { handleVapiEndOfCallReport, handleVapiServerUrl } from "@mnemix-ai/vapi-kit";

const mnemix = new Mnemix({ apiKey: env.MNEMIX_KEY, baseUrl: env.MNEMIX_BASE_URL });
// route assistant-request / function-call to handleVapiServerUrl(...)
// route end-of-call-report to handleVapiEndOfCallReport(...)

In your Vapi assistant configuration, set:

server.url = https://your-worker.example.com/vapi/server

Vapi calls that URL for every relevant lifecycle event; the key never leaves your server.

Use the context in your prompt

The kit exposes recall as assistant variable values, not raw JSON, so your prompt template stays readable:

  • {{caller_name}}
  • {{is_returning}}
  • {{last_call_summary}}
  • {{suggested_intent}}
  • {{carrier}}
  • {{company}}
  • {{role}}

See What recall gives you back for what populates these and when a value is legitimately absent rather than wrong.

Verify it

Call the Vapi number attached to your assistant. In your worker logs you should see one recall on the first assistant-request, the same cached context reused on later per-turn function-call events for that call.id, and one POST /v1/calls/end when Vapi sends end-of-call-report. See Hangup, and what happens next for what happens immediately after that call.

Next steps