probots-io/pinecone-php
Elegant PHP client for the Pinecone API (serverless-ready), powered by Saloon. Authenticate with an API key, manage indexes/collections via control endpoints, and work with vectors via data endpoints by setting an index host at init or later.
.env or Vault remains the best practice.retry middleware remains essential for Pinecone’s throttling.monolog for cost/performance tracking.env + Hashicorp Vault for production.$this->app->singleton(Pinecone::class, function ($app) {
return new Pinecone(config('pinecone.api_key'), config('pinecone.env'), config('pinecone.host', null)); // Host now optional
});
Model::whereRaw("id IN (SELECT id FROM pinecone_query(...))")).Http facade to mock Pinecone’s updated index host format in tests.PINECONE_HOST=your-region-1.pinecone.io
benchmark() helper.collections() documentation (PR #11) to manage index namespaces.database connection. Example:
DB::table('vector_backups')->upsert($pineconeData);
composer.json for conflicts (e.g., Guzzle version). The release adds no new dependencies.composer require probots-io/pinecone-php:^1.1.0
PINECONE_API_KEY=your_key
PINECONE_ENV=your_env
PINECONE_HOST=your-region.pinecone.io # Optional (multi-region support)
$this->app->singleton(Pinecone::class, function ($app) {
return new Pinecone(
config('pinecone.api_key'),
config('pinecone.env'),
config('pinecone.host') // Now optional
);
});
collections() method (PR #11):
$results = app(Pinecone::class)->collection('your_collection')->query('your_vector');
dispatch(new UpsertVectorsJob($vectors))->onQueue('pinecone');
app(Pinecone::class)->collection('data')->query(...)->tap(function ($response) {
Log::info('Pinecone query', [
'region' => config('pinecone.host'),
'latency' => $response->executionTime(),
]);
});
composer update --with-dependencies cautiously.probots-io/pinecone-php.products_v2) and document the host format (PR #10) for multi-region setups.benchmark() to compare query times across Pinecone regions.tap:
$results = app(Pinecone::class)->query(...)->tap(function ($response) {
Log::debug('Pinecone metadata', [
'host' => $response->getHost(),
'status' => $response->status(),
]);
});
retry middleware for region-specific timeouts:
$results = retry(3, function () use ($pinecone) {
return $pinecone->collection('data')->query(...);
}, 100); // Retry after 100ms
$vectors->chunk(1000)->each(function ($chunk) {
app(Pinecone::class
How can I help you explore Laravel packages today?