kingjulio8238 / memary

Human Memory for AI Agents.
https://www.memarylabs.com
MIT License
1.14k stars 79 forks source link

Pass Specific Entities Into the Context Window #42

Open kingjulio8238 opened 3 weeks ago

kingjulio8238 commented 3 weeks ago

As outlined in the readme, memary currently extracts the top N entities (set to 20) from the Entity Knowledge Store. We pass these entities into the new context window for inference.

memary can future benefit from more advanced memory compression techniques such as passing only the entities that are present in the agent's response to the context window. This will help the system understand the users' knowledge of concepts for that specific execution which will lead to more relevant responses.

We look forward to related community contributions.

kingjulio8238 commented 3 weeks ago

To further elaborate:

If the response from the ReAct agent is “The Mona Lisa can be found in the Louvre in Paris” then only the counts and recency of these entities (Mona Lisa, Louvre, Paris) are passed into the context window to infer user knowledge around the topic. Before we were passing the top 20 entities regardless, not considering which entities were in the response.

kingjulio8238 commented 3 weeks ago

Here is what the new design for entity extraction could look like (second image). Simpler and more effective.

old-extraction

new-extraction