Skip to content

feat: add transformer implementation - #1

Merged
hustcc merged 13 commits into
masterfrom
feat/add-transformer
Jul 7, 2026
Merged

feat: add transformer implementation#1
hustcc merged 13 commits into
masterfrom
feat/add-transformer

Conversation

@lxfu1

@lxfu1 lxfu1 commented Jul 3, 2026

Copy link
Copy Markdown
Member

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly refactors and enhances the local context retrieval library, introducing advanced features such as document chunking, hybrid search (vector + FTS text matching), synonym-based query expansion, keyword-based reranking, progress callbacks, and a robust storage manager with a pure JS memory fallback. The review feedback identifies several critical bugs and improvement opportunities in the new implementation: a query filter and slicing bug in expandChunk, incorrect heading path tracking for sibling H3 headings in the Markdown chunker, a word boundary checking limitation in both the keyword reranker and synonym expander that only evaluates the first occurrence of a term, and swallowed error details during document loading.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/context.ts Outdated
Comment thread src/loaders/chunker.ts Outdated
Comment thread src/utils/reranker.ts
Comment thread src/context.ts Outdated
Comment thread src/utils/expander.ts
@lxfu1 lxfu1 changed the title [WIP]feat: add transformer implementation feat: add transformer implementation Jul 6, 2026
@lxfu1
lxfu1 requested a review from hustcc July 6, 2026 02:23
@hustcc

hustcc commented Jul 6, 2026

Copy link
Copy Markdown
Member
  1. chunk 先不需要,用不到,也不确定做得好不好,做 chunk 的一堆学术论文,没有了解清楚先不做。
  2. store-mamnage 放到 storage 目录中,这个目录就是做 zvec 存储相关的,暴露的方法应该是:create、addDoc、queryDoc 功能,其他都需要。
  3. query-expander.ts,reranker.ts 都是纯函数,放到对应模快的 util 中去。expander 的核心逻辑是根据 sample 的文字内容,去确定分词采用 jieba 还是 standard,这个是一个非常纯的纯函数,不要分散多个地方去做。
  4. src/registry.ts 感觉不需要。
  5. embedder 的 simple 删除吧,不需要兜底。
  6. loader 中的 id 还是用相对路径,不用绝对路径。
  7. actual 和 momery store 没有看懂为啥有区别?
  8. readme 简洁一些,readme 不是我们的 plan,是一个项目对用户透漏的内容。

保持代码和功能最简,diff 能不能减少到 3

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
@lxfu1

lxfu1 commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

7. actual 和 momery store 没有看懂为啥有区别?

  1. chunk 先不需要,用不到,也不确定做得好不好,做 chunk 的一堆学术论文,没有了解清楚先不做。
  2. store-mamnage 放到 storage 目录中,这个目录就是做 zvec 存储相关的,暴露的方法应该是:create、addDoc、queryDoc 功能,其他都需要。
  3. query-expander.ts,reranker.ts 都是纯函数,放到对应模快的 util 中去。expander 的核心逻辑是根据 sample 的文字内容,去确定分词采用 jieba 还是 standard,这个是一个非常纯的纯函数,不要分散多个地方去做。
  4. src/registry.ts 感觉不需要。
  5. embedder 的 simple 删除吧,不需要兜底。
  6. loader 中的 id 还是用相对路径,不用绝对路径。
  7. actual 和 momery store 没有看懂为啥有区别?
  8. readme 简洁一些,readme 不是我们的 plan,是一个项目对用户透漏的内容。

保持代码和功能最简,diff 能不能减少到 3

已修改。

Comment thread src/registry.ts Outdated
@@ -0,0 +1,407 @@
/**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

再检查下这个类,是必须的吗,我看代码就是把 zvec 的方法代理了一遍?有些方法还没用到,比如 searchHybridSync。

@hustcc
hustcc merged commit 347bc4e into master Jul 7, 2026
2 checks passed
@hustcc
hustcc deleted the feat/add-transformer branch July 7, 2026 10:37
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