agora.core.learning
Knowledge flywheel — structured learnings with confidence decay.
Position: the retry-memory layer. When a task fails a postcondition the runtime
records a Learning (a failure trace + a corrective hint) and injects it
into the model’s next-turn prompt — the mechanism that turns a raw failure into
context on retry, rather than letting the model repeat it blind.
Invariants: confidence is bounded to [0, MAX_CONFIDENCE]; a learning below
CONFIDENCE_THRESHOLD is considered stale and dropped; reinforcement adds
REINFORCE_BOOST and time subtracts DECAY_RATE — so a hint that keeps
proving useful survives and one that stops mattering ages out on its own.
Functions
|
Apply confidence decay uniformly. |
|
Learnings above the confidence threshold, sorted descending by confidence. |
|
Format learnings as a prompt context block, grouped by category. |
|
Boost confidence when a learning is referenced again; cap at MAX_CONFIDENCE. |
Classes
A failure trace lifted from a postcondition into the next agent prompt. |
- class agora.core.learning.Learning[source]
Bases:
objectA failure trace lifted from a postcondition into the next agent prompt.
Learnings are the framework’s loopback mechanism: when a task fails a postcondition, the orchestrator synthesises a
Learningfrom the(task_id, predicate_name, reason)tuple viaagora.fleet.auto_learning.synthesize_failure_learning()and injects it into the agent’s system prompt for the retry.confidenceis boosted byreinforce()when the same failure recurs and decays over time viadecay_learnings(); only learnings with confidence aboveCONFIDENCE_THRESHOLD(0.3) are surfaced to the model.- category: LearningCategory
- __init__(id, category, content, confidence, task_ref, reinforcement_count=0, created_at='', last_reinforced_at='')
- agora.core.learning.decay_learnings(learnings)[source]
Apply confidence decay uniformly. Floor at 0.0.
- agora.core.learning.filter_active(learnings)[source]
Learnings above the confidence threshold, sorted descending by confidence.