Skip to content

feat: native short-term memory + everos long-term consolidation#9

Merged
chuanruihu merged 1 commit into
mainfrom
feat/everos_memory_recall_improvements
Jun 30, 2026
Merged

feat: native short-term memory + everos long-term consolidation#9
chuanruihu merged 1 commit into
mainfrom
feat/everos_memory_recall_improvements

Conversation

@YueAWu

@YueAWu YueAWu commented Jun 29, 2026

Copy link
Copy Markdown

Change description

Restructures the EverOS-backed memory subsystem so native memory owns short-term and EverOS owns long-term, and ports three recall improvements from the legacy everclaw repo.

Ported from the legacy repo (env vars renamed EVERCLAW_* -> RAVEN_*):

  • Drop current-session hits from the # Memory recall so it does not duplicate the live conversation already in the history window (over-fetch top_k*2, then filter by session_id).
  • raven agent --message-file for prompts beyond the shell ARG_MAX.
  • Env-gated episodic recall + preference annotation in the consolidator (RAVEN_EPISODIC_TOPK / RAVEN_ANNOTATE_PREFS / RAVEN_EPISODIC_CLUSTER), default-off.

EverOS call-timing refactor (native = short-term, EverOS = long-term):

  • Recall is now on-miss: native runs every turn; EverOS user-track recall fires only when native surfaces nothing relevant to the query.
  • The per-turn EverOS store is removed. EverOS consolidation runs only (a) intra-day, in the background, when a session crosses everos_consolidation_threshold_pct of the context window (default 80), and (b) nightly at everos_nightly_consolidation_hour (default 0, offline).
  • backend.store gains force_flush to promote a batch immediately; consolidation is incremental per session (a metadata watermark) so the intra-day and nightly triggers never double-ingest.
  • Native short-term compaction (maybe_consolidate_by_tokens) is unchanged.

Testing

  • Unit: threshold / nightly / on-miss paths and a full in-memory lifecycle smoke (test_agent_loop_everos_pipeline.py), plus updated test_segments.py / test_default_context_engine.py for the new over-fetch behavior.
  • Real EverOS e2e (test_everos_backend_e2e.py, real_llm): existing dual-track recall plus a new force_flush single-store recall.
  • Full unit sweep shows zero net regression versus a stashed baseline.
  • Not run: a full gateway-boot CLI smoke (no provider/runtime e2e here).

Type of change

  • Bug fix
  • New feature
  • Document
  • Others

Related issues (if there is)

None.

Checklists

Development

  • Lint rules pass locally
  • Application changes have been tested thoroughly
  • Automated tests covering modified code pass

Security

  • Security impact of change has been considered
  • Code follows security best practices and guidelines

Code review

  • Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached as necessary

Two related changes to the EverOS-backed memory subsystem.

Migrated three recall improvements from the legacy everclaw repo
(env vars renamed EVERCLAW_* -> RAVEN_*):
- drop current-session hits from the # Memory recall so it does not
  duplicate the live conversation already in the history window
  (over-fetch top_k*2, then filter by session_id)
- add `raven agent --message-file` for prompts beyond the shell ARG_MAX
- env-gated episodic recall + preference annotation in the consolidator
  (RAVEN_EPISODIC_TOPK / RAVEN_ANNOTATE_PREFS / RAVEN_EPISODIC_CLUSTER),
  default-off

Restructured when EverOS is invoked so native memory owns short-term and
EverOS owns long-term:
- recall is now on-miss: native runs every turn; EverOS user-track recall
  fires only when native surfaces nothing relevant to the query
- the per-turn EverOS store is removed; EverOS consolidation runs only
  (a) intra-day when a session crosses everos_consolidation_threshold_pct
  of the context window (default 80, background, non-blocking) and
  (b) nightly at everos_nightly_consolidation_hour (default 0, offline)
- backend.store gains force_flush to promote a batch immediately;
  consolidation is incremental per session (metadata watermark) so the
  two triggers never double-ingest
- native short-term compaction (maybe_consolidate_by_tokens) is unchanged

Tests: unit coverage for the threshold / nightly / on-miss paths plus a
full in-memory lifecycle smoke, and a real-everos e2e for the
force_flush single-store recall path.

Co-authored-by: Claude (claude-opus-4-8) <noreply@anthropic.com>
@chuanruihu
chuanruihu merged commit b88ea17 into main Jun 30, 2026
chuanruihu added a commit that referenced this pull request Jun 30, 2026
revert: pr #9 native short-term memory + everos long-term consolidation
Kendrick-Song added a commit that referenced this pull request Jul 22, 2026
- Move _everos_server.py from raven/cli/ to raven/plugin/memory/everos/
  _server.py to fix plugin->cli layering violation (CR #1)
- Split HTTP timeout: client default 60s (recall/health), memorize
  add/flush per-request 360s (CR #2)
- Defer backend.start() to post-handshake background task in TUI so
  first render is not blocked by server startup (CR #3)
- Remove unused app_id/project_id from ImportSession and scanner
  (CR #4)
- Add note on per-source-unit checkpoint granularity (CR #5)
- Add fcntl file lock to prevent concurrent server spawn race (CR #6)
- Fix loguru %s format to {} in state.py (CR #7)
- Fix docstring step numbering (CR #8)
- Remove redundant Table import in status_cmd (CR #9)

Co-authored-by: Claude (claude-opus-4-6) <noreply@anthropic.com>
Kendrick-Song added a commit that referenced this pull request Jul 22, 2026
- Move _everos_server.py from raven/cli/ to raven/plugin/memory/everos/
  _server.py to fix plugin->cli layering violation (CR #1)
- Split HTTP timeout: client default 60s (recall/health), memorize
  add/flush per-request 360s (CR #2)
- Defer backend.start() to post-handshake background task in TUI so
  first render is not blocked by server startup (CR #3)
- Remove unused app_id/project_id from ImportSession and scanner
  (CR #4)
- Add note on per-source-unit checkpoint granularity (CR #5)
- Add fcntl file lock to prevent concurrent server spawn race (CR #6)
- Fix loguru %s format to {} in state.py (CR #7)
- Fix docstring step numbering (CR #8)
- Remove redundant Table import in status_cmd (CR #9)

Co-authored-by: Claude (claude-opus-4-6) <noreply@anthropic.com>
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