symfony/ai-pinecone-store
Pinecone vector store integration for Symfony AI Store, enabling upsert, query, and delete of vectors plus serverless index creation through the Pinecone API.
VectorDocumentInterface (v0.14.0) strengthens this by standardizing the document model, so AI code targets an interface rather than a Pinecone-specific payload.count capability on stores (v0.14.0) unlocks index-level analytics without custom API calls — useful for tracking corpus growth, estimating embedding/storage spend, paginating admin UIs, and gating features by vector quota.count to monitor index size, backfill progress, and per-tenant document volumes without bespoke Pinecone client code.price < $100 or category = "electronics").VectorDocumentInterface (new in v0.14.0) lets application code depend on an interface rather than Pinecone-shaped arrays, making future store swaps materially cheaper.count support removes the need to hand-roll that against the Pinecone API.spatie/laravel-ai or custom wrappers.pgvector (cost-effective for smaller-scale use cases).count and a document interface, but the surface remains query/upsert-centric; plan for direct SDK calls for admin-level work.Elevator Pitch: *"This package lets us integrate Pinecone’s vector search into our Laravel stack with minimal engineering overhead, accelerating AI features like smart search, recommendations, and chatbots. By leveraging Pinecone’s managed infrastructure, we avoid the cost and complexity of building our own vector database—saving $X in dev ops and Y months of timeline. The latest release (v0.14.0) makes the integration more durable: a standard document interface reduces switching cost if we ever change vendors, and built-in document counting gives us usage metering and cost visibility without extra engineering. Pinecone’s serverless model scales automatically with our growth.
Why now?
Ask: Should we prioritize this for [Q1 2025] to enable [specific feature, e.g., ‘product search’ or ‘customer support AI’]?"*
Key Metrics to Track:
Technical Summary:
"The symfony/ai-pinecone-store package provides a Symfony AI bridge to Pinecone, enabling vector search in Laravel with minimal boilerplate. v0.14.0 is an additive, non-breaking release that improves architectural posture: VectorDocumentInterface standardizes the document model at the boundary, and stores now expose count. Here’s the tradeoff analysis:
| Pros | Cons | Mitigation |
|---|---|---|
| 30–50% faster development than custom Pinecone integration. | Pulls in Symfony AI (dependency footprint). | Use a lightweight wrapper or Pinecone’s PHP SDK if Symfony is overkill. |
| Supports hybrid search (keyword + vector) and metadata filtering. | Tight Pinecone coupling at the transport level. | Code against StoreInterface / VectorDocumentInterface — v0.14.0 makes this materially easier. |
| Managed scalability (no DB ops). | Cost at scale (Pinecone pricing). | Use new count support to meter usage; benchmark against self-hosted options (e.g., Qdrant). |
Store-level count simplifies ops dashboards, backfill tracking, and quota enforcement. |
Additional round-trip per count; not a substitute for a real analytics store. | Cache counts on a schedule; keep raw telemetry in your app DB. |
| Symfony’s DI integration works well with Laravel. | Learning curve for Symfony patterns. | Document integration steps or use a pre-built Laravel adapter. |
Recommended Approach:
StoreInterface and build documents as VectorDocumentInterface implementations so persistence and retrieval stay vendor-agnostic.count into a scheduled job to track corpus growth against spend; compare Pinecone usage vs. pgvector.Example Integration Path:
# Option 1: Full Symfony AI (recommended if using other Symfony AI components)
composer require symfony/ai symfony/ai-pinecone-store symfony/http-client
# Option 2: Lightweight (minimal dependencies)
composer require pinecone-io/pinecone-php
Risks:
VectorDocumentInterface; still keep Pinecone behind an interface and avoid leaking its payload shapes into domain code.Hands-On Value Proposition:
"This package turns Pinecone into a first-class citizen in your Laravel app, with zero API boilerplate. v0.14.0 adds a document interface and count—both small changes that clean up your code and give you ops visibility for free.
composer require symfony/ai symfony/ai-pinecone-store symfony/http-client
Configure in config/services.php:
use Symfony\AI\PineconeStore;
use Symfony\Contracts\HttpClient\HttpClientInterface;
$container->bind(\Symfony\AI\StoreInterface::class, function () {
return new PineconeStore(
$container->get(HttpClientInterface::class),
env('PINECONE_API_KEY'),
env('PINECONE_ENV'),
'your-index-name'
);
});
Implement VectorDocumentInterface instead of passing loose arrays, so your domain code isn’t coupled to Pinecone’s wire format — this is the pragmatic first step toward swappable vector stores and is trivial to unit test with a fake store.
$store = app(\Symfony\AI\StoreInterface::class);
$total = $store->count(); // total documents in the index
// wire into an admin dashboard, backfill progress tracker, or per-tenant quota guard
Usage in Laravel:
// Store a vector (e.g., from an LLM embedding)
$store = app(\Symfony\AI\StoreInterface::class);
$store->upsert('user-123', [0.1, 0.2, ...], ['metadata' => ['category' => 'electronics']]);
Upgrade note: v0.14.0 is additive with no deprecations surfaced in the changelog — a low-risk minor bump. Verify your pinned symfony/ai version aligns with the new VectorDocumentInterface and count signatures, and add a count() assertion to your smoke tests.
How can I help you explore Laravel packages today?