Skip to content

Java: Extend CognitiveSearchMemoryStore with custom MemoryRecord Mapper #3060

Closed

Description

@dantelmomsft
  • 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

  1. madsbolaris commented on Oct 3, 2023

    @madsbolaris
    Member

    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.

  2. added 3 commits that reference this issue on Oct 19, 2023
    fad4a59
    ffa8b21
    4e5abbd
  3. added a commit that references this issue on Oct 27, 2023
    b871957
  4. johnoliver commented on Oct 30, 2023

    @johnoliver
    Member

    Fix merged, will go out in the next release

  5. added 2 commits that reference this issue on Jun 5, 2024
    a3264c2
    3c18c72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

javaIssue or PR regarding Java code

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions