add long term memory#2496
Open
YuchengZhou821 wants to merge 40 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new long-term memory subsystem to Fuser, enabling persistent “facts” (MEMORY.md) and embedding-based retrieval over daily interaction logs, wired through runtime configuration and prompt fusion.
Changes:
- Introduces
MemoryReader/MemoryWriterfor reading/searching and writing memory files. - Adds
MemoryIndexand supporting parsing/index population for embedding-based daily-log search. - Extends runtime config/conversion and integrates memory context injection and interaction logging into the runtime tick.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/runtime/cortex.py |
Appends Voice interactions to memory after actions execute. |
src/runtime/converter.py |
Carries memory config through the single→multi conversion global section. |
src/runtime/config.py |
Adds memory to RuntimeConfig/ModeSystemConfig and (de)serialization. |
src/fuser/__init__.py |
Initializes memory components and injects memory context into the fused prompt. |
src/fuser/memory_base/indexer.py |
Implements in-memory embedding index, daily parsing, and index population/retention behavior. |
src/fuser/memory_base/reader.py |
Implements reading MEMORY.md, searching daily logs, and formatting memory context. |
src/fuser/memory_base/writer.py |
Implements writing daily interactions/summaries and appending facts to MEMORY.md. |
src/fuser/memory_base/__init__.py |
Adds the new memory_base package. |
❌ 5 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
48365d1 to
eecd67d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 10 comments.
Comments suppressed due to low confidence (1)
src/fuser/init.py:114
query_textis derived from the voice input in the newly added block, but the knowledge-base query block re-fetchesVoiceand resetsquery_texttoNoneagain. This duplicates IOProvider calls and makes it easier for KB/memory to diverge on which utterance they query. Consider computingquery_textonce per tick and reusing it for both KB and memory queries.
query_text = None
voice_input = self.io_provider.get_input("Voice")
if voice_input and voice_input.input and self.io_provider.tick_counter == voice_input.tick:
query_text = voice_input.input.strip()
# Query the knowledge base if configured and if there are inputs to query with
kb_context = ""
if self.knowledge_base and inputs_fused:
try:
query_text = None
voice_input = self.io_provider.get_input("Voice")
if voice_input and voice_input.input and self.io_provider.tick_counter == voice_input.tick:
query_text = voice_input.input.strip()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new long-term memory subsystem to the Fuser application, enabling persistent storage and retrieval of facts and daily interactions. The changes add support for reading and writing memory, searching daily logs using embeddings, and configuring memory via the runtime configuration. The most important changes are grouped below:
Long-Term Memory Subsystem Implementation:
MemoryReaderandMemoryWriterclasses to provide reading, searching, and writing capabilities for persistent memory, including support for aMEMORY.mdfile (for facts) and daily markdown logs (for interactions and summaries). (src/fuser/memory_base/reader.py,src/fuser/memory_base/writer.py) [1] [2]MemoryIndexfor in-memory embedding-based search over memory chunks, with support for batch indexing, cosine similarity search, and daily log parsing. (src/fuser/memory_base/indexer.py)Integration with Fuser Core:
src/fuser/__init__.pyto initialize and useMemoryReaderandMemoryWriterbased on new configuration options, and to inject relevant memory context into the fused prompt during operation. [1] [2] [3] [4] [5]Configuration Enhancements:
RuntimeConfigandModeSystemConfigto support a newmemoryconfiguration block, allowing memory features to be enabled or disabled via config files. Updated config loading and serialization logic accordingly. (src/runtime/config.py) [1] [2] [3] [4] [5]These changes lay the foundation for persistent, queryable long-term memory, improving the application's ability to recall and leverage past interactions and facts.