mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-30 02:42:16 +00:00
Phase 1: Move RoutingContext to core/types.py, add RouterPolicy and QueryAnalyzer ABCs to intelligence/_stubs.py Phase 2: Move memory backends to tools/storage/, convert memory/ to backward-compat shims Phase 3: Add MCPToolAdapter, storage MCP tools, upgrade MCP server to spec 2025-11-25 Phase 4: Add SystemBuilder + JarvisSystem composition layer (system.py) Phase 5: Add InstrumentedEngine for opt-in telemetry, simplify all agents Phase 6: Add LearningPolicy ABC taxonomy with SFTPolicy, AgentAdvisorPolicy, ICLUpdaterPolicy Phase 7: Update config schema (ToolsConfig, MCPConfig, TracesConfig, per-pillar learning policies) Also: update all docs, README (DSPy-inspired), CLAUDE.md, and add logo assets. 1391 tests pass, 32 skipped. Zero new lint errors. Full backward compatibility via shims. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
105 lines
2.3 KiB
Markdown
105 lines
2.3 KiB
Markdown
# Learning Module
|
|
|
|
The learning module implements learning policies that improve routing, agent,
|
|
and tool decisions based on historical interaction outcomes. The module provides
|
|
a `LearningPolicy` ABC taxonomy with specialized sub-ABCs for intelligence
|
|
(model routing), agent behavior, and tool selection. It also includes reward
|
|
functions for scoring inference results.
|
|
|
|
## Abstract Base Classes
|
|
|
|
### RouterPolicy
|
|
|
|
::: openjarvis.intelligence._stubs.RouterPolicy
|
|
options:
|
|
show_source: true
|
|
members_order: source
|
|
|
|
### QueryAnalyzer
|
|
|
|
::: openjarvis.intelligence._stubs.QueryAnalyzer
|
|
options:
|
|
show_source: true
|
|
members_order: source
|
|
|
|
### RoutingContext
|
|
|
|
`RoutingContext` is now defined in `core/types.py`:
|
|
|
|
::: openjarvis.core.types.RoutingContext
|
|
options:
|
|
show_source: true
|
|
members_order: source
|
|
|
|
### RewardFunction
|
|
|
|
::: openjarvis.learning._stubs.RewardFunction
|
|
options:
|
|
show_source: true
|
|
members_order: source
|
|
|
|
### LearningPolicy Taxonomy
|
|
|
|
The learning system defines a hierarchy of learning policy ABCs:
|
|
|
|
- **`LearningPolicy`** -- base ABC for all learning policies
|
|
- **`IntelligenceLearningPolicy`** -- specialization for model routing decisions
|
|
- **`AgentLearningPolicy`** -- specialization for agent behavior advice
|
|
- **`ToolLearningPolicy`** -- specialization for tool selection/configuration
|
|
|
|
---
|
|
|
|
## Policy Implementations
|
|
|
|
### TraceDrivenPolicy
|
|
|
|
::: openjarvis.learning.trace_policy.TraceDrivenPolicy
|
|
options:
|
|
show_source: true
|
|
members_order: source
|
|
|
|
### classify_query
|
|
|
|
::: openjarvis.learning.trace_policy.classify_query
|
|
options:
|
|
show_source: true
|
|
|
|
### SFTPolicy
|
|
|
|
::: openjarvis.learning.sft_policy.SFTPolicy
|
|
options:
|
|
show_source: true
|
|
members_order: source
|
|
|
|
### AgentAdvisorPolicy
|
|
|
|
::: openjarvis.learning.agent_advisor.AgentAdvisorPolicy
|
|
options:
|
|
show_source: true
|
|
members_order: source
|
|
|
|
### ICLUpdaterPolicy
|
|
|
|
::: openjarvis.learning.icl_updater.ICLUpdaterPolicy
|
|
options:
|
|
show_source: true
|
|
members_order: source
|
|
|
|
### GRPORouterPolicy
|
|
|
|
::: openjarvis.learning.grpo_policy.GRPORouterPolicy
|
|
options:
|
|
show_source: true
|
|
members_order: source
|
|
|
|
---
|
|
|
|
## Reward Functions
|
|
|
|
### HeuristicRewardFunction
|
|
|
|
::: openjarvis.learning.heuristic_reward.HeuristicRewardFunction
|
|
options:
|
|
show_source: true
|
|
members_order: source
|