Vector Databases for Embeddings with Pinecone
James Chapman
Curriculum Manager, DataCamp
index.fetch(ids=['1'])
{'namespace': '',
'usage': {'read_units': 1},
'vectors': {'1': {'id': '1',
'metadata': {"genre": "action", "year": 2023},
'values': [-0.0131468913, ...]}
}
}
index.update(
id="1",
values=[0.370695321, ...]
)
index.fetch(ids=['1'])
{'namespace': '',
'usage': {'read_units': 1},
'vectors': {'1': {'id': '1',
'metadata': {"genre": "action", "year": 2023},
'values': [0.370695321, ...]}
}
}
index.update(
id="1",
set_metadata={"genre": "comedy", "rating": 5}
)
index.fetch(ids=['1'])
{'namespace': '',
'usage': {'read_units': 1},
'vectors': {'1': {'id': '1',
'metadata': {"genre": "comedy", "year": 2023, "rating": 5},
'values': [0.370695321, ...]}
}
}
index.update(
id="1",
values=[-0.31956, ...],
set_metadata={"genre": "thriller", "ratings": 4}
)
index.delete(
ids=["1", "2"]
)
index.delete(
filter={
"genre": {"$eq": "action"},
}
)
index.delete(delete_all=True, namespace='namespace1')
Vector Databases for Embeddings with Pinecone