You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Java: Extend CognitiveSearchMemoryStore with custom MemoryRecord Mapper #3060
MemoryRecord mapping logic in AzureCognitiveSearchMemoryStore.getNearestMatchesAsync method can't be extended. Cognitive Search field names are hardcoded in AzureCognitiveSearchMemoryRecord.
I would suggest to provide an extensibility mechanism for custom cognitive search index field mapping while still preserving the MemoryRecord contract. An idea could be to add an overloaded getNearestMatchesAsync method which accepts a mapper function parameter like this: Function<SearchDocument,MemoryRecord> memoryRecordMapper. An example how you could implement it's here... and you can use it (+/-) like this
This can be useful in scenario where you don't have full control (different teams, different implementations) of both vector store indexing and vector similarity search processes (which is my use case ).
Activity
madsbolaris commentedon Oct 3, 2023
John (@johnoliver), Abby Harrison (@awharrison-28) started a PR for this on the Python side. I'll share a link to it in a bit so you can reference it.
allow customising the reading of memory records. Fixes microsoft#3060
allow customising the reading of memory records. Fixes microsoft#3060
allow customising the reading of memory records. Fixes microsoft#3060
Java: allow customising the reading of memory records. Fixes #3060 (#…
johnoliver commentedon Oct 30, 2023
Fix merged, will go out in the next release
Java: allow customising the reading of memory records. Fixes microsof…
Java: allow customising the reading of memory records. Fixes microsof…