Skip to content

feat: L0/L1 tiered memory retrieval + redundancy compression + governance improvements#2

Merged
XuPeng-SH merged 2 commits intomatrixorigin:mainfrom
XuPeng-SH:dev2
Mar 12, 2026
Merged

feat: L0/L1 tiered memory retrieval + redundancy compression + governance improvements#2
XuPeng-SH merged 2 commits intomatrixorigin:mainfrom
XuPeng-SH:dev2

Conversation

@XuPeng-SH
Copy link
Collaborator

What type of PR is this?

  • feat (new feature)
  • fix (bug fix)
  • docs (documentation)
  • style (formatting, no code change)
  • refactor (code change that neither fixes a bug nor adds a feature)
  • perf (performance improvement)
  • test (adding or updating tests)
  • chore (maintenance, tooling)
  • build / ci (build or CI changes)

Which issue(s) this PR fixes

Fixes #

What this PR does / why we need it

Implements three major enhancements to Memoria's memory governance and retrieval system:

  1. L0/L1 Tiered Retrieval — Session-scoped working/tool_result memories (L0) are now explicitly loaded and prepended to cross-session semantic/procedural/profile results (L1). Opt-in at the retriever level; controlled by the TieredMemoryLoader at the context assembly layer.

  2. Redundancy Compression — Daily governance now detects and deactivates near-duplicate memories using vectorized L2² distance (numpy). Per-type grouping and configurable similarity threshold (default 0.95) avoid O(n²) DB pressure.

  3. Governance Robustness — Fixed broken _mark_daily_user method, added bounded marker keys (short user_ids kept readable, long ones hashed to 64-bit), improved incremental governance change detection.

@XuPeng-SH XuPeng-SH requested a review from LeftHandCold March 12, 2026 06:32
@XuPeng-SH XuPeng-SH enabled auto-merge (squash) March 12, 2026 06:37
@XuPeng-SH XuPeng-SH merged commit 9d99085 into matrixorigin:main Mar 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants