Pinecone
Fully managed vector database with high performance at scale. Supports metadata filtering, namespaces, and hybrid search. Best for production workloads.
Syntax
vector-databases
index.upsert(vectors=[...])
index.query(vector=..., top_k=10, filter={...})Example
vector-databases
from pinecone import Pinecone
pc = Pinecone(api_key="...")
index = pc.Index("my-index")
# Upsert vectors:
index.upsert(vectors=[
("id1", [0.1, 0.2, ...], {"category": "tech"}),
("id2", [0.3, 0.4, ...], {"category": "science"}),
])
# Query with metadata filter:
results = index.query(
vector=query_vec,
top_k=5,
filter={"category": {"$eq": "tech"}}
)