mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 03:59:42 +00:00
community[patch]: Upstash Vector Store Namespace Support (#22251)
This PR introduces namespace support for Upstash Vector Store, which would allow users to partition their data in the vector index. --------- Co-authored-by: Bagatur <baskaryan@gmail.com> Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
This commit is contained in:
@@ -61,6 +61,22 @@ store = UpstashVectorStore(
|
||||
See [Upstash Vector documentation](https://upstash.com/docs/vector/features/embeddingmodels)
|
||||
for more detail on embedding models.
|
||||
|
||||
## Namespaces
|
||||
You can use namespaces to partition your data in the index. Namespaces are useful when you want to query over huge amount of data, and you want to partition the data to make the queries faster. When you use namespaces, there won't be post-filtering on the results which will make the query results more precise.
|
||||
|
||||
```python
|
||||
from langchain_community.vectorstores.upstash import UpstashVectorStore
|
||||
import os
|
||||
|
||||
os.environ["UPSTASH_VECTOR_REST_URL"] = "<UPSTASH_VECTOR_REST_URL>"
|
||||
os.environ["UPSTASH_VECTOR_REST_TOKEN"] = "<UPSTASH_VECTOR_REST_TOKEN>"
|
||||
|
||||
store = UpstashVectorStore(
|
||||
embedding=embeddings
|
||||
namespace="my_namespace"
|
||||
)
|
||||
```
|
||||
|
||||
### Inserting Vectors
|
||||
|
||||
```python
|
||||
|
Reference in New Issue
Block a user