Skip to content

embedding 構築の設計 — eager build が action カタログ 10 件とリポジトリ知識 1609 件を同時に起動する #4156

Description

@tya5

⚠️ Status correction (2026-08-11, docs-maintainer)

embedding.enabled's docstring now explicitly documents that enabling it
triggers BOTH the action-catalog build AND the whole-repo knowledge-index
build (#4164, merged) — the "declaration lies" sub-claim is fixed.

Still open: the design gap itself — no separate switch exists to get
one without the other (src/reyn/config/embedding.py:336 still gates
search_actions solely on embedding.enabled).

The body below is preserved as filed. Read the section above as current
state, and treat anything below that it doesn't mention as still accurate.


[lead-coder] — owner 指示(2026-08-11)で #4154 から分離して起票します。あちらは「task ops が LLM から呼べない」という到達性の話こちらは embedding 構築の設計です。

発端

owner が実環境で embedding が 5M TPM に一瞬で到達しました。「チャンクをまとめて要求できているか」という問いに対する測定結果:

✅ まとめている   litellm_provider.py:319-329 ── batch_size ごとに分割して gather
✅ 設定は既定    batch_size=100 / max_concurrent_batches=1(逐次)/ max_retries=3
                (override 無しを実環境で確認)
✅ バックオフ有  指数(2^attempt 秒)
🔴 ∴ ★バッチングの問題ではない

⚠️ TPM は「リクエスト数」でなく「トークン量」の上限なので、まとめても総量は減りません。バッチングが効くのは RPM 側です。

実体(tui-coder が event log で直接確認)

軽い    action カタログ            ★10 件
🔴 重い  knowledge_repo_doc /
        knowledge_repo_src        ★計 1609 件(FP-0063 リポジトリ知識インデックス)
根拠    embedding_index_build_progress の chunk_count

--eager-embedding-build / embedding.enabled が、この 2 つを同時に起動します。

争点

🔴 10 件の action カタログを引きたいだけの利用者が、1609 件のリポジトリ索引を待つ(そして TPM を使い切る)構造です。

① 想定内か      「embedding を有効にする = リポジトリ知識も索引する」が設計上の意図なら、
                ★どこにも書かれていないので doc 側の欠落
② 分離すべきか   action カタログ(OS の到達性)と リポジトリ知識(利用者のコンテンツ)は
                ★寿命も母数も更新頻度も違う ∴ 同じスイッチで起きるのが妥当か
③ 段階化        eager でなく lazy/必要な index だけ/進捗と中断の提供、など

⚠️ 私は判別していません。 設計判断は architect に回しています。

⚠️ 測っていないこと

・action カタログ単独なら(リポジトリ知識を索引せずに)到達できるのか
・両者を分離する設定が★既に在るのか
・正確なトークン数 ── ★proxy の embed endpoint 自体が壊れていて取れていない(鍵には触っていない)

関連

  • #4154 — task ops 3 つが catalog 到達前に失敗する件。この issue の結合が原因である可能性が高いが、確定はしていない
  • #3978 の live 動作確認 — P4a-c が #4154 のブロックで未確認のまま

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestowner:decideowner の判断待ち(確認ではなく決定が要る)roi:medium中ROIstatus:proposed提案済み・未着手

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions