Skip to content

Change visibility modifiers on MemoryRecord and associated collection classes#250

Merged
adrianwyatt merged 3 commits intomicrosoft:mainfrom
craigomatic:publicmemory
Mar 31, 2023
Merged

Change visibility modifiers on MemoryRecord and associated collection classes#250
adrianwyatt merged 3 commits intomicrosoft:mainfrom
craigomatic:publicmemory

Conversation

@craigomatic
Copy link
Contributor

@craigomatic craigomatic commented Mar 31, 2023

Motivation and Context

MemoryRecord, along with several useful classes in the SemanticKernel.Memory.Collections namespace currently have an internal visibility modifier.

This prevents 3rd party libraries from reusing code when creating implementations of IEmbeddingWithMetadata<float>, which is needed in implementations of IMemoryStore<TEmbedding>

Two implementations are currently blocked on this:

  • Skills.Memory.Sqlite
  • Skills.Memory.CosmosDB

As both of these backing stores are not vector DB stores, they implement cosine similarity comparisons locally, which is performed using TopNCollection and its dependencies, all of which are currently internal.

Related community feedback item here: #202

Description

Change the following classes from internal to public:

  • MemoryRecord
  • MinHeap
  • Score
  • ScoredValue
  • TopNCollection

Contribution Checklist

@craigomatic craigomatic added the PR: ready for review All feedback addressed, ready for reviews label Mar 31, 2023
dmytrostruk
dmytrostruk previously approved these changes Mar 31, 2023
Copy link
Member

@dmytrostruk dmytrostruk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of inline GitHub Actions warnings which need to be fixed, but in general LGTM!

@adrianwyatt adrianwyatt merged commit 6e2d314 into microsoft:main Mar 31, 2023
@amsacha amsacha mentioned this pull request Mar 31, 2023
5 tasks
@craigomatic craigomatic deleted the publicmemory branch April 7, 2023 17:09
dehoward pushed a commit to lemillermicrosoft/semantic-kernel that referenced this pull request Jun 1, 2023
… classes (microsoft#250)

### Motivation and Context
`MemoryRecord`, along with several useful classes in the
`SemanticKernel.Memory.Collections` namespace currently have an internal
visibility modifier.

This prevents 3rd party libraries from reusing code when creating
implementations of `IEmbeddingWithMetadata<float>`, which is needed in
implementations of `IMemoryStore<TEmbedding>`

Two implementations are currently blocked on this:
* Skills.Memory.Sqlite
* Skills.Memory.CosmosDB

As both of these backing stores are not vector DB stores, they implement
cosine similarity comparisons locally, which is performed using
`TopNCollection` and its dependencies, all of which are currently
internal.

Related community feedback item here:
microsoft#202

### Description
Change the following classes from internal to public:

* MemoryRecord
* MinHeap
* Score
* ScoredValue
* TopNCollection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: ready for review All feedback addressed, ready for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants