Expand description
Learn Module - 学習系 Domain の分離
§設計思想
Engine (Core) と Learn の責務を明確に分離する。
- Core (Engine): ActionEvent を発行、基本統計を管理
- Learn: ActionEvent を受け取り、学習パターンを分析
§Model Layer
Model (base)
├── Scorable → 行動選択に使用(UCB1, Thompson, Greedy)
└── Parametric → 戦略設定に使用(Orchestrator初期化)§モデル種類
| モデル | 責務 | 生存期間 |
|---|---|---|
| LearnedModel | 行動選択スコア(遷移、N-gram等) | 1セッション |
| OptimalParamsModel | パラメータ最適化(ucb1_c等) | 複数セッション |
§LoRA
LoRA学習・適用は lora モジュールで管理。
LoraTrainer: LoRA学習の実行TrainedModel: 学習済みLoRAアダプタModelApplicator: llama-server への適用
Modules§
- component_
learners - ComponentLearner 具体実装
- daemon
- Learning Daemon - 継続的学習プロセス
- episode
- Episode - 学習の基本単位
- facade
- Learnable Swarm Facade - 学習機能付き Swarm の統合ファサード
- learn_
model - LearnModel - 学習の統合モデル
- learned_
component - LearnedComponent - 学習結果の型安全な抽象化
- lora
- LoRA Module - LoRA学習・適用
- offline
- Offline Learning - セッション間学習の分析・最適化
- profile_
adapter - ProfileAdapter - ScenarioProfile と OfflineModel の統合
- profile_
store - ProfileStore - ScenarioProfile の永続化
- record
- Record - 生イベントの抽象化
- scenario_
profile - ScenarioProfile - 永続的に改善されるシナリオの実体
- scenario_
registry - ScenarioRegistry - マルチシナリオ管理
- session_
group - Session Group - 複数セッションをまとめる単位
- snapshot
- Learning Snapshot - 学習データの永続化システム
- stats_
model - Stats Model Layer - 行動選択用統計モデル
- store
- Store Module - 永続化レイヤーの Clean Architecture 実装
- training
- TrainingData - LoRA 学習用データ形式
- trigger
- TrainTrigger - 学習開始条件の判定
Structs§
- Action
Event Subscriber - ActionEvent を受信して LearningDaemon に Record を送信
- Action
Record - アクション実行の記録
- Always
Trigger - 常に true(テスト用)
- AndTrigger
- 全ての Trigger が true なら発火
- Applier
- 学習済みモデルの適用を担当
- Applier
Config - Applier の設定
- Bootstrap
Data - Bootstrap 完了時のデータ
- Confidence
MapProvider - HashMap<String, f64> ベースの静的 Provider
- Contextual
Action Stats - コンテキスト条件付きアクション統計
- Conversation
Data - 会話形式の学習データ(JSONL 出力用)
- Conversation
Turn - 会話のターン
- Count
Trigger - N 件の新規 Episode が蓄積されたら発火
- Daemon
Builder - LearningDaemon のビルダー
- Daemon
Config - Daemon の設定
- Daemon
Stats - Daemon の統計情報
- Data
Sink - Record/Episode の永続化を担当
- Data
Sink Stats - DataSink の統計情報
- Default
Episode Repository - RecordStore + EpisodeStore を組み合わせた Repository 実装
- DepGraph
Learner - 依存グラフ学習器
- Dependency
Graph Learn Model - DependencyGraph 推論の学習モデル
- Dependency
Graph Record - DependencyGraph 推論の記録
- DpoConfig
- DPO LearnModel の設定
- DpoLearn
Model - 汎用 DPO LearnModel
- DpoPair
- DPO 学習用の比較ペア
- Episode
- Episode - 学習の基本単位(汎用実装)
- Episode
Builder - Episode を構築するためのビルダー
- Episode
Context - エピソードのコンテキスト
- Episode
Dto - Episode の永続化用 DTO
- Episode
Filter - Episode 検索用フィルタ
- Episode
Id - Episode ID - 一意識別子
- Episode
Meta - Episode のメタ情報(軽量版、リスト表示用)
- Episode
Metadata - エピソードのメタデータ
- Episode
Transitions - エピソード遷移統計
- Event
Subscriber Config - Event Subscriber の共通設定
- Exploration
Learner - 探索パラメータ学習器
- File
Episode Store - JSONL ファイルベースの EpisodeStore 実装
- File
Lora Store - ファイルベースの LoraModelStore 実装
- File
Record Store - JSONL ファイルベースの RecordStore 実装
- File
System Storage - ファイルシステムベースのストレージ実装
- InMemory
Episode Store - インメモリの EpisodeStore 実装(テスト用)
- InMemory
Lora Store - インメモリの LoraModelStore 実装(テスト用)
- InMemory
Record Store - インメモリの RecordStore 実装(テスト用)
- Learn
Stats - 学習用統計の集約
- Learn
Stats Provider - LearnStats と ScoreModel を一体管理する Provider
- Learn
Stats Record - LearnStats スナップショット記録
- Learnable
Swarm - 学習機能付き Swarm
- Learnable
Swarm Builder - 学習機能付き Swarm のビルダー
- Learnable
Swarm Config - 学習機能付き Swarm の設定
- Learned
Action Order - 学習済みアクション順序
- Learned
DepGraph - 学習済み依存グラフ
- Learned
Exploration - 学習済み探索パラメータ
- Learned
Strategy - 学習済み戦略設定
- Learning
Daemon - 継続的学習プロセス
- Learning
Event Subscriber - LearningEvent を受信して LearningDaemon に Record を送信
- Learning
Snapshot - 学習データのスナップショット(永続化単位)
- Learning
Store - 学習データの永続化マネージャ(Facade)
- Llama
Server Applicator - llama-server へのモデル適用
- Llama
Server Config - llama-server の設定
- LlmCall
Record - LLM呼び出しの記録
- Lora
Model Id - LoRA モデル ID
- Lora
Trainer - LoRA 学習を実行する
- Lora
Trainer Config - LoRA Trainer の設定
- Manual
Trigger - 常に false を返す(手動実行時は Trigger をバイパス)
- Model
Filter - TrainedModel 検索フィルタ
- Model
Meta - TrainedModel の軽量メタ情報
- Model
Metadata - モデルメタデータ
- Model
Version - モデルバージョン
- Never
Trigger - 常に false(自動学習無効化用)
- Ngram
Stats - N-gram 統計(3-gram, 4-gram パターン学習)
- NoOp
Applicator - 何もしない Applicator(テスト用)
- Null
Provider - ボーナスを返さない Null Provider
- Offline
Analyzer - Offline 分析器
- Offline
Model - Offline 学習モデル
- Optimal
Parameters - 最適化されたパラメータ
- Optimal
Params Model - パラメータ最適化モデル
- OrTrigger
- いずれかの Trigger が true なら発火
- Processor
- 学習処理を実行
- Processor
Config - Processor の設定
- Profile
Stats - Profile の統計情報
- Profile
Store - ScenarioProfile の永続化ストア
- Quality
Trigger - 成功率が閾値を下回ったら発火
- Recommended
Path - 推奨アクションパス
- Record
Filter - Record 検索用フィルタ
- Record
Id - Record の一意識別子
- Record
Meta - Record のメタ情報(軽量版、リスト表示用)
- Record
Stream - Record のストリームを操作するためのヘルパー
- Scenario
Profile - 永続的に改善されるシナリオの実体
- Scenario
Profile Id - ScenarioProfile 識別子
- Scenario
Registry - マルチシナリオ管理
- Score
Context - スコア計算のコンテキスト
- Score
Model - 行動選択スコアモデル
- Score
Model Provider - ScoreModel を使った Provider 実装
- Selection
Performance - Selection 戦略効果測定(Meta-learning)
- Session
Group - セッショングループ
- Session
Group Id - セッショングループ ID
- Session
Group Metadata - セッショングループのメタデータ
- Session
Id - セッションID(タイムスタンプベース)
- Snapshot
Metadata - スナップショットのメタデータ
- Stats
Model Id - 統計モデル識別子
- Strategy
Advice Record - LLM 戦略アドバイス記録
- Strategy
Config - Selection 戦略設定
- Strategy
Learner - 戦略設定学習器
- Strategy
Stats - 戦略ごとの統計
- Strategy
Switch Event - 戦略切り替えイベント
- Task
Matcher - Task → Scenario マッチング設定
- Time
Trigger - 前回学習から N 秒経過したら発火
- Trained
Model - 学習済みモデル
- Trained
Model Dto - TrainedModel の永続化用 DTO
- Training
Data - LoRA 学習用データ形式
- Training
Metadata - 学習データのメタデータ
- Training
Metrics - 学習メトリクス
- Training
Metrics Dto - TrainingMetrics の DTO
- Trigger
Builder - Trigger を構築するためのファクトリ
- Trigger
Context - Trigger 判定のためのコンテキスト
- Trigger
Metrics - 品質メトリクス
- Worker
Decision Sequence Learn - Worker Decision 学習モデル(シーケンスベース)
- Worker
Task Learn - Worker タスク完了ベースの LearnModel
Enums§
- Action
Order Source - アクション順序の生成元
- Applicator
Error - Applicator エラー
- Applier
Error - Applier のエラー型
- Apply
Mode - 適用モード
- Apply
Result - 適用結果
- Conversation
Role - 発話者の役割
- Daemon
Error - Daemon のエラー型
- Data
Sink Error - DataSink のエラー型
- Learn
Error - LearnModel のエラー型
- Learning
Phase - 学習フェーズ
- Learning
Query - 学習データへのクエリ
- Learning
Result - クエリ結果
- Lora
Trainer Error - LoRA Trainer エラー
- Merge
Strategy - マージ戦略
- Model
Type - モデルの種類
- Outcome
- エピソードの結果
- Outcome
Filter - Outcome フィルタ
- Param
Value - パラメータ値
- Process
Result - 処理結果
- Processor
Error - Processor のエラー型
- Processor
Mode - 処理モード
- Profile
State - Profile のライフサイクル状態
- Profile
Store Error - ProfileStore のエラー型
- Record
- 生イベントから変換された Record
- Record
Store Error - RecordStore のエラー型
- Registry
Error - ScenarioRegistry のエラー型
- Scenario
Source - シナリオのソース参照
- Score
Query - スコアクエリ
- Snapshot
Key - スナップショットのキー(階層的)
- Store
Error - EpisodeStore のエラー型
- Training
Format - 学習形式
- Trigger
Error - Trigger 判定エラー
Constants§
- SNAPSHOT_
VERSION - フォーマットバージョン
Traits§
- Component
Learner - ScenarioProfile コンポーネントの学習プロセス
- Episode
Repository - Domain 層に公開する Episode の Repository インターフェース
- Episode
Store - Episode の永続化を担う Trait
- Episode
Trait - Episode trait - 学習の基本単位を表すインターフェース
- From
Record - Record から特定の型を抽出するための Trait
- Learn
Model - 学習の統合モデル
- Learned
Component - 学習結果コンポーネントの共通 trait
- Learned
Provider - 学習済みデータへのアクセス Provider
- Lora
Model Store - TrainedModel の永続化を担う Trait
- Model
- 全ての学習済みモデルが実装する基本 trait
- Model
Applicator - モデル適用 trait(非同期)
- Parametric
- パラメータを提供できるモデル(戦略設定に使用)
- Profile
ToOffline Model - ScenarioProfile から OfflineModel を取得する trait
- Record
Store - Record の永続化を担う Trait
- Scorable
- スコアを提供できるモデル(行動選択に使用)
- Snapshot
Storage - スナップショットの永続化(CRUD)
- Time
Series Query - 時系列クエリ
- Train
Trigger - 学習開始条件を判定する trait
Functions§
- merge_
snapshots - 複数のスナップショットをマージ
- migrate_
offline_ model_ to_ profile - OfflineModel から ScenarioProfile を構築
- offline_
model_ to_ components - OfflineModel から ScenarioProfile のコンポーネントを抽出
- profile_
to_ offline_ model - ScenarioProfile から OfflineModel を生成
Type Aliases§
- Shared
Learned Provider - Provider の共有参照型
- Timestamp
- タイムスタンプ(Unix seconds)