The apply scoring flow
The full ranking process runs in eight steps:Load candidates
The agent loads all known packs from two sources:
<agent-dir>/aep/index.json— the pack registry listing every available pack with its path, tags, and strength.- Individual pack files referenced by the index (e.g.
tasks/html-to-nextjs.aep.json).
"0.1" and "1.0-exp" packs are included. The agent is backwards compatible and can score v0.1 packs alongside v1.0-exp packs in the same run.Compute a base match score
For each pack, the agent computes a base match score using the task description and repo context. The score is derived from three match fields:
match.keywords— individual terms that signal relevance.match.patterns— short phrases describing typical use cases.match.tags— categorical labels (e.g."frontend","migration").
Adjust with applies_to (v1.0-exp)
For v1.0-exp packs, the base score is adjusted using the
applies_to block:- Languages and frameworks — if the current task clearly involves TypeScript and a pack declares
"languages": ["typescript"], the score is boosted. - Paths — if touched files fall under
"paths": ["app/**"], the score is boosted. - Domains — if the task is clearly frontend work and the pack declares
"domains": ["frontend"], the score is boosted.
applies_to filters are always soft. A mismatch reduces a pack’s score but never hard-disqualifies it. A pack that scores highly on keywords can still be selected even if its applies_to hints do not perfectly align with the current task.Combine with strength
The agent combines the adjusted match score with the pack’s If a pack does not have a This means a strong-matched v0.1 pack can still rank well, while a v1.0-exp pack with explicit strength benefits from carrying that signal forward across sessions.
strength field to produce a final combined score:strength field (e.g. a v0.1 pack), the agent treats it as neutral:Scope-aware ranking
Packs are sorted using a three-level priority:
- Scope —
taskpacks rank aboveproject, which rank aboveuser. - Combined score — higher is better within the same scope.
- Recency —
metrics.last_used_at(v1.0-exp) orindex.updated_at(v0.1) breaks ties.
Select 1–3 active packs
The agent selects the top 1–3 packs from the ranked list.
- If at least one pack has strong alignment, the agent may activate fewer packs to avoid noise.
- If no pack has clear alignment, the agent prefers fewer packs over activating weakly matched ones.
Update metrics
After selecting active packs, the agent updates usage metrics for each selected pack:
metrics.times_applied— incremented by 1.metrics.last_used_at— set to the current timestamp.
times_applied and last_used_at inform future scoring (via recency) and help identify strong candidates for promotion.Explain to the user
The agent reports the result before starting work:
- Which packs are active.
- Their combined scores and
strengthvalues. - Key constraints and success checks currently in force.
The strength field
strength is a single scalar in [0, 1] that represents how reliably a pack’s pattern has worked. You or your agent set it when saving a pack, and it can be updated as the pack accumulates usage history.
| Strength value | Interpretation |
|---|---|
0.3 | Weak or tentative pattern — early signal, limited evidence |
0.5 | Neutral — default for v0.1 packs or newly created packs |
0.7 | Solid pattern — has worked reliably across multiple tasks |
0.9+ | Very strong, highly trusted — use with high confidence |
0.7–0.8. Strength can be bumped upward when a pack is promoted from task to project scope.
Scoring formula
Backwards compatibility
v0.1 packs do not haveapplies_to, strength, or metrics. The agent handles them gracefully:
strengthdefaults to0.5— neutral, neither boosted nor penalized.applies_tois skipped — only the base match score from keywords, patterns, and tags is used.metrics.last_used_atfalls back toindex.updated_atfor recency ranking.
Related pages
Agent compatibility
How agents choose which directory to install packs into
Setting up a repo
Wire AEP into any repository in three steps
Apply guide
Step-by-step guide to running aep apply
Schema reference
Full field definitions including applies_to, strength, and metrics