microsoft / kernel-memory

RAG architecture: index and query any data using LLM and natural language, track sources, show citations, asynchronous memory patterns.

Home Page:https://microsoft.github.io/kernel-memory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow template prompt using "AskAsync"

MaxAkbar opened this issue · comments

Currently, the prompt sent to the LLM is decorated in the SearchClient.cs. This method is suitable for OpenAI or Azure OpenAI, but not for local models. Each local model may require modifying the prompt to obtain the desired response.

For example, if we use the document source:
In physics, mass–energy equivalence is the relationship between mass and energy in a system's rest frame, where the two quantities differ only by a multiplicative constant and the units of measurement. The principle is described by the physicist Albert Einstein's formula: E = m*c^2

Then ask OpenAI "Where was Albert Einstein born?" We get the response that the result was not found.
If we ask a local LLM and if the local LLM was trained on the data it will get an answer.

The intent here is to only allow responses from the Facts found in memory. This will require tweaking the prompt.

Looking at the code looks like there is a provider will play around with it.