1
Install
2
Start a database
Any PostgreSQL with pgvector works. For local development:
docker-compose.yml
3
Create the schema
Migrations are a deliberate step, not something that runs at startup. Twenty workers booting
at once and racing DDL is a real failure: Migration
CREATE TABLE IF NOT EXISTS is not race-safe in
PostgreSQL.0002 creates an unprivileged voicemem_app role. Give it a password and point
your agent at that, not at the admin role:4
Wire it into your agent
agent.py
5
Confirm it remembers
Run the agent, say something about yourself, hang up, then reconnect and ask about it.Nothing was passed between the two sessions. The second one retrieved from Postgres.
First call
A later call, new session
What it costs
Measured, not estimated. 8 stored turns, 12 queries,text-embedding-3-small and gpt-4o-mini,
against a same-host pgvector/pgvector:pg17 container.
The single embedding call is almost all of it. Everything this package does costs about 19 ms.
That is why retrieval prefetches on interim transcripts: on a hit, the round trip already happened
while the caller was still speaking.
Writing runs in the background at 3.8 s p50 and 2 LLM calls per ingested turn, dropping to 1
when the store is empty and conflict resolution is skipped.

