Can't find a way to get the Summary out that was generated for the imported document? #566
-
Bing chat says that this should work:
which obviously doesn't and I can't find anything in the documentation to get the summary that was extracted during the pipeline stage when using Constants.PipelineWithSummary How does one retrieve it? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
hi @JohnGalt1717 we've made it easier in the latest version 0.20, e.g. var results = await memory.SearchSummariesAsync(filter: MemoryFilters.ByDocument("doc1")); That will work with any pipeline as long as the summarization step is included. Here's a complete example: https://github.com/microsoft/kernel-memory/blob/main/examples/106-dotnet-retrieve-synthetics/Program.cs You can leverage the same feature if you have custom handlers that generate synthetic memories (the summary is a synthetic memory). For instance, assume you have a TranslationHandler that translates documents, adding the "translation" synthetic tag ( var results = await memory.SearchSyntheticsAsync("translation", filter: MemoryFilters.ByDocument("doc1")); |
Beta Was this translation helpful? Give feedback.
-
forgot to add, if you're using the web service, you can also do:
{
"filters": [
{
"__document_id": ["doc1"],
"__synth": ["summary"]
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Great! Thanks! |
Beta Was this translation helpful? Give feedback.
hi @JohnGalt1717 we've made it easier in the latest version 0.20, e.g.
That will work with any pipeline as long as the summarization step is included. Here's a complete example: https://github.com/microsoft/kernel-memory/blob/main/examples/106-dotnet-retrieve-synthetics/Program.cs
You can leverage the same feature if you have custom handlers that generate synthetic memories (the summary is a synthetic memory). For instance, assume you have a TranslationHandler that translates documents, adding the "translation" synthetic tag (
AddSyntheticTag("translation")
), you can then retrieve those translations …