Memory Class Refactoring #189
BhoomiAgrawal12
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While working with
mesa-llm, I noticed thatLLMAgent.__init__unconditionally creates anSTLTMemoryinstance and there is currently no way to pass a different memory class during construction. Users who wantEpisodicMemory,ShortTermMemoryorLongTermMemoryhave to manually reassignagent.memoryafter creation, which completely bypassesllm_modelforwarding.There is also no hook to customize memory per agent, which I feel becomes a blocker for
LLMAgent.create_agents()as well.The four memory types are designed for different use cases:
STLTMemory: General-purpose agents with balanced memory + costShortTermMemory: Lightweight agents and no consolidation neededLongTermMemory: Agents needing a summarized view of long historyEpisodicMemory: Importance-weighted recallHowever, the choice is currently hardcoded. My understanding is that allowing the memory implementation to be configurable during agent construction would make the design more flexible.
One possible approach could be introducing a
memory_classparameter (defaulting toSTLTMemoryfor backward compatibility) along with amemory_kwargsdictionary to forward additional arguments to whichever memory class is selected.From my perspective this seems like a reasonable gap in the current implementation rather than an intentional restriction, but I wanted to confirm with the maintainers before implementing anything.
If this direction aligns with the project’s design goals, I’d be happy to work on a PR for it.
@jackiekazil @colinfrisch @wang-boyu
Beta Was this translation helpful? Give feedback.
All reactions