microsoft / kernel-memory

RAG architecture: index and query any data using LLM and natural language, track sources, show citations, asynchronous memory patterns.
https://microsoft.github.io/kernel-memory
MIT License
1.52k stars 293 forks source link

[Question] Reading document status #518

Closed Valkozaur closed 4 months ago

Valkozaur commented 4 months ago

Context / Scenario

Hello, thank you for supporting kernel memory, it's a powerful service.

The question is regarding running the container as a separate service.

Question

I am wondering if the GetDocumentStatusAsync is the only way to know if a document is processed?

I thought that it might be possible to post a message on a queue once the document is processed, so we skip the polling of status.

I had a look through the code but I could not find anything that suggests that.

dluc commented 4 months ago

I thought that it might be possible to post a message on a queue once the document is processed, so we skip the polling of status.

hi @Valkozaur - if we posted a message on a queue, how would the client know that the message is there? wouldn't the client have to poll the queue?

dluc commented 4 months ago

You can implement your approach adding a "custom handler". When importing a document, you can provide in input a list of steps, which corresponds to the list of handlers to execute.

In the service, you can add a custom handler, used to post a message in a queue that you own, if that helps your scenario.

How to: