symfony/ai-postgres-store
PostgreSQL pgvector vector store integration for Symfony AI Store, with support for vector and halfvec types, distance operators, indexes, and full-text search.
Feature roadmap: semantic and hybrid search without a new vendor. The package is a PostgreSQL/pgvector bridge for Symfony AI's Store interface — meaning our existing managed Postgres can back embedding persistence and similarity search. It supports vector and halfvec types, pgvector distance operators (<->, <#>, <=>), ANN indexing (HNSW/IVFFlat via pgvector), and native PostgreSQL full-text search. That last point is the strategic one: hybrid retrieval (vector + keyword) in a single database is a differentiated capability we can ship as an incremental feature rather than a new platform bet.
Build vs. buy: buy the adapter, not the database. We do not build vector storage ourselves, and we do not take on a second datastore (Pinecone/Weaviate) unless scale forces it. Adopting this bridge means our vector layer is a thin, replaceable abstraction over infrastructure we already operate. The reverse — bespoke SQL for embeddings, distance functions, and index tuning — is a multi-week build with ongoing DBA overhead and no product-visible upside.
Concrete use cases worth writing tickets for:
WHERE predicates. This is where most of our quick wins live, because it degrades gracefully to existing filters.Pagination and result-count UX are now unblocked. Since v0.11.0 the store supports clear(); since v0.14.0 it exposes count capabilities, plus a VectorDocumentInterface that lets us map our own domain models (Product, Article) into the store instead of an opaque array. For a PM this matters twice: it makes paginated semantic results shippable (search UIs need a total), and it makes "N results found" / facet counts achievable without inventing aggregate queries.
Cost and lock-in posture. Vector search rides on infrastructure we already pay for, with no per-vector pricing and no egress story. If we outgrow pgvector, the Store interface is the seam we swap behind — so this is a reversible architectural decision, which is the main thing a roadmap needs from it.
A realistic adoption verdict: this is a pilot/trial-grade dependency, not a load-bearing platform choice today. Two stars, zero dependents, version 0.x, and a Symfony-first (not Laravel-first) design. Fund it as a time-boxed spike behind an adapter, with a documented exit path, rather than as a committed roadmap dependency.
Adopt when:
Look elsewhere (or defer) when:
vector column type; migrations and casts require raw SQL or Doctrine DBAL. If that friction is unacceptable, a Laravel-first vector package is a better organizational fit — same database, less glue.Gate criteria for the spike: pgvector provisioned in CI; 3 real queries benchmarked for latency and recall against representative volume; count-query latency measured; adapter proven with one domain model mapped to VectorDocumentInterface; written fallback plan.
For executives — one paragraph: "We can add semantic and hybrid search to the product using the PostgreSQL database we already run, by turning on a well-established open-source extension (pgvector) and adding a thin integration layer. That means AI-grade search — 'find things like this,' retrieval for assistants, recommendations — without buying a vector database, without a new vendor contract, and without migrating our data. The integration package itself is early-stage (open source, MIT, pre-1.0, small community), so the recommendation is a short, bounded pilot — roughly two to four weeks — behind an internal abstraction that lets us swap it out if it disappoints. Total downside is bounded engineering time; total upside is a search capability we currently can't offer. Expected payoff: we avoid a third-party vector service, keep data in our own infrastructure, and get pagination and result counts as part of the same work."
For engineering — the ask:
symfony/ai and symfony/ai-postgres-store to ^0.14; audit any custom store/document implementations against VectorDocumentInterface.What we are explicitly not claiming: that this is production-hardened. It is a small, early package on a fast-moving 0.x interface, maintained upstream in the Symfony AI monorepo. The pitch is a cheap, reversible experiment on infrastructure we already own — not a platform commitment.
How can I help you explore Laravel packages today?