Mythosia.VectorDb.Pinecone 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Mythosia.VectorDb.Pinecone --version 1.2.0
                    
NuGet\Install-Package Mythosia.VectorDb.Pinecone -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mythosia.VectorDb.Pinecone" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mythosia.VectorDb.Pinecone" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Mythosia.VectorDb.Pinecone" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mythosia.VectorDb.Pinecone --version 1.2.0
                    
#r "nuget: Mythosia.VectorDb.Pinecone, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mythosia.VectorDb.Pinecone@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mythosia.VectorDb.Pinecone&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Mythosia.VectorDb.Pinecone&version=1.2.0
                    
Install as a Cake Tool

Mythosia.VectorDb.Pinecone

Pinecone vector store implementation for the Mythosia VectorDb abstraction layer.

Isolation model used by this package:

  • Collection = Pinecone index (physical storage)
  • Namespace = Pinecone namespace (1st-tier logical partition)
  • Scope = metadata key _scope (2nd-tier logical partition)

Installation

dotnet add package Mythosia.VectorDb.Pinecone

Quick Start

using Mythosia.VectorDb;
using Mythosia.VectorDb.Pinecone;

var options = new PineconeOptions
{
    IndexHost = "https://my-index-xxxx.svc.us-east1-gcp.pinecone.io",
    ApiKey = "YOUR_PINECONE_API_KEY"
};

using var store = new PineconeStore(options);

var record = new VectorRecord("doc-1", embedding, "Hello world");
await store.InNamespace("documents").UpsertAsync(record);

var results = await store.InNamespace("documents")
    .SearchAsync(queryVector, topK: 5);

PineconeStore follows the same hybrid-capable storage model as QdrantStore:

  • upserts always store dense vectors and sparse BM25-derived values together
  • retrieval mode is chosen at query time
    • SearchAsync for vector-only retrieval
    • HybridSearchAsync for native dense + sparse retrieval

For native hybrid search, the Pinecone index metric must be dotproduct.

Options

Property Default Description
IndexHost (required) Pinecone data-plane host for your index
ApiKey (required) Pinecone API key
DefaultNamespace null Namespace used when record/filter namespace is null
UpsertBatchSize 100 Max vectors per upsert request
RequestTimeoutSeconds 100 Timeout when store owns HttpClient
AutoCreateIndex false Auto-create the index through the Pinecone Control Plane API
IndexName null Required when AutoCreateIndex = true
Dimension 0 Required when AutoCreateIndex = true
Cloud null Required when AutoCreateIndex = true
Region null Required when AutoCreateIndex = true
ControlPlaneHost https://api.pinecone.io Pinecone Control Plane API base URL

When AutoCreateIndex = true, the index is created with dotproduct metric automatically.

var hybridResults = await store.InNamespace("documents")
    .HybridSearchAsync(queryVector, "hello world", topK: 5);

SearchAsync remains pure dense retrieval. HybridSearchAsync sends both dense and sparse query components and lets Pinecone perform server-side fusion.

Scope & Metadata Filtering

await store.InNamespace("docs").InScope("tenant-1").UpsertAsync(record);

var results = await store.InNamespace("docs").InScope("tenant-1")
    .SearchAsync(queryVector, topK: 10);

var filter = VectorFilter.ByMetadata("category", "science");
var filtered = await store.InNamespace("docs")
    .SearchAsync(queryVector, topK: 5, filter: filter);

Metadata Layout

Each stored vector uses reserved metadata keys:

Key Description
_content Original text content
_scope Scope for 2nd-tier isolation (omitted if null)
<custom> User metadata entries from VectorRecord.Metadata

Vector Replacement

ReplaceByFilterAsync is available via the IVectorStore default interface method. It performs sequential DeleteByFilterAsyncUpsertBatchAsync. Pinecone does not support server-side transactions, so sequential execution is the best available behavior:

var filter = VectorFilter.ByMetadata("full_path", "/docs/file.md");
await store.InNamespace("documents").ReplaceByFilterAsync(filter, newRecords);

Connection Verification

Call VerifyConnectionAsync to test HTTP connectivity to the Pinecone index before running queries:

var store = new PineconeStore(new PineconeOptions
{
    IndexHost = "https://my-index-xxxx.svc.us-east1-gcp.pinecone.io",
    ApiKey = "YOUR_PINECONE_API_KEY"
});

try
{
    await store.VerifyConnectionAsync();
    Console.WriteLine("Connected!");
}
catch (Exception ex)
{
    Console.WriteLine($"Connection failed: {ex.Message}");
}

API Key Note

Set your Pinecone API key securely (for example, environment variables or secret manager). Do not hardcode secrets in source code.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 87 4/4/2026
3.0.0 92 4/3/2026
2.0.1 84 4/1/2026
2.0.0 89 3/30/2026
1.3.0 89 3/29/2026
1.2.0 88 3/28/2026
1.1.0 86 3/22/2026
1.0.0 93 3/11/2026

v1.2.0: Compatible with Abstractions v2.3.0. ReplaceByFilterAsync available via default interface method (sequential DeleteByFilterAsync then UpsertBatchAsync).