# Pinecone — Managed Vector Database for Production AI > Fully managed vector database for production AI search. Pinecone offers serverless scaling, hybrid search, metadata filtering, and enterprise security with zero infrastructure. ## Install Copy the content below into your project: ## Quick Use ```bash pip install pinecone ``` ```python from pinecone import Pinecone, ServerlessSpec pc = Pinecone(api_key="...") # Create serverless index pc.create_index( name="docs", dimension=1536, metric="cosine", spec=ServerlessSpec(cloud="aws", region="us-east-1"), ) index = pc.Index("docs") # Upsert vectors index.upsert(vectors=[ {"id": "doc1", "values": [0.1, 0.2, ...], "metadata": {"title": "AI Guide"}}, {"id": "doc2", "values": [0.3, 0.4, ...], "metadata": {"title": "ML Intro"}}, ]) # Query results = index.query(vector=[0.15, 0.25, ...], top_k=5, include_metadata=True) for match in results["matches"]: print(f"{match['id']}: {match['metadata']['title']} ({match['score']:.4f})") ``` ## What is Pinecone? Pinecone is a fully managed vector database designed for production AI applications. Unlike self-hosted alternatives, Pinecone handles all infrastructure — scaling, replication, security, and updates. Its serverless architecture means you pay only for what you use, with automatic scaling from zero to billions of vectors. **Answer-Ready**: Pinecone is a fully managed serverless vector database. Zero infrastructure, automatic scaling, hybrid search (dense+sparse), metadata filtering, and enterprise security. Used by thousands of companies for production RAG and search. Free tier with 100K vectors. **Best for**: Teams wanting production vector search without managing infrastructure. **Works with**: OpenAI, Cohere, HuggingFace, LangChain, LlamaIndex. **Setup time**: Under 2 minutes. ## Core Features ### 1. Serverless (Zero Ops) ```python # Create index — no clusters, no replicas pc.create_index( name="my-index", dimension=1536, metric="cosine", spec=ServerlessSpec(cloud="aws", region="us-east-1"), ) # Scales automatically. Pay per query + storage. ``` ### 2. Metadata Filtering ```python results = index.query( vector=[...], top_k=10, filter={ "category": {"$eq": "technology"}, "year": {"$gte": 2024}, "tags": {"$in": ["ai", "ml"]}, }, ) ``` ### 3. Namespaces (Multi-Tenancy) ```python # Separate data by tenant index.upsert(vectors=[...], namespace="tenant-a") index.upsert(vectors=[...], namespace="tenant-b") # Query within namespace results = index.query(vector=[...], namespace="tenant-a", top_k=5) ``` ### 4. Hybrid Search (Sparse + Dense) ```python # Combine keyword and semantic search results = index.query( vector=[...], # Dense vector sparse_vector={"indices": [1, 5], "values": [0.5, 0.3]}, # Sparse top_k=10, ) ``` ### 5. Integrated Inference ```python # Pinecone generates embeddings for you pc.inference.embed( model="multilingual-e5-large", inputs=["What is AI?"], parameters={"input_type": "query"}, ) ``` ## Pricing | Tier | Vectors | Price | |------|---------|-------| | Free | 100K | $0 | | Starter | 1M | From $8/mo | | Standard | 10M+ | Usage-based | | Enterprise | Unlimited | Custom | ## Pinecone vs Self-Hosted | Aspect | Pinecone | Qdrant/Milvus | |--------|----------|---------------| | Setup | 2 minutes | Docker/K8s | | Scaling | Automatic | Manual | | Maintenance | Zero | You manage | | Cost (small) | Free tier | Free (OSS) | | Cost (large) | Higher | Lower (self-hosted) | | SLA | 99.99% | Your responsibility | ## FAQ **Q: When should I use Pinecone vs self-hosted?** A: Pinecone for teams that want zero ops. Self-hosted (Qdrant, Milvus) for teams that want full control and lower costs at scale. **Q: Does it support LangChain?** A: Yes, first-class integration via `langchain-pinecone` package. **Q: Can I migrate from Pinecone to self-hosted later?** A: Yes, export vectors via the fetch API and import into any other vector database. ## Source & Thanks > Created by [Pinecone](https://www.pinecone.io). > > [pinecone.io](https://www.pinecone.io) — Managed vector database ## 快速使用 ```bash pip install pinecone ``` 两分钟启动全托管向量数据库。 ## 什么是 Pinecone? 全托管 Serverless 向量数据库,零运维自动扩缩容,用于生产级 AI 搜索和 RAG。 **一句话总结**:全托管 Serverless 向量数据库,零运维 + 自动扩缩 + 混合搜索 + 元数据过滤 + 企业安全,免费层 100K 向量。 **适合人群**:不想管基础设施的 AI 搜索团队。 ## 核心功能 ### 1. Serverless — 零运维,按用量付费 ### 2. 元数据过滤 — 复杂条件筛选 ### 3. 命名空间 — 多租户隔离 ### 4. 混合搜索 — Dense + Sparse ## 常见问题 **Q: Pinecone vs 自托管?** A: Pinecone 零运维,自托管(Qdrant/Milvus)更便宜更灵活。 ## 来源与致谢 > [pinecone.io](https://www.pinecone.io) — 全托管向量数据库 --- Source: https://tokrepo.com/en/workflows/0fc5f7e8-439d-414f-bdaf-b09e05e1af49 Author: AI Open Source