Skip to content

Fix retriever#382

Merged
MaojiaSheng merged 2 commits intomainfrom
fix_retriever
Mar 2, 2026
Merged

Fix retriever#382
MaojiaSheng merged 2 commits intomainfrom
fix_retriever

Conversation

@zhoujh01
Copy link
Collaborator

@zhoujh01 zhoujh01 commented Mar 2, 2026

Description

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • 检索过滤模型升级为 PathScope/深度语义
    • 在 openviking/storage/expr.py 新增 PathScope,并在 openviking/storage/viking_vector_index_backend.py 中把很多 uri/
      parent_uri 过滤改成了带 depth 的路径过滤(如 depth=0 精确、depth=1 子层、depth=-1 前缀)。
    • _merge_filters 忽略空 RawDSL(and, conds=[]),避免空条件污染合并结果。
  • adapter 层统一 URI 编解码
    • openviking/storage/vectordb_adapters/base.py 增加了 uri/parent_uri 的写入编码(viking://... -> /...)和读取解码(/...
      -> viking://...),以及 filter payload 的递归转换。
    • vikingdb_private_adapter.py、volcengine_adapter.py 统一复用基类逻辑,减少分叉实现。
  • 目录 L0/L1 向量写入语义重构(uri 与 level 解耦)
    • openviking/storage/queuefs/semantic_processor.py、openviking/core/directories.py、openviking/utils/
      skill_processor.py:目录向量写入时,uri 改为目录本身,通过 level=0/1 区分 abstract/overview,不再依
      赖 /.abstract.md、/.overview.md 作为存储 uri。
    • openviking/storage/collection_schemas.py:ID 生成改为“account_id + uri + level后缀”的稳定种子,避免 L0/L1 覆盖。
  • Context/转换链路补齐 level 字段
    • openviking/core/context.py 增加 level 字段透传(构造、to_dict、from_dict)。
    • openviking/storage/queuefs/embedding_msg_converter.py 优先使用 context.level/已有 level,再回退 URI 后缀推断。
  • Retriever 召回与结果组织调整
    • openviking/retrieve/hierarchical_retriever.py:同 URI 候选去重(保留高分)、仅对目录递归、结果展示时按 level 还
      原 /.abstract.md 或 /.overview.md 后缀。
    • 递归收敛/top-k 逻辑也随去重结构做了对应调整。
  • VikingFS 目标范围和权限细节修正
    • openviking/storage/viking_fs.py:target_uri 为根(//viking://)时按全局处理;补充了 scope 根元文件(如
      viking://agent/.overview.md)的空间提取/访问判断。

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
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

@MaojiaSheng MaojiaSheng merged commit 2699d7c into main Mar 2, 2026
5 checks passed
@MaojiaSheng MaojiaSheng deleted the fix_retriever branch March 2, 2026 13:47
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 2, 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.

2 participants