Skip to content

feat(vapi): add Vapi voice AI webhook memory integration#923

Open
benfrank241 wants to merge 3 commits intomainfrom
feat/vapi-integration
Open

feat(vapi): add Vapi voice AI webhook memory integration#923
benfrank241 wants to merge 3 commits intomainfrom
feat/vapi-integration

Conversation

@benfrank241
Copy link
Copy Markdown
Contributor

Adds Hindsight persistent memory to Vapi voice AI calls via a webhook handler.

How it works

Unlike Pipecat (per-turn frame processor), Vapi injects memory once per call via webhooks:

  • assistant-request — recalls memories for the caller (keyed to phone number) and returns assistantOverrides with a system message containing those memories
  • end-of-call-report — retains the full call transcript asynchronously (fire-and-forget, never delays the webhook response)
  • All other event types — returns None (HTTP 200 no-op)

Outbound call helper: build_assistant_overrides(query) for injecting memory at call creation time.

Usage

from fastapi import FastAPI, Request
from hindsight_vapi import HindsightVapiWebhook

app = FastAPI()
memory = HindsightVapiWebhook(bank_id="user-123", hindsight_api_url="...")

@app.post("/webhook")
async def vapi_webhook(request: Request):
    event = await request.json()
    response = await memory.handle(event)
    return response or {}

Changes

  • hindsight-integrations/vapi/ — new hindsight-vapi package
  • .github/workflows/test.yml — CI job + detect-changes
  • scripts/release-integration.sh — added "vapi" to VALID_INTEGRATIONS

Tests

20 passing unit tests covering: client resolution, assistant-request recall+inject, end-of-call retain, outbound overrides helper, unknown event no-op.

@benfrank241 benfrank241 force-pushed the feat/vapi-integration branch from 8247c04 to be3e1dc Compare April 24, 2026 20:38
…etadata

- README.md: full usage docs with FastAPI/outbound/config examples
- LICENSE: MIT
- CHANGELOG.md: initial 0.1.0 release notes
- examples/interactive_webhook.py: manual REPL for testing retain/recall cycle without a real Vapi account
- hindsight-docs/docs-integrations/vapi.md: docs page for the integrations site
- hindsight-docs/src/data/integrations.json: entry so Vapi appears on the integrations listing
- pyproject.toml: added license, authors, keywords, classifiers, URLs for PyPI
- tests/test_webhook.py: use AsyncMock to silence spurious 'coroutine never awaited' warning

Verified: 20/20 unit tests pass; interactive webhook simulator validates full retain -> recall cycle against live Hindsight.
@benfrank241 benfrank241 marked this pull request as ready for review April 24, 2026 20:52
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