-
Notifications
You must be signed in to change notification settings - Fork 336
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
RedisMemory #208
RedisMemory #208
Conversation
if (!this.Tags.TryAdd(tag.Key, tag.Value)) | ||
{ | ||
this.Tags[tag.Key] = tag.Value; | ||
} |
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.
Maybe we could just use Tags[tag.Key] = tag.Value
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.
why is it a dictionary rather than a list of tag names?
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.
@WeihanLi - good point not sure why I didn't do that in the first place
@dluc - due to the Semantics of a tag field in Redis. Tag fields are separated by a separator character (default is a comma)
Hence you could have blog.tag tech,ai,redis,azure and match on tech, ai, redis, or azure. The dictionary is to give the user the flexibility to use fields with those tag separators in them. Might be worth adding a constructor with a list that just defaults everything to a comma.
A couple of thoughts:
|
I just added this folder: https://github.com/microsoft/kernel-memory/tree/main/extensions/Redis |
Hi @dluc - FYI:
I've moved everything over to the new directory structure/project
Done, I changed
I did this, but I would at least consider moving this logic into a utility class in Abstractions and having all the extensions leverage the same normalizer. FWIW all strings in Redis are parameterized in RESP(Redis Serialization Protocol) and are binary safe, so you could call your indexes/key-names whatever. |
inverting min-relevance for Redis making Tags optional in configuration, updating README changing to KNN from vector-range adding tag escapes cleanup adding back NRedisStack RedisMemoryConfiguration->RedisConfig config updates moving to seperate project/directory adding packing packageId conn-string out of index config, RedisConfig -> RedisIndexConfig, Prefixes, normalized index names fix conflicts sealing RedisMemory handling pre-existing index. Making CreateIndex async Code style, and changes to DI Fix test project and test build settings
Merging - will continue on a separate PR |
## Motivation and Context (Why the change? What's the scenario?) Couple follow on items from #208 1. making vector algorithm configurable (defaulting to HNSW) 2. Updating Readme to explain the presence of Redis Insight 3. Changing tooling to launch redis-stack with Redis insight as well 4. throwing an exception when you attempt to add a tag with the defined separator in it.
Motivation and Context (Why the change? What's the scenario?)
Implements #199
High level description (Approach, Design)
Adds Redis Vector Search as an
IMemoryDb
.Couple of high-level notes:
'topics': ['tech', 'microsoft', 'redis']
would be stored in Redis asHSET key topics tech,microsoft,redis
then when you search on the tag e.g.@topics:{redis}
it will match. What this means from the user's perspective if that if they want to use tags they will need to predefined it before they create the index. I've added a bit to the dependency injection to note this. I also added as a blurb in the README (don't know if there's anywhere else to add those notes to socialize it better)I also added a new test project in line with the other console test projects I saw in here. There's really not too much to test at a unit level here so idk if there's anything else you want on that end.