0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[1分でわかる]Modular RAGってなんだ?

Posted at

結論

「RAGをLEGOブロック化したアーキテクチャ」

RAGシステムを独立モジュールに分解し、自由に組み合わせ・交換できる設計思想。


Advanced RAGとの違い(1枚図解)

【Advanced RAG】固定パイプライン

  Query → Pre-Retrieval → Retrieval → Post-Retrieval → Generation
  
  ※ 順番固定、線形フロー


【Modular RAG】モジュール + オーケストレーション

  ┌─────────────────────────────────────────────┐
  │           Orchestration Layer              │
  │  (ルーティング・スケジューリング・制御)    │
  └─────────────────────────────────────────────┘
           │
  ┌────────┼────────┐
  │        │        │
  ▼        ▼        ▼
┌────┐  ┌────┐  ┌────┐  ┌────┐  ┌────┐
│Index│  │Query│ │Retrieve│ │Rerank│ │Generate│
└────┘  └────┘  └────┘  └────┘  └────┘
  
  ※ モジュール交換可能、非線形フローOK

3層アーキテクチャ

内容
Module 大きな処理ステージ Indexing, Retrieval, Generation
Sub-module 具体的な機能 Query Rewriting, Reranking
Operator 最小単位の処理 Embedding, Similarity計算

何が改善された?

【Advanced RAGの限界】      【Modular RAGの解決】
───────────────────────────────────────────────
線形フロー固定            →  ループ・分岐・条件分岐
全クエリ同じ処理          →  クエリ種別でルーティング
モジュール交換が大変      →  独立モジュールで差し替え容易
全体最適化が困難          →  モジュール単位で最適化

RAGフローパターン

【Linear】    A → B → C → D(従来型)

【Conditional】A → 判定 → B or C(条件分岐)

【Branching】 A → B ─→ D
                  └→ C(並列処理)

【Loop】      A → B → 判定 → A に戻る(反復改善)

Modular RAGの代表例

・Self-RAG:    自己評価→必要なら再検索
・Adaptive RAG: クエリ難易度で処理を切り替え
・FLARE:       文ごとに検索要否を判断
・CRAG:        検索結果の品質をチェック→Web検索にフォールバック

一言まとめ

Naive RAG    = 固定レシピ
Advanced RAG = レシピに隠し味追加
Modular RAG  = 材料と調理法を自由に組み合わせ

→ 「モジュール単位で設計・交換・最適化」がポイント

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?