Skip to content

feat: add Vapi memory cookbook example#33

Draft
benfrank241 wants to merge 1 commit into
mainfrom
feat/vapi-cookbook
Draft

feat: add Vapi memory cookbook example#33
benfrank241 wants to merge 1 commit into
mainfrom
feat/vapi-cookbook

Conversation

@benfrank241

Copy link
Copy Markdown
Member

Summary

Adds `applications/vapi-memory/` — a runnable FastAPI webhook server that gives Vapi voice assistants persistent caller memory via hindsight-vapi.

  • `webhook_server.py` — FastAPI `/webhook` endpoint wired to `HindsightVapiWebhook`. Derives bank ID from `message.call.customer.number` so each caller gets their own memory.
  • `simulate_call.py` — POSTs Vapi's two server event shapes (`assistant-request`, `end-of-call-report`) to the local webhook, so the full retain → recall cycle can be exercised end-to-end without a real Vapi account or phone number.
  • `README.md` — walks through running the server, simulating calls, and wiring to a real Vapi assistant via ngrok.

Why draft

Depends on vectorize-io/hindsight#923 (the `hindsight-vapi` integration PR) merging and the package being published to PyPI. Once `pip install hindsight-vapi` works, this PR can be marked ready.

Test plan

  • `python3 -m py_compile webhook_server.py simulate_call.py` — clean
  • After hindsight-vapi releases: `pip install -r requirements.txt` succeeds
  • End-to-end: `docker run ghcr.io/vectorize-io/hindsight:latest`, `python webhook_server.py`, then run `simulate_call.py end-of-call-report` once and `assistant-request` afterwards — confirm `assistantOverrides.model.messages[0].content` contains the recalled memory

🤖 Generated with Claude Code

Adds applications/vapi-memory/ — a runnable FastAPI webhook server
demonstrating Hindsight memory across Vapi voice calls:

  - webhook_server.py exposes /webhook, recalls memories on
    assistant-request and retains transcripts on end-of-call-report
    via HindsightVapiWebhook
  - simulate_call.py POSTs the two Vapi event shapes locally so the
    full retain → recall cycle can be exercised without a real Vapi
    account or phone number
  - README walks through running the server, simulating calls, and
    wiring to a real Vapi assistant via ngrok

Memory is keyed per-caller (vapi:caller:{number}) so each phone number
gets its own bank that persists across calls.

Note: requires hindsight-vapi to be released — depends on
vectorize-io/hindsight#923 landing first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant