Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Question] How to use a kernel memory plugin with other plugins? #421

Closed
rborosak opened this issue Apr 21, 2024 · 1 comment
Closed

[Question] How to use a kernel memory plugin with other plugins? #421

rborosak opened this issue Apr 21, 2024 · 1 comment

Comments

@rborosak
Copy link

Context / Scenario

Hi,
I was able to implement a memory kernel plugin. The idea is to have a chatbot that answers only to questions from internal documents. If the user ask something that is not related to our documents the bot replies "I don't know".

I have registered the memory plugin and my prompt looks something like this. My project is based on this blog entry https://www.developerscantina.com/p/semantic-kernel-memory/

var prompt = $@"
Question to Kernel Memory: {question}

Kernel Memory Answer: {{memory.ask}}

If the answer is empty say 'I don't know', otherwise reply with the answer.
";

This works as expected.

Now I would like to add a new plugin so the users can book an appointment.
I have registered this new plugin but when the user asks something like "How can I make an appointment" or "I would like to make an appointment" the answer is "I don't know" because it was not found in memory.

Question

How should I change my prompt so that the bot can answer ONLY questions based on our internal documents and still use another plugin (and check if all the input arguments are provided by the user like time, date, place for the appointment)?

Can this be done in a single project or do I need to have two chatbot?

@rborosak rborosak added the question Further information is requested label Apr 21, 2024
@luismanez
Copy link
Contributor

If I'm understanding correctly, I think you need to use a SemanticKernel planner. In a planner, you register your 2 plugins: the appointment plugin, but also your semantic plugin (the prompt you posted that is calling the Memory plugin).
When the user does the request, the SK planner infers the user intent, and runs the best suited plugin found.

I did some SK samples here for a community event: https://github.com/luismanez/gab-bcn-2024/blob/main/src/CozyKitchen/HostedServices/Demo04/PlannerHostedService.cs

Hope it helps.

@microsoft microsoft locked and limited conversation to collaborators Jun 4, 2024
@dluc dluc converted this issue into discussion #540 Jun 4, 2024
@dluc dluc added discussion and removed question Further information is requested labels Jun 4, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants