匠人学院 JR Academy
Skip to article
Learning guide
Pinecone Guide

Use Pinecone for vector search, semantic retrieval, and scalable RAG infrastructure.

2 chapters·4 guides·Access varies by chapter
Namespaces
On this page

Pinecone Namespaces

A namespace scopes records and queries within an index. It can organize tenants or categories, but is not by itself an authorization system: the backend must derive the allowed namespace from the authenticated principal.

#Scope writes and reads consistently

python
index.upsert( vectors=[("sample", [0.1, 0.2, 0.3], {"topic": "example"})], namespace="user-123", ) results = index.query( vector=[0.1, 0.2, 0.3], top_k=5, namespace="user-123" )

These synthetic vectors assume an existing three-dimensional demonstration index. Real embeddings must match the index's model/dimension.

#Namespace lifecycle

The source describes a default namespace and creation through ingestion. It also discusses explicit creation, listing and metadata schema features on supported serverless APIs. Check the API version/index type rather than assuming legacy pods support the same operations.

python
# Destructive: clears the selected namespace. # index.delete(delete_all=True, namespace="user-123")

#Namespace versus metadata

Namespaces define a data/query boundary. Metadata provides flexible tags and filters within that boundary. Use both where appropriate; do not rely on a client-supplied tag or namespace to enforce tenant access.

A query targets the supported namespace scope. Searching multiple scopes may require separate authorized queries and merging, or a deliberately designed shared corpus. Do not merge tenant data merely to simplify a search.

Design namespace naming, authorization, deletion and cross-scope behavior at the beginning of a multi-user retrieval application.

Published by
JR Academy
Learning resources

Individual authors and reviewers are credited where recorded.

System Design

Core system design concepts and practical case studies

Learn the trade-offs and patterns that matter in technical interviews.

Open System Design →

Related Roadmaps

Done reading? Next steps