Skip to main content

Migrate from Pinecone

The VecLabs API is intentionally shaped to match Pinecone’s client. For most applications, migration is three line changes. Everything below the client initialization stays identical.

The three changes

# Before
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_KEY")
index = pc.Index("my-index")

# After

from solvec import SolVec
sv = SolVec(network="mainnet-beta") # or "devnet" for testing
index = sv.collection("my-index", dimensions=1536)

# Everything below stays identical ↓

index.upsert(vectors=[...])
index.query(vector=[...], top_k=10)
index.delete(ids=["id1", "id2"])

# New - Pinecone has no equivalent

index.verify() # cryptographic proof on Solana


API mapping

PineconeVecLabsNotes
Pinecone({ apiKey })SolVec({ network })No API key needed
pc.Index(name)sv.collection(name, { dimensions })Dimensions required
index.upsert({ vectors })collection.upsert([...])Same structure
index.query({ vector, topK })collection.query({ vector, topK })Same parameters
index.deleteOne(id)collection.delete(id)
index.deleteMany(ids)collection.delete([...ids])
index.fetch(ids)collection.fetch(ids)
index.describeIndexStats()collection.stats()
N/Acollection.verify()Solana Merkle proof

Vector format

Pinecone and VecLabs use the same vector record format:
// Pinecone format
{
  id: 'doc_001',
  values: [0.1, 0.2, ...],
  metadata: { text: 'Hello world' }
}

// VecLabs format - identical
{
  id: 'doc_001',
  values: [0.1, 0.2, ...],
  metadata: { text: 'Hello world' }
}
If you’re already building vector records for Pinecone, you can pass them directly to VecLabs with no transformation.

What you gain

After migrating, you get everything Pinecone offers plus:
  • 88% cost reduction - 8/monthvs8/month vs 70/month at 1M vectors
  • Lower latency - 4.7ms p99 vs ~30ms p99 at 1536 dimensions
  • Client-side encryption - VecLabs cannot read your vectors; Pinecone can
  • On-chain audit trail - Merkle root on Solana after every write
  • No API key - your wallet is your credential, not a revocable API key
  • Open source - MIT licensed, fully auditable

Full migration example

Here’s a complete before/after for a RAG application:
from pinecone import Pinecone
from openai import OpenAI

pc = Pinecone(api_key="pc-your-api-key")
index = pc.Index("knowledge-base")
openai_client = OpenAI()

def store_document(doc_id: str, text: str):
response = openai_client.embeddings.create(
model="text-embedding-ada-002",
input=text
)
embedding = response.data[0].embedding

    index.upsert(vectors=[{
        "id": doc_id,
        "values": embedding,
        "metadata": {"text": text}
    }])

def search(query: str, top_k: int = 5):
response = openai_client.embeddings.create(
model="text-embedding-ada-002",
input=query
)
query_embedding = response.data[0].embedding

    results = index.query(
        vector=query_embedding,
        top_k=top_k,
        include_metadata=True
    )
    return results.matches

The diff is exactly three lines. Everything else is unchanged.

Migrating existing vectors

If you have existing vectors in Pinecone that you want to bring to VecLabs:
from pinecone import Pinecone
from solvec import SolVec

# Source
pc = Pinecone(api_key="YOUR_PINECONE_KEY")
pinecone_index = pc.Index("my-index")

# Destination
sv = SolVec(network="devnet")
veclabs_collection = sv.collection("my-index", dimensions=1536)

# Fetch from Pinecone and upsert to VecLabs in batches
batch_size = 100
cursor = None

while True:
    # List vector IDs from Pinecone
    result = pinecone_index.list(limit=batch_size, pagination_token=cursor)
    ids = [v.id for v in result.vectors]

    if not ids:
        break

    # Fetch vectors
    fetched = pinecone_index.fetch(ids=ids)

    # Upsert to VecLabs
    veclabs_collection.upsert([
        {
            "id": id,
            "values": vector.values,
            "metadata": vector.metadata or {}
        }
        for id, vector in fetched.vectors.items()
    ])

    print(f"Migrated {len(ids)} vectors")

    cursor = result.pagination.next if result.pagination else None
    if not cursor:
        break

print("Migration complete.")

# Verify the migration
proof = veclabs_collection.verify()
print(f"Verified on-chain: {proof.verified}")
print(f"Explorer: {proof.solana_explorer_url}")

Need help?

Join the Discord and post in #help. Migration questions are always answered within 24 hours.