Skip to content
Navigation
Dashboard
💻Interactive•35 min

Pinecone Deep Dive

Build with Pinecone, the leading managed vector database.

Pinecone Deep Dive

Getting Started

1. Create account at pinecone.io 2. Create index with dimension (e.g., 1536) 3. Install SDK: pip install pinecone-client

Core Operations

Initialize: import pinecone pc = pinecone.Pinecone(api_key="...") index = pc.Index("my-index")

Upsert (Insert/Update): index.upsert(vectors=[ {"id": "doc1", "values": embedding, "metadata": {...}} ])

Query: results = index.query( vector=query_embedding, top_k=10, include_metadata=True )

Namespaces

Partition data within an index:

  • Different document collections
  • Multi-tenant applications
  • A/B testing
  • Metadata Filtering

    Combine vector search with filters: index.query( vector=embedding, filter={"category": "science", "year": {"$gte": 2020}} )

    Best Practices

  • Batch upserts for speed
  • Use namespaces for organization
  • Index appropriate dimension
  • Monitor usage and costs
  • 🎯 Key Takeaways

    • ✓Pinecone is fully managed and easy to use
    • ✓Namespaces partition data within an index
    • ✓Metadata filters refine search results
    • ✓Batch operations for better performance

    📚 Additional Resources