Vapi
A phone assistant that remembers the caller. Recall loads their facts before the greeting, saves what they ask it to remember, and carries corrections into the next call. “Actually, call me Sam” replaces the old name and keeps the history.
recall-vapi connects Recall to Vapi through
authenticated webhooks. It uses the same starter predicates as
recall-livekit. Vapi handles the voice conversation; your
service owns the memory. No separate extraction model runs.
Start with an inbound call
Use a Vapi phone number that you can call from your own phone. You need Python 3.10
or newer, Vapi credits and provider access, and a public HTTPS address for the webhook.
The local test helper can create a temporary address using an installed
cloudflared.
Install the adapter with its FastAPI webhook router from PyPI:
pip install "recall-vapi[fastapi]"
For the complete phone assistant and live test helper, use the runnable example from the repository. Its requirements install the adapter from the checkout:
git clone https://github.com/Polign/polign.git cd polign/examples/vapi python -m venv .venv source .venv/bin/activate pip install -r requirements.txt python live_test.py init --phone-number-id YOUR_VAPI_PHONE_NUMBER_ID python live_test.py serve --tunnel
Use the phone number’s resource ID from Vapi, not the dialable number. The helper
creates a private .env with two independent secrets, starts the webhook
server, and prints its public URL. Keep this terminal running.
Connect your Vapi number
In a second terminal, activate the same virtual environment and run these commands
from examples/vapi:
python live_test.py check python live_test.py configure
check verifies HTTPS, authentication, and synthetic memory calls.
configure prints the dashboard steps; it does not change your Vapi account.
- In Vapi’s Integrations → Server Configuration, create a Bearer Token credential
using
VAPI_WEBHOOK_TOKENfrom your local.env. Use theAuthorizationheader with the Bearer prefix. - Set your phone number’s Server URL to the printed HTTPS origin followed by
/vapi/webhook, and select that credential. - Leave the inbound assistant unassigned. Vapi will request an assistant from your service, which returns one with the caller’s memory and tools.
The webhook service needs no Vapi private API key. See Vapi’s documentation for server URLs, server authentication, and assistant-request events.
Verify memory across calls
- Call your Vapi number. Say “My name is Alex,” wait for a reply, then say “Actually, call me Sam.” Wait for confirmation and hang up.
- Call again from the same phone. Listen for Sam in the greeting or ask “What’s my name?” Then hang up.
python live_test.py report python live_test.py report --first-call CALL_1_ID --second-call CALL_2_ID
The report checks the saved correction, the next call’s loaded memory, matching caller identities, completed calls, and tool errors. Confirm the spoken reply by listening. Synthetic checks are separate from live phone evidence.
Press Ctrl-C in the first terminal when finished. The temporary URL stops working;
each tunnel launch gets a new one, so update Vapi before testing again. Saved memory
and test evidence remain in the local data/ directory.
What happens during a call
assistant-requestresolves a stable caller identity and loads up to 20 current facts before the first reply.remembervalidates facts against your predicate registry and returns saved corrections to the model.recallretrieves more facts on demand.- The example enables
forgetto withdraw a current fact. History remains; this is not permanent deletion. - A persistent retry ledger prevents duplicate delivery of the same tool call from applying an old correction again. End reports close the call’s identity binding.
Initial memory is loaded once. New tool results guide the ongoing conversation; the adapter does not rewrite the live system prompt or extract facts from transcripts.
Identity and deployment
The example derives a caller key from your tenant and the inbound phone number using
CALLER_IDENTITY_KEY. Keep that key stable. Caller ID is suitable for a
preferences demo; use an authenticated customer lookup for account-specific memory.
Unresolved callers receive an assistant without memory tools.
For ongoing use, deploy the included Docker example behind permanent HTTPS and
retain the whole data/ directory. It holds both the memory store and the
SQLite call and retry ledger. You can point memory at a shared Polign server with
POLIGN_URL and POLIGN_API_KEY; multiple webhook hosts also
need shared transactional call state.
Keep webhook credentials on the backend. The example’s transient assistant contains them and must not be sent to a browser. The adapter guide covers outbound and web calls, including binding a call to a customer before tools run.
Source and example
recall-vapi is open source under Apache License 2.0. The
runnable example
includes FastAPI, Docker, local verification, and the live phone test helper. See the
adapter README
for custom predicates, timeouts, retries, and persistence limits.