Replies: 4 comments
-
For the sake of understanding When you import file: When you ask:
and finally the prompt will be sent to LLM to get the answer. The bold parts are done by kernel-memory, other parts are done by Semantic Kernel |
Beta Was this translation helpful? Give feedback.
-
Thank you for this question. Chat-Copilot (https://github.com/microsoft/chat-copilot) is an example of an aplication that utilizes kernel-memory in conjunction with semantic-kernel. For advanced application case, you may have the need to talk your data along with other prompt, planner, plug-in, or agent based activities. |
Beta Was this translation helpful? Give feedback.
-
hi @liammoat I suggest looking at Kernel Memory as a Plugin that can be used with Semantic Kernel and SK planners. SK includes a very basic Memory plugin that needs to be maintained in 3 languages and misses some important features like importing files, automatic chunking, RAG, asynchronous data ingestion, etc. The plugin for C# is almost ready, see here, there's also one example: #146 // ...
var memory = new MemoryWebClient("http://127.0.0.1:9001/");
await memory.ImportDocumentAsync("mydocs-NASA-news.pdf");
kernel.ImportFunctions(new MemoryPlugin(memory), "memory");
var skPrompt = """
Question to Kernel Memory: {{$input}}
Kernel Memory Answer: {{memory.ask $input}}
If the answer is empty say 'I don't know' otherwise reply with a preview of the answer, truncated to 15 words.
""";
var oracle = kernel.CreateSemanticFunction(skPrompt);
KernelResult answer = await kernel.RunAsync("any news about Orion?", oracle);
// Answer: Yes, NASA has invited media to see the new test version of the Orion spacecraft...
answer = await kernel.RunAsync("any news about Hubble telescope?", oracle);
// Answer: I don't know. |
Beta Was this translation helpful? Give feedback.
-
Thanks @dluc - that is exactly what I was looking for. 😊 |
Beta Was this translation helpful? Give feedback.
-
I would like to better understand the relationship between kernel-memory and semantic-kernal.
I understand this project targets the specific requirement of "talk to my data" and, from my exploration, provides greater functionality compared to SK's Memory skills. It also works great as a standalone project, with capabilities to index, query, and provide natural language summarisation etc.
The README says:
However, I cannot see how this is intended to work from an implementation perspective. All the samples use kernel-memory directly, without the need for SK. Are there any samples for this scenario?
Beta Was this translation helpful? Give feedback.
All reactions