-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
.Net: Memory Plugin extraction - Part 2 #3092
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shawncal
added
.NET
Issue or Pull requests regarding .NET code
kernel
Issues or pull requests impacting the core kernel
kernel.core
memory connector
labels
Oct 6, 2023
dmytrostruk
added
the
PR: ready for review
All feedback addressed, ready for reviews
label
Oct 6, 2023
markwallace-microsoft
added
the
PR: breaking change
Pull requests that introduce breaking changes
label
Oct 6, 2023
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've added the breaking change tag to this PR as we expect developers to make a code change and this will get the PR listed in the release notes accordingly.
We want to make it easy for developers to understand and adopt the new pattern. Can you:
- Update the PR description to that includes some instructions on how developers should change their code. It should read like a step by step migration guide.
- Add sufficient information to the obsolete message so developers know what they need to change. We don't have a good pattern here but maybe a link to a sample, we may even want dedicated samples that show how to change the code i.e. with before and after sample code.
dotnet/samples/KernelSyntaxExamples/Example12_SequentialPlanner.cs
Outdated
Show resolved
Hide resolved
SergeyMenshykh
approved these changes
Oct 9, 2023
dotnet/samples/KernelSyntaxExamples/Example14_SemanticMemory.cs
Outdated
Show resolved
Hide resolved
markwallace-microsoft
approved these changes
Oct 9, 2023
SOE-YoungS
pushed a commit
to SOE-YoungS/semantic-kernel
that referenced
this pull request
Nov 1, 2023
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> This PR contains changes to mark Memory-related functionality in Kernel as Obsolete and create alternative methods in `Plugins.Memory` and Connectors projects. Note: Obsolete methods and properties will be removed in future releases. ADR: [0011-memory-as-plugin.md](https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0011-memory-as-plugin.md) **Main change**: helper methods for Memory were moved from `KernelBuilder` to `MemoryBuilder`. Previously, it was possible to configure only one Memory instance per Kernel instance. Now, Memory functionality is decoupled from Kernel and should be configured separately. Previous Memory usage: ```csharp var kernel = Kernel.Builder .WithOpenAITextEmbeddingGenerationService("text-embedding-ada-002", TestConfiguration.OpenAI.ApiKey) .WithMemoryStorage(new AzureCognitiveSearchMemoryStore(TestConfiguration.ACS.Endpoint, TestConfiguration.ACS.ApiKey)) .Build(); kernel.Memory.SaveInformationAsync(...); ``` New Memory usage: ```csharp var memory = new MemoryBuilder() .WithOpenAITextEmbeddingGenerationService("text-embedding-ada-002", TestConfiguration.OpenAI.ApiKey) .WithMemoryStore(new AzureCognitiveSearchMemoryStore(TestConfiguration.ACS.Endpoint, TestConfiguration.ACS.ApiKey)) .Build(); memory.SaveInformationAsync(...); ``` ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Added `MemoryBuilder` as equivalent to `KernelBuilder` to initialize the logic related to Memory. 2. Added unit tests for `MemoryBuilder`. 3. Added extension methods for `MemoryBuilder` related to Memory and AI Connectors. 4. Marked Memory-related methods and properties in Kernel/KernelBuilder as obsolete. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kernel
Issues or pull requests impacting the core kernel
memory connector
.NET
Issue or Pull requests regarding .NET code
PR: breaking change
Pull requests that introduce breaking changes
PR: ready for review
All feedback addressed, ready for reviews
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This PR contains changes to mark Memory-related functionality in Kernel as Obsolete and create alternative methods in
Plugins.Memory
and Connectors projects.Note: Obsolete methods and properties will be removed in future releases.
ADR: 0011-memory-as-plugin.md
Main change: helper methods for Memory were moved from
KernelBuilder
toMemoryBuilder
. Previously, it was possible to configure only one Memory instance per Kernel instance. Now, Memory functionality is decoupled from Kernel and should be configured separately.Previous Memory usage:
New Memory usage:
Description
MemoryBuilder
as equivalent toKernelBuilder
to initialize the logic related to Memory.MemoryBuilder
.MemoryBuilder
related to Memory and AI Connectors.Contribution Checklist