symfony/ai-surreal-db-store
SurrealDB vector store integration for Symfony AI Store, enabling similarity search over embeddings using SurrealQL vector functions and MTREE/HNSW indexes.
vector_similarity), enabling efficient similarity queries.VectorDocumentInterface (#2495) introduces a canonical document contract between the store and the application. Architecturally this is a portability win: our Laravel service layer can type-hint the interface rather than SurrealDB-shaped arrays, so a future swap to pgvector/Weaviate touches adapter code only, not domain code. It also implies the store now hydrates objects rather than raw arrays — existing call sites that assume array shapes will need review.count capabilities (#1755) close a genuine gap: previously corpus sizing required bespoke SurrealQL or an application-side counter. This unlocks index/collection-level metrics without custom glue, and makes store-level observability a first-class concern rather than a workaround.pgvector or Weaviate, particularly at scale. The package itself is still pre-1.0 (v0.14), so the abstraction surface is still moving.surrealdb/surrealdb directly and implement a Laravel-specific vector store interface for tighter control.symfony/ai) and SurrealDB PHP client (surrealdb/surrealdb).VectorStoreInterface) for modularity. With v0.14, also bind/alias VectorDocumentInterface in a Repository or Bindings provider so domain code never depends on the concrete document class.pgvector).composer.json.count Cost Model Unknown: A store-level count over a large vector collection may be a full scan on SurrealDB rather than an index-assisted operation. If we surface counts in UI or dashboards, an expensive count can become a top-N slow query overnight.VectorDocumentInterface, existing pilot code and tests will need adjustment — budget a small refactor, not just a version bump.pgvector, Elasticsearch) for your workload — extend the harness to cover count at target corpus size and filtered vs. unfiltered counts.VectorDocumentInterface so future 0.x bumps surface breakage in CI, not production.laravel-surreal-vector) to reduce dependencies?count index-assisted or a scan, and is it filter/namespace-scoped? Can it be used safely in request-path code, or only in async jobs?VectorDocumentInterface replace the previous array-based document handling, or is the old shape still supported/deprecated? Any timeline for removal?StoreInterface; this package implements it for SurrealDB, enabling Laravel to use SurrealDB as a vector store.VectorStoreInterface) for loose coupling and easy swapping (e.g., for testing or fallback). Also alias VectorDocumentInterface to a concrete document class so application code depends on the contract only.surrealdb/surrealdb and implement a Laravel-specific vector store to avoid Symfony dependencies.| Component | Package/Library | Notes |
|---|---|---|
| Laravel | laravel/framework | Host application |
| Symfony AI | symfony/ai | Vector store abstraction |
| SurrealDB Store | symfony/ai-surreal-db-store | Vector store implementation — pin ~0.14 |
| SurrealDB Client | surrealdb/surrealdb | PHP driver for SurrealDB |
| Laravel Service Layer | Custom (e.g., app/Services/VectorStore) |
Abstraction over SurrealDB-specific logic; type-hint VectorDocumentInterface |
| Metrics (new) | Store count API |
Replace bespoke SurrealQL counters |
pgvector, Elasticsearch) using real-world queries.count benchmark (full collection and filtered) to the same harness.~0.14 in a branch; run the existing test suite and the contract tests.VectorDocumentInterface where applicable.count capability, after confirming its cost profile.DEFINE INDEX for new collections).count results with a short TTL if they are surfaced in product UI.StoreInterface, ensuring compatibility with Symfony AI’s embedding generation, similarity search, and hybrid search features.VectorDocumentInterface and count as additive surface; no deprecations are listed in the changelog, so v0.13 → v0.14 is expected to be non-breaking but not yet verified by our own test suite.~0.14.x, read the changelog on every release, and avoid floating constraints.connection facade or a singleton service) to avoid overhead.VectorDocumentInterface objects now cross the store boundary, ensure they serialize correctly for queues and HTTP resources (e.g., implement JsonSerializable or an API Resource transformer).symfony/ai-surreal-db-store in a Laravel app using Symfony AI.VectorDocumentInterface end-to-end (create → store → retrieve → serialize).pgvector).count into ingestion/backfill monitoring and dashboards.^0.13) invite silent surface changes; pin ~0.14.0 and upgrade deliberately.VectorDocumentInterface reduces long-term lock-in but adds a mapping layer to maintain for every new vector attribute (metadata, filters, scores).count/interface changes will surface as surprise breakage in feature work.count capability and document interface are documented only by changelog entries at present — expect to write internal runbook notes from source reading.count makes backfill and re-embedding jobs observable — assert expected document counts post-ingest, alert on drift. This is a meaningful operational win over bespoke counters.count: Validate whether counts are index-assisted. If they scan, restrict to async jobs and cached dashboards, never per-request product UI. Set a hard rule before adoption spreads.count fan-out.count calls in try/catch with a timeout and emit a metric instead of blocking the job.null metadata). Contract tests plus a staging smoke test on real data are the control.count comparisons and a sampled re-embed job.VectorDocumentInterface usage, count cost caveats, and the fallback toggle. Without it, each new contributor re-derives the same decisions.count cost, and operational toil per upgrade — otherwise the pilot becomes the production system by default.How can I help you explore Laravel packages today?