Skip to main content

Consolidating the vector store into Postgres removed a second datastore

Summary: V1 ran Qdrant as its own container alongside the Postgres already used for session state. For V2 I moved vector search into that same Postgres via pgvector โ€” one fewer datastore to run, secure, and back up, at no practical cost for this corpus size.

What was encounteredโ€‹

The corpus lived in Qdrant, a dedicated vector database running as a separate Docker container. That meant two datastores to operate โ€” Qdrant and the Postgres holding patch_sessions โ€” plus extra dependencies (qdrant-client, grpcio) and a container to keep alive, all for a modest corpus.

V1V2
Session statePostgres (patch_sessions)Postgres (patch_sessions) โ€” unchanged
Vector searchQdrant (separate Docker container)pgvector inside that same Postgres
Total datastores21

How it was solvedโ€‹

Moved vector search to pgvector inside the existing Postgres. The client kept the same interface (search() / upsert_entry() / init_collection()), so the change was close to a one-line import swap at the call sites. The Qdrant container and its deps can be removed once the V1โ†’V2 migration finishes.

Reference: Vector database tradeoffs โ€” at application scale, an extension on a database you already run beats a dedicated service whose extra performance you won't notice. Reach for the specialised store only when scale forces it.