pinecone
zechenzhangAGI/AI-research-SKILLs
프로덕션용 AI 애플리케이션을 위한 관리형 벡터 데이터베이스입니다. 완전 관리형이며, 자동 확장 기능을 갖추고, 하이브리드 검색(밀집형 + 희소형), 메타데이터 필터링 및 네임스페이스를 지원합니다. 낮은 지연 시간(p95 기준 <100ms)을 자랑합니다. 대규모 프로덕션 RAG, 추천 시스템 또는 시맨틱 검색에 활용하세요. 서버리스 및 관리형 인프라에 가장 적합합니다.
...모든 것을 확장하십시오pinecone 소개
Pinecone 는 프로덕션용 AI 애플리케이션을 위해 설계된 완전 관리형 서버리스 벡터 데이터베이스입니다. 이 데이터베이스는 인프라 관리의 복잡성을 처리하면서 벡터 데이터베이스의 확장성 문제를 해결합니다. Pinecone는 개발자가 프로비저닝, 확장, 유지 관리와 같은 기본 데이터베이스 아키텍처에 대한 걱정 없이 AI 애플리케이션 구축에 집중할 수 있는 플랫폼을 제공합니다. 저지연(p95 기준 100ms 미만) 기능을 갖추고 있어 추천 시스템, 시맨틱 검색, 검색 강화 생성(RAG) 애플리케이션과 같은 분야의 실제 운영 환경에 이상적입니다.
Pinecone의 주요 기능으로는 밀집 벡터와 희소 벡터를 결합한 하이브리드 검색, 메타데이터 필터링, 네임스페이스 지원 등이 있습니다. 이 플랫폼은 고가용성과 높은 신뢰성을 위해 설계되었으며, 99.9%의 가동 시간을 보장하는 SLA를 제공합니다. Pinecone는 성능 저하 없이 수십억 개의 벡터까지 자동으로 확장되므로 대규모 프로덕션 시스템에 적합합니다. AWS, GCP, Azure와 같은 클라우드 제공업체와의 연동을 통해 유연한 배포가 가능하며, 성능 요구 사항에 맞춰 서버리스 또는 포드 기반 환경에서 원활하게 작동할 수 있습니다.
Pinecone 이 플랫폼은 효율적이고 확장 가능한 벡터 검색이 필요한 AI 기반 애플리케이션을 개발하는 조직 및 개발자를 대상으로 합니다. 이상적인 사용 사례로는 RAG 시스템, 추천 엔진, 대규모 시맨틱 검색 등이 있으며, 특히 지연 시간과 인프라 관리가 중요한 경우에 적합합니다. 손쉬운 통합과 관리형 서비스 모델을 갖춘 Pinecone는 AI 워크로드를 위해 안정적이고 유지 관리가 용이한 벡터 데이터베이스 솔루션이 필요한 개발자에게 탁월한 선택입니다.
자주 묻는 질문
Pinecone를 시작하려면 어떻게 해야 하나요?
Pinecone를 시작하려면 `pip install pinecone -client` 명령어를 사용하여 `pinecone -client` Python 패키지를 설치하면 됩니다. 그런 다음 Pinecone 클라이언트를 초기화하고, 인덱스를 생성한 후 벡터를 삽입 또는 업데이트(upsert)하고, 쿼리를 실행하면 됩니다. 문서에는 이러한 각 단계에 대한 샘플 코드가 제공됩니다.
Pinecone의 지연 시간은 어느 정도인가요?
Pinecone 는 p95 지연 시간이 100ms 미만으로 낮은 지연 시간을 제공하므로, 빠른 응답 시간이 중요한 프로덕션 애플리케이션에 적합합니다.
Pinecone는 하이브리드 검색을 지원하나요?
네, Pinecone는 하이브리드 검색을 지원하여, 쿼리에서 밀집 벡터와 희소 벡터를 모두 사용할 수 있게 함으로써 보다 유연하고 효율적인 검색 기능을 제공합니다.
메타데이터를 기준으로 결과를 필터링할 수 있습니까?
네, Pinecone는 메타데이터 필터링 기능을 제공하여, 정확한 일치, 비교, 논리 연산자 또는 목록에 대한 'in' 연산자 등 다양한 기준에 따라 쿼리 결과를 필터링할 수 있습니다.
Pinecone는 서버리스인가요?
네, Pinecone는 기본적으로 서버리스 서비스이지만, 특정 환경에서 보다 일관된 성능이 필요한 사용자를 위해 포드(pod) 기반 배포도 지원합니다.
Pinecone - Managed Vector Database
The vector database for production AI applications.
When to use Pinecone
Use when:
- Need managed, serverless vector database
- Production RAG applications
- Auto-scaling required
- Low latency critical (<100ms)
- Don't want to manage infrastructure
- Need hybrid search (dense + sparse vectors)
Metrics:
- Fully managed SaaS
- Auto-scales to billions of vectors
- p95 latency <100ms
- 99.9% uptime SLA
Use alternatives instead:
- Chroma: Self-hosted, open-source
- FAISS: Offline, pure similarity search
- Weaviate: Self-hosted with more features
Quick start
Installation
pip install pinecone-client
Basic usage
from pinecone import Pinecone, ServerlessSpec# Initializepc = Pinecone(api_key="your-api-key")# Create indexpc.create_index( name="my-index", dimension=1536, # Must match embedding dimension metric="cosine", # or "euclidean", "dotproduct" spec=ServerlessSpec(cloud="aws", region="us-east-1"))# Connect to indexindex = pc.Index("my-index")# Upsert vectorsindex.upsert(vectors=[ {"id": "vec1", "values": [0.1, 0.2, ...], "metadata": {"category": "A"}}, {"id": "vec2", "values": [0.3, 0.4, ...], "metadata": {"category": "B"}}])# Queryresults = index.query( vector=[0.1, 0.2, ...], top_k=5, include_metadata=True)print(results["matches"])
Core operations
Create index
# Serverless (recommended)pc.create_index( name="my-index", dimension=1536, metric="cosine", spec=ServerlessSpec( cloud="aws", # or "gcp", "azure" region="us-east-1" ))# Pod-based (for consistent performance)from pinecone import PodSpecpc.create_index( name="my-index", dimension=1536, metric="cosine", spec=PodSpec( environment="us-east1-gcp", pod_type="p1.x1" ))
Upsert vectors
# Single upsertindex.upsert(vectors=[ { "id": "doc1", "values": [0.1, 0.2, ...], # 1536 dimensions "metadata": { "text": "Document content", "category": "tutorial", "timestamp": "2025-01-01" } }])# Batch upsert (recommended)vectors = [ {"id": f"vec{i}", "values": embedding, "metadata": metadata} for i, (embedding, metadata) in enumerate(zip(embeddings, metadatas))]index.upsert(vectors=vectors, batch_size=100)
Query vectors
# Basic queryresults = index.query( vector=[0.1, 0.2, ...], top_k=10, include_metadata=True, include_values=False)# With metadata filteringresults = index.query( vector=[0.1, 0.2, ...], top_k=5, filter={"category": {"$eq": "tutorial"}})# Namespace queryresults = index.query( vector=[0.1, 0.2, ...], top_k=5, namespace="production")# Access resultsfor match in results["matches"]: print(f"ID: {match['id']}") print(f"Score: {match['score']}") print(f"Metadata: {match['metadata']}")
Metadata filtering
# Exact matchfilter = {"category": "tutorial"}# Comparisonfilter = {"price": {"$gte": 100}} # $gt, $gte, $lt, $lte, $ne# Logical operatorsfilter = { "$and": [ {"category": "tutorial"}, {"difficulty": {"$lte": 3}} ]} # Also: $or# In operatorfilter = {"tags": {"$in": ["python", "ml"]}}
Namespaces
# Partition data by namespaceindex.upsert( vectors=[{"id": "vec1", "values": [...]}], namespace="user-123")# Query specific namespaceresults = index.query( vector=[...], namespace="user-123", top_k=5)# List namespacesstats = index.describe_index_stats()print(stats['namespaces'])
Hybrid search (dense + sparse)
# Upsert with sparse vectorsindex.upsert(vectors=[ { "id": "doc1", "values": [0.1, 0.2, ...], # Dense vector "sparse_values": { "indices": [10, 45, 123], # Token IDs "values": [0.5, 0.3, 0.8] # TF-IDF scores }, "metadata": {"text": "..."} }])# Hybrid queryresults = index.query( vector=[0.1, 0.2, ...], sparse_vector={ "indices": [10, 45], "values": [0.5, 0.3] }, top_k=5, alpha=0.5 # 0=sparse, 1=dense, 0.5=hybrid)
LangChain integration
from langchain_pinecone import PineconeVectorStorefrom langchain_openai import OpenAIEmbeddings# Create vector storevectorstore = PineconeVectorStore.from_documents( documents=docs, embedding=OpenAIEmbeddings(), index_name="my-index")# Queryresults = vectorstore.similarity_search("query", k=5)# With metadata filterresults = vectorstore.similarity_search( "query", k=5, filter={"category": "tutorial"})# As retrieverretriever = vectorstore.as_retriever(search_kwargs={"k": 10})
LlamaIndex integration
from llama_index.vector_stores.pinecone import PineconeVectorStore# Connect to Pineconepc = Pinecone(api_key="your-key")pinecone_index = pc.Index("my-index")# Create vector storevector_store = PineconeVectorStore(pinecone_index=pinecone_index)# Use in LlamaIndexfrom llama_index.core import StorageContext, VectorStoreIndexstorage_context = StorageContext.from_defaults(vector_store=vector_store)index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)
Index management
# List indicesindexes = pc.list_indexes()# Describe indexindex_info = pc.describe_index("my-index")print(index_info)# Get index statsstats = index.describe_index_stats()print(f"Total vectors: {stats['total_vector_count']}")print(f"Namespaces: {stats['namespaces']}")# Delete indexpc.delete_index("my-index")
Delete vectors
# Delete by IDindex.delete(ids=["vec1", "vec2"])# Delete by filterindex.delete(filter={"category": "old"})# Delete all in namespaceindex.delete(delete_all=True, namespace="test")# Delete entire indexindex.delete(delete_all=True)
Best practices
- Use serverless - Auto-scaling, cost-effective
- Batch upserts - More efficient (100-200 per batch)
- Add metadata - Enable filtering
- Use namespaces - Isolate data by user/tenant
- Monitor usage - Check Pinecone dashboard
- Optimize filters - Index frequently filtered fields
- Test with free tier - 1 index, 100K vectors free
- Use hybrid search - Better quality
- Set appropriate dimensions - Match embedding model
- Regular backups - Export important data
Performance
| Operation | Latency | Notes |
|---|---|---|
| Upsert | ~50-100ms | Per batch |
| Query (p50) | ~50ms | Depends on index size |
| Query (p95) | ~100ms | SLA target |
| Metadata filter | ~+10-20ms | Additional overhead |
Pricing (as of 2025)
Serverless:
- $0.096 per million read units
- $0.06 per million write units
- $0.06 per GB storage/month
Free tier:
- 1 serverless index
- 100K vectors (1536 dimensions)
- Great for prototyping
Resources
- Website: https://www.pinecone.io
- Docs: https://docs.pinecone.io
- Console: https://app.pinecone.io
- Pricing: https://www.pinecone.io/pricing
pinecone 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/Orchestra-Research/AI-Research-SKILLs/blob/main/15-rag/pinecone/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
복사





집
