New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update redis vector store #12386
Update redis vector store #12386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Progress! I like the new setup quite a bit. Mostly just some questions for my own understanding
...ations/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/base.py
Show resolved
Hide resolved
...ations/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/base.py
Outdated
Show resolved
Hide resolved
...ations/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/base.py
Outdated
Show resolved
Hide resolved
...ations/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/base.py
Outdated
Show resolved
Hide resolved
...ations/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/base.py
Show resolved
Hide resolved
...ations/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/base.py
Show resolved
Hide resolved
...ations/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/base.py
Outdated
Show resolved
Hide resolved
...ions/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/schema.py
Show resolved
Hide resolved
llama-index-integrations/vector_stores/llama-index-vector-stores-redis/poetry.lock
Outdated
Show resolved
Hide resolved
llama-index-integrations/vector_stores/llama-index-vector-stores-redis/pyproject.toml
Outdated
Show resolved
Hide resolved
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
fea16d5
to
1bfe4fd
Compare
@logan-markewich ok all ready for another review from you! thanks! |
ids.append(node.node_id) | ||
key = "_".join([self._prefix, str(node.node_id)]) | ||
self._redis_client.hset(key, mapping=mapping) # type: ignore | ||
data.append({**record, **additional_metadata}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, all the metadata is added (nice). I saw some examples where the custom schema specifically defines metadata fields -- what's the advantage with doing that? How is that different from the default behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question. Redis keeps the "data" and "index" as separate constructs. So what you write/include in the payload here doesn't have to be added to the schema. Sometimes it's more performant or cost effective to NOT index fields you don't need to.
There are two modes here of using Redis:
- Default schema: in this mode, only the bare minimum, required fields will be "indexed" in Redis and searchable/filterable. However you can still store all arbitrary metadata that you want -- but it won't be included in the search index (still available to be returned along side). You can get started with this out of the box. No schema definition required.
- Custom schema: in this mode, user can define a custom schema, which you have seen. This allows for customization of vector settings (algorithm, dims, etc) AND adding additional metadata like tags or text or numerics to the search index. Can also customize index name etc.
We could look at ways in between too if you think we need to support additional ways!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes a ton of sense -- thank you for clarifying !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks a ton for the hustle on this @tylerhutcherson
Description
This PR introduces a refactor of the
RedisVectorStore
interface and functionality. Highlights include:@logan-markewich would love your eyes on this first before I take another step at implementing deeper unit tests and integration tests. Because of the size of the changes, I'd love to get alignment first.
Version Bump?
Did I bump the version in the
pyproject.toml
file of the package I am updating? (Except for thellama-index-core
package)Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Suggested Checklist:
make format; make lint
to appease the lint gods