Back to Blog
AI & Machine Learning

Pinecone Vector Database: How It Works, Key Features, Pricing Model, and a Python Quickstart

A practical guide to Pinecone: serverless indexes, namespaces, metadata filtering, hybrid search, how pricing works, a Python quickstart, and when Pinecone is or is not the right vector database.

VC
Vertex Cyber Tech Engineering Team
Software engineers, AI/ML developers, cloud architects, and security specialists at Vertex Cyber Tech Solutions who design, build, and secure production systems for clients in India, the US, the UK, and worldwide.
Nov 7, 2026
10 min read
Pinecone
Vector Database
RAG
Python
Semantic Search

Key takeaways

  • Pinecone is a fully managed, proprietary vector database. You do not run servers, clusters, or index maintenance.
  • Serverless indexes separate storage from compute, so you pay mainly for what you store and query.
  • Namespaces partition data inside an index and are a common way to isolate tenants in SaaS products.
  • Choose Pinecone when minimizing operations matters more than self-hosting or keeping data inside your own cloud account.

Pinecone is a managed cloud vector database that stores embeddings and returns the most similar items for a query, with metadata filtering, namespaces, and hybrid search. It is widely used for retrieval-augmented generation (RAG), semantic search, and recommendations by teams that want vector search without operating database infrastructure. For background, see what is a vector database.

Core concepts

ConceptWhat it means
IndexThe top-level container for vectors, defined by dimension and similarity metric (cosine, dot product, or Euclidean)
Serverless indexAn index type where Pinecone manages capacity automatically, choosing a cloud provider and region at creation
RecordAn ID, a dense vector, optional sparse values, and metadata
NamespaceA partition within an index. Queries target one namespace, which makes it useful for per-customer isolation
Metadata filterConditions such as team = support or year greater than 2024 applied during the query

Python quickstart

Install the official SDK with pip install pinecone. Check the Pinecone documentation for the current API version.

from pinecone import Pinecone, ServerlessSpec

pc = Pinecone(api_key="YOUR_API_KEY")  # load from a secret manager, never hard-code

pc.create_index(
    name="help-center",
    dimension=1024,            # must match your embedding model
    metric="cosine",
    spec=ServerlessSpec(cloud="aws", region="us-east-1"),
)

index = pc.Index("help-center")

index.upsert(
    vectors=[{"id": "refunds#2", "values": embedding, "metadata": {"team": "support", "lang": "en"}}],
    namespace="customer-acme",
)

results = index.query(
    vector=query_embedding,
    top_k=5,
    namespace="customer-acme",
    filter={"team": {"$eq": "support"}},
    include_metadata=True,
)

Here embedding and query_embedding come from your embedding model. See choosing an embedding model. Pinecone also offers hosted embedding and reranking models, which can simplify the pipeline.

Features that matter for production

  • Metadata filtering for permissions, tenants, languages, and dates.
  • Hybrid search with sparse and dense vectors to handle exact terms such as product codes. See vector vs. hybrid search.
  • Namespaces for multi-tenant isolation and faster, smaller queries.
  • Backups and collections for recovery and copying data.
  • Security features such as API key management and, on higher plans, private networking options. Check the current plan details.

How Pinecone pricing works

Serverless pricing is usage-based, generally combining storage with read and write operations, and plans differ in support, security features, and minimums. Because usage-based costs grow with query volume, estimate monthly reads and writes before committing, and compare with self-hosted alternatives using the official pricing page.

When Pinecone is a good fit, and when it is not

  • Good fit: small teams that want zero database operations, fast time to production, and elastic scale.
  • Consider alternatives if data must stay inside your own cloud account or network, if you need an open-source engine for portability, or if very high query volumes make usage pricing expensive. Self-hosted Qdrant or Weaviate, or pgvector, may suit better.

See the full vector database comparison.

Example: A B2B SaaS company adds an AI assistant to its product. It stores each customer's documents in a separate Pinecone namespace inside one serverless index, so a query can only ever search that customer's data, and adds metadata filters for document permissions within each customer. The team ships without hiring anyone to run database infrastructure.

Designing your index and namespaces

Good Pinecone design starts with a few decisions that are hard to change later. Choose the vector dimension and similarity metric to match your embedding model exactly; an index created for 1,536-dimension cosine vectors cannot accept vectors of another size. Decide how to separate data: namespaces partition an index so queries only search one partition, which is a natural fit for multi-tenant applications where each customer's data lives in its own namespace, or for separating environments and document collections. Use metadata for attributes you filter on within a namespace, such as document type, language, date, product, and access groups. Keep metadata compact and avoid storing full document text there if it is large; store the text in your own database and keep a document ID and chunk ID in Pinecone to look it up.

Record and ID strategy

Give every vector a deterministic, meaningful ID, for example a combination of document ID and chunk number. This makes updates simple: when a document changes, you can delete or overwrite its chunks by ID rather than searching for them. Store the embedding model and version alongside your source data, so you know which vectors must be regenerated when you change models. When a document is deleted from the source system, delete its vectors as part of the same workflow, so outdated content is never retrieved.

Ingestion best practices

  • Batch upserts rather than sending vectors one at a time, and run batches in parallel within your rate limits.
  • Retry failed batches with backoff, and log failures for review.
  • Track ingestion progress in your own database, so large imports can resume after interruptions.
  • Re-embed and upsert only changed documents in incremental updates.
  • Validate a sample of records after ingestion by querying them back.

Querying effectively

Retrieve more candidates than you need, for example the top 20 to 50, then rerank and keep the best few for your application or language model. Apply metadata filters for permissions and context on every query, derived from the authenticated user on your server. Pinecone supports hybrid search with sparse and dense vectors, which helps when exact terms such as product codes or names matter, and offers hosted embedding and reranking models through its inference features, which can simplify pipelines. Measure recall on a test set of real queries before and after any change to filters, models, or chunking.

Security and access control

Store Pinecone API keys in a secrets manager, never in client-side code, and use separate projects or keys for development and production. Restrict who in your organization can create and delete indexes. Enforce tenant and permission filters on the server, because Pinecone will return whatever matches the query you send. Review Pinecone's current security documentation and compliance reports for encryption, network options such as private connectivity, and certifications that your customers or regulators may require.

Estimating Pinecone costs

Serverless pricing is usage based, so cost depends on how much you store and how much you read and write. To estimate it, calculate the number of vectors, their dimension, and metadata size to approximate storage; estimate monthly query volume and how many results each query returns; and estimate write volume from initial ingestion and ongoing updates. Run a pilot with realistic data and traffic, then extrapolate using the usage figures shown in the Pinecone console. Reduce costs by using an embedding model with fewer dimensions where quality allows, keeping metadata lean, avoiding unnecessary re-ingestion, and caching results for repeated queries. Always check the current pricing page, because plans and rates change.

Example: a multi-tenant RAG assistant on Pinecone

A SaaS company adds an assistant that answers questions from each customer's knowledge base. It creates one serverless index with a namespace per customer, so queries are isolated and small customers do not slow down large ones. Documents are chunked by section, embedded, and upserted with IDs built from document and chunk identifiers, plus metadata for title, URL, language, and access groups. The application server determines the customer and user from the session, queries only that customer's namespace, and filters by access group. Results are reranked, and the top passages are sent to the language model with instructions to cite sources. When a customer leaves, its namespace is deleted in one operation. The team monitors query latency, usage per namespace, and answer quality on a weekly evaluation run.

Migrating to or from Pinecone

Because Pinecone is a managed service, plan for portability. Keep source documents, chunk text, and metadata in your own storage; keep retrieval logic behind an internal interface; and record embedding model versions. Migrating into Pinecone then means bulk upserting existing vectors, or re-embedding if you change models. Migrating out means exporting from your own source of truth and re-indexing elsewhere. Running the old and new systems in parallel for a short period, comparing results on your evaluation set, makes any switch low risk.

Common Pinecone mistakes

  • Mismatched dimensions or metrics between the index and the embedding model.
  • Filtering on the client instead of applying permission filters on the server.
  • Storing large text blobs in metadata, increasing storage and slowing queries.
  • Random vector IDs that make updates and deletions difficult.
  • No evaluation set, so changes to chunking or models are judged by feel.
  • Mixing embedding models in the same index after an upgrade.
  • Forgetting deletions, so removed documents keep appearing in answers.

Pinecone alongside the rest of your stack

Pinecone stores and searches vectors; the rest of a production system lives around it. You still need a source of truth for documents and metadata, an ingestion pipeline that parses and chunks content, an embedding step, an application server that handles authentication and permissions, a language model for generation if you are building RAG, and monitoring for quality, latency, and cost. Frameworks such as LangChain and LlamaIndex provide Pinecone integrations that speed up development, but understand what they do under the hood so you can tune and debug the system.

Summary

Pinecone is a strong choice for teams that want a managed, scalable vector database without operating infrastructure. Design indexes, namespaces, IDs, and metadata deliberately, enforce permissions on the server, measure retrieval quality, and estimate costs with a realistic pilot. For comparisons with other options, see our vector database comparison; for building the full pipeline, see our production RAG guide and hybrid search guide.

Evaluating retrieval quality on Pinecone

Before launch, build a test set of at least 100 real queries with the documents or chunks that should be returned for each. Measure recall at k, the share of queries where a correct result appears in the top k, and mean reciprocal rank, which rewards placing the right result first. Run the same test whenever you change chunking, the embedding model, hybrid search weighting, reranking, or filters. Track latency at the 50th and 95th percentiles under realistic concurrency too. In production, log queries, retrieved IDs, and user feedback, sample poor results each week, and add failing queries to the test set. This loop matters more for answer quality than any single index setting, because most retrieval problems come from content, chunking, and query understanding rather than from the database itself.

When to consider alternatives

Pinecone may not be the best fit if you must self-host for regulatory or air-gapped environments, if your collection is small enough to live comfortably in PostgreSQL with pgvector alongside your application data, or if you want a single open-source system that you can run anywhere. In those cases, consider self-hosted Qdrant or Weaviate, or pgvector, and compare total cost of ownership including engineering time, which often favors a managed service for small teams.

A production readiness checklist

  • Index dimension and metric match the embedding model, and the model version is recorded.
  • Namespaces and metadata are designed around tenancy, permissions, and filters.
  • Vector IDs are deterministic, so updates and deletions are straightforward.
  • Ingestion is batched, retried, and resumable, with deletions synchronized from source systems.
  • API keys are stored securely, with separate keys per environment.
  • Permission filters are applied on the server for every query.
  • An evaluation set runs before each change, and latency and cost are monitored.

Working through this list before launch prevents the most common problems teams encounter when moving from a Pinecone prototype to a production system.

With these foundations in place, Pinecone lets a small team run reliable, scalable semantic search without managing database infrastructure themselves.

Measure carefully, and let evidence guide every change.

Pinecone integration with Vertex Cyber Tech

Pinecone is part of our AI/ML technology stack for RAG and semantic search. We design ingestion pipelines, tenant isolation, and evaluation around it. See our vector database capabilities or book a consultation.

Sources and further reading

Article FAQs

What is Pinecone used for?

Pinecone is a managed vector database used to store embeddings and find similar items quickly. Common uses include retrieval-augmented generation for AI assistants, semantic search, recommendations, and deduplication.

Is Pinecone free?

Pinecone offers a free starter tier with limits, and paid plans with usage-based pricing for storage and read and write operations. Check Pinecone's pricing page for current limits and rates.

What are Pinecone namespaces?

Namespaces are partitions within a Pinecone index. Each query targets one namespace, which makes them a common way to isolate data for different customers or tenants and to keep queries small and fast.

Can I self-host Pinecone?

No. Pinecone is a proprietary managed service. If you need to self-host or keep data entirely in your own infrastructure, consider open-source options such as Qdrant, Weaviate, Milvus, Chroma, or pgvector.

Discuss This With Our Team
Share your requirement and our team will reply with the next practical step. This article is mentioned automatically.
VC

About Vertex Cyber Tech Engineering Team

Software engineers, AI/ML developers, cloud architects, and security specialists at Vertex Cyber Tech Solutions who design, build, and secure production systems for clients in India, the US, the UK, and worldwide.

More articles