Pinecone Database
# pip install "pinecone[grpc]" from pinecone.grpc import PineconeGRPC as Pinecone pc = Pinecone(api_key="YOUR_API_KEY") index = pc.Index("docs-example") index.query( namespace="example-namespace", vector=[0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3], filter={ "genre": {"$eq": "documentary"} }, top_k=3, include_values=True )
{ "matches":[ { "id": "vec3", "score": 0, "values": [0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3] }, { "id": "vec2", "score": 0.0800000429, "values": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2] }, { "id": "vec4", "score": 0.0799999237, "values": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4] } ], "namespace": "example-namespace", "usage": {"read_units": 6} }
Search a namespace with a query vector or record ID and return the IDs of the most similar records, along with their similarity scores.
For guidance, examples, and limits, see Search.
1 <= x <= 10000
Show child attributes
512
Was this page helpful?