qmatteoq / SemanticKernel-Demos

MIT License
58 stars 6 forks source link

SemanticKernel.Memory not workig as expected #3

Open rborosak opened 6 months ago

rborosak commented 6 months ago

Hi, Thank you for these examples. They are a great help into getting started with AI. I have been learning about KernelMemory and SemanticMemory.

I was successful in reproducing the KernelMemory example. I have uploaded some documents and the AI is using RAG to answer my questions ONLY if they are related to the before provided knowledge (from the uploaded documents).

Next step is to expand on Q&A and create a chat like experience. I found the example SemanticKernel.Memory which kind of works. The AI is answering my questions but the problem is that is answering any other question. When I input something like "write a poem about spring" a get a poem.

Is there a way to stop that kind of behavior and make it answer only from the given knowledge from the MemoryKernel.

(Is memory kernel using its own "answer-with-facts" prompt or OpenAIPromptExecutionSettings default "Assistant is a large language model" chat system prompt)

How can we setup a MemoryKernel prompt when using it as a SemanticKernel plugin? Are there any examples on how to structure the prompt when creating an OpenAIPromptExecutionSettings?

Thank you

qmatteoq commented 1 month ago

Hello @rborosak I truly apologize but I totally missed the notification on this issue. Since it's very old, can you let me know if you're still blocked?

rborosak commented 1 month ago

@qmatteoq Thank you for answering. The question still stands but is not urget.