Mengelola indeks

Database Vektor untuk Embeddings dengan Pinecone

James Chapman

Curriculum Manager, DataCamp

Menyambungkan ke indeks

pc = Pinecone(api_key="API_KEY")

pc.create_index(
    name='datacamp-index',
    dimension=1536,
    spec=ServerlessSpec(
        cloud='aws', 
        region='us-east-1'
    )
)


index = pc.Index('datacamp-index')
Database Vektor untuk Embeddings dengan Pinecone

Menyambungkan ke indeks

index = pc.Index('datacamp-first')
...
pinecone.core.client.exceptions.NotFoundException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'content-type': 'text/plain; charset=...
HTTP response body: {"error":{"code":"NOT_FOUND","message":"Resource datacamp-first
not found"},"status":404}
Database Vektor untuk Embeddings dengan Pinecone

Statistik indeks

index.describe_index_stats()
{'dimension': 1536,
 'index_fullness': 0.0,
 'namespaces': {},
 'total_vector_count': 0}
Database Vektor untuk Embeddings dengan Pinecone

Namespace

 

  • Wadah untuk mempartisi indeks
    • Dataset terpisah
    • Versioning data
    • Kelompok terpisah

 

Fokus dulu pada kasus satu namespace

Indeks dengan beberapa namespace di dalamnya.

Database Vektor untuk Embeddings dengan Pinecone

Organisasi

Sebuah organisasi dengan dua proyek, masing-masing memiliki indeks sendiri.

Database Vektor untuk Embeddings dengan Pinecone

Organisasi

Sekelompok pemilik organisasi.

  • Izin di seluruh organisasi
  • Kelola penagihan, pengguna, dan semua proyek

Seorang pemilik dengan beberapa pengguna di bawahnya.

  • Izin tingkat organisasi terbatas
  • Diundang ke proyek tertentu
  • Menjadi pemilik untuk proyek tersebut
Database Vektor untuk Embeddings dengan Pinecone

Menghapus indeks

pc.delete_index('datacamp-index')


pc.list_indexes()
{'indexes': []}
Database Vektor untuk Embeddings dengan Pinecone

Ayo berlatih!

Database Vektor untuk Embeddings dengan Pinecone

Preparing Video For Download...