Skip to content

Optimization: Inject Multiple Memory Types into System Prompt #6

@gaoteng-git

Description

@gaoteng-git

Priority: P2 [9/832]

Summary

When a claude-code session starts, the hook currently injects only episodic memories into the system prompt. This issue explores injecting
additional memory types — event_log, foresight, and raw MemCell responses — to provide the Agent with richer historical context.

Background

When a claude-code session starts, the hook retrieves memories from EverMemOS and injects them into the system prompt, allowing the LLM to be
aware of historical context throughout the session. Currently, only the episodic type is injected:

Memory Type Description
episodic High-level summary information (currently injected)
event_log Fine-grained details of each atomic event
foresight Predictions about the user's future behavior
Raw MemCell response The Agent's verbatim answers from past conversations, generally high quality

TODO

  • Support injecting event_log into the system prompt and evaluate the effect
  • Support injecting foresight into the system prompt and evaluate the effect
  • Support injecting the Agent's raw responses from MemCells (without memory extraction) into the system prompt and evaluate the effect
  • Estimate token counts for injected content and set an upper limit to prevent excessively long prompts

Uncertainty

  • The effectiveness of adding event_log and foresight is unclear and requires empirical validation
  • Raw MemCell responses are generally high quality and are expected to be beneficial when injected directly, but this still needs to be verified

Risks

  • Injecting more memory types may significantly increase the token count of the system prompt, affecting cost and context window utilization
  • A filtering or truncation strategy is needed to avoid injecting excessive low-value content

Notes

  • This is an optional quality enhancement that does not affect current system availability; classified as P2

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions