Skip to content

fix(session): trigger semantic indexing for parent directory after memory extraction#429

Merged
MaojiaSheng merged 1 commit intomainfrom
fix/memory-search-semantic-indexing
Mar 5, 2026
Merged

fix(session): trigger semantic indexing for parent directory after memory extraction#429
MaojiaSheng merged 1 commit intomainfrom
fix/memory-search-semantic-indexing

Conversation

@qin-ctx
Copy link
Collaborator

@qin-ctx qin-ctx commented Mar 5, 2026

Description

Extracted memories were not searchable via vector search because the parent directory's .abstract.md/.overview.md (level 0/1) were never generated after memory extraction, making them invisible to the hierarchical retriever's global search phase.

Related Issue

Fixes #422

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Changes Made

  • openviking/session/compressor.py: Add _enqueue_semantic_for_parent() call in _index_memory() to trigger parent directory semantic generation (.abstract.md/.overview.md) after every memory indexing operation. This ensures the hierarchical retriever can discover the directory at level 0/1 and then drill into level-2 memory files.
  • openviking/session/memory_extractor.py: Remove duplicate _enqueue_semantic_for_parent() calls from _merge_tool_memory() and _merge_skill_memory(), since _index_memory() in the compressor now handles this uniformly for all memory types.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes

Root cause: The search system uses hierarchical retrieval -- it first searches directory-level summaries (.abstract.md at level 0/1), then drills into matched directories to find actual files (level 2). Resource ingestion correctly triggers the full SemanticQueue -> SemanticProcessor pipeline, but memory extraction only enqueued the memory file itself (level 2) to EmbeddingQueue, skipping the parent directory semantic generation step.
image

…mory extraction

Extracted memories were not searchable because _index_memory() only enqueued
the memory file (level 2) to EmbeddingQueue, without triggering SemanticQueue
for the parent directory. The hierarchical retriever searches level 0/1 first,
so without parent directory .abstract.md/.overview.md being generated and
indexed, the search could never discover the directory containing new memories.

- Add _enqueue_semantic_for_parent() call in _index_memory() to generate
  parent directory summaries after every memory indexing operation
- Remove duplicate _enqueue_semantic_for_parent() calls from
  _merge_tool_memory() and _merge_skill_memory() since _index_memory()
  now handles this uniformly

Closes #422

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@MaojiaSheng MaojiaSheng merged commit 904f735 into main Mar 5, 2026
4 of 6 checks passed
@MaojiaSheng MaojiaSheng deleted the fix/memory-search-semantic-indexing branch March 5, 2026 07:03
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Newly extracted memories are not searchable via vector search (embedding index not updated)

4 participants