Skip to content

Commit

Permalink
community[patch]: Upstash Vector Store Namespace Support (langchain-a…
Browse files Browse the repository at this point in the history
…i#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>
  • Loading branch information
3 people authored Jun 4, 2024
1 parent 25cf1a7 commit 0061ded
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 19 deletions.
16 changes: 16 additions & 0 deletions docs/docs/integrations/providers/upstash.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 0061ded

Please sign in to comment.