Getting Started
Install
To begin using upstash-vector
, you can install it via PyPI using the following command:
Usage
Before using upstash-vector, you’ll need to set up a vector database on Upstash. Once created, grab your URL and TOKEN from the Upstash console.
To initialize the index client:
Alternatively, you can automatically load the credentials from the environment:
For serverless environments that allow it, it’s recommended to initialize the client outside the request handler to be reused while your function is still “hot.”
Here’s an example of how you can use the SDK in your Python application:
The example above demonstrates how to upsert a vector with metadata using the SDK into the Upstash Vector database.
More SDK Features
For additional functionalities and usage examples, check out the Commands section in the documentation.