icl_updater
icl_updater
¶
ICL example updater + skill discovery from traces.
Classes¶
ICLUpdaterPolicy
¶
ICLUpdaterPolicy(*, min_score: float = 0.7, max_examples: int = 20, min_skill_occurrences: int = 3, auto_apply: bool = False)
Bases: AgentLearningPolicy
Updates in-context examples and discovers skills from traces.
Analyzes traces for successful tool call patterns, extracts in-context learning examples, and discovers reusable multi-tool sequences ("skills"). This updates agent logic (ICL examples and tool-use strategies), not tool implementations themselves.
Source code in src/openjarvis/learning/icl_updater.py
Attributes¶
example_db
property
¶
Return a copy of the versioned example database.
Functions¶
update
¶
Analyze traces and extract ICL examples + skills.
Source code in src/openjarvis/learning/icl_updater.py
add_example
¶
add_example(query: str, response: str, outcome: float, metadata: Optional[Dict[str, Any]] = None) -> bool
Add an ICL example if it meets the quality threshold.
| PARAMETER | DESCRIPTION |
|---|---|
query
|
The user query that produced this example.
TYPE:
|
response
|
The agent/model response.
TYPE:
|
outcome
|
Quality score in [0, 1].
TYPE:
|
metadata
|
Optional metadata dict attached to the example.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
True if the example was accepted, False if rejected (below threshold).
|
|
Source code in src/openjarvis/learning/icl_updater.py
rollback
¶
Remove all examples added after the given version.
| PARAMETER | DESCRIPTION |
|---|---|
version
|
The version checkpoint to rollback to. All examples with
TYPE:
|
Source code in src/openjarvis/learning/icl_updater.py
get_examples
¶
Retrieve the best examples, optionally filtered by query class.
| PARAMETER | DESCRIPTION |
|---|---|
query_class
|
If non-empty, only return examples whose query contains this substring (case-insensitive).
TYPE:
|
top_k
|
Maximum number of examples to return.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Up to *top_k* examples sorted by outcome (descending).
|
|