# Task-Aware Capability Recommendation for AI Assistants: Design and Engineering Practice
As large language model assistants accumulate more plugins, tools, and extensions, users increasingly struggle to discover the capability that actually fits their current task. This article presents a reusable, product-agnostic mechanism for task-aware capability recommendation. It breaks the system into three layers—context, decision, and presentation—and explains how to collect task signals (explicit mentions, artifacts, files, complexity, and behavior), recognize intent with a rules-first/model-fallback approach, score and rank candidate capabilities, and gate recommendations to minimize interruption. It also covers writing one-line value propositions under a 90-character display-width limit, enforcing that they stay grounded in the user's current task, engineering deployment as an asynchronous side path, and an evaluation framework centered on adoption rate rather than impression count. You will learn how to make extended capabilities appear at the right moment without derailing the user's primary task.
1. Background: From a Capability Entry Point to Task-Aware Recommendations
The capability boundary of large language model assistants is expanding rapidly. Beyond conversational Q&A, platforms commonly offer dedicated capabilities through plugins, tools, and extension apps for concrete scenarios such as coding, documents, data analysis, and presentations. The richer the capability catalog becomes, the more choices users face.
Many users have no idea that a more suitable tool exists for their current task: they discover a dedicated research assistant only halfway through a long conversation, learn that a spreadsheet capability could have been invoked only while organizing data, or struggle with a suboptimal tool when a better one was available. This is the capability discovery problem. It is generally solved along two paths:
- Passive: display all capabilities centrally in an app list or settings page. Low cost, but users must actively look for them and often only think to check after a task has already begun.
- Active: the assistant surfaces hints during the conversation based on the current task. More timely, but if the judgment is inaccurate, it becomes noise that interrupts the user.
Task-aware capability recommendation sits between the two: it proactively suggests relevant capabilities within a specific task scenario, while strict rules constrain how often and in what form they appear.
Note: This article is not about any specific product. It discusses a reusable, general-purpose mechanism for intelligent assistant product design. The capability catalog, context objects, and matching flow shown here are illustrative designs and do not constitute any actual interface contract.
2. Problem Modeling: A Three-Layer Abstraction of Task-Aware Recommendation
Setting aside any specific product form, this mechanism can be broken into three layers:
- Context layer: what the assistant “sees.” Signals such as user intent, artifact type, file characteristics, and task complexity form the basis for the recommendation decision.
- Decision layer: deciding “whether to recommend, and which ones.” This includes candidate matching, ranking, deduplication, and trigger gating.
- Presentation layer: deciding “how to phrase it.” The cap on the number of recommendations, the length constraint on copy, and the structure of the wording directly determine whether a recommendation helps or annoys.
It can be formalized as follows: given the conversation history H and task context S, select a subset R (with |R| ≤ 3) from the candidate capability set C that meets a relevance threshold, and generate copy m(r, S) for each r ∈ R. The constraints are:
- The length of m must not exceed 90 characters;
- m must reference a concrete task element from S and must not be a generic introduction detached from the context.
In engineering terms, capability metadata and task context can be defined as follows:
from dataclasses import dataclass, field@dataclass(frozen=True)class Capability:"""Structured description of an extended capability; the shared data source for both matching and copy generation."""name: str # Capability namecategories: frozenset[str] # Applicable artifact types: code/spreadsheet/slides/email...triggers: frozenset[str] # Trigger signals: keywords, file extensions, task typesaction: str # Core action this capability performs on the corresponding artifactpayoff_template: str # Value-proposition template; placeholders force the copy to stay grounded in contextpriority: float = 0.0 # Base weight of the rule-based match score@dataclassclass TaskContext:intent: str = "" # Current intent: coding / spreadsheet / research...artifacts: set[str] = field(default_factory=set) # Current artifacts: code/spreadsheet/slides...file_exts: set[str] = field(default_factory=set) # File types provided by the userplan_steps: int = 0 # Number of steps the user has already planned/executedsignals: dict[str, float] = field(default_factory=dict) # Signals and their confidence
3. Key Design One: Context Collection and Task Recognition
Recommendation quality depends on understanding “what the user is doing right now.” Several categories of signals can help:
- Explicit signals: the user directly mentions a type of tool or artifact, such as “calculate this in a spreadsheet” or “sketch a prototype.”
- Artifact signals: the type of content currently being generated or operated on, such as a code snippet, spreadsheet file, slides, or email body.
- File signals: the extensions and structural characteristics of files the user has uploaded or opened.
- Complexity signals: whether the task requires multiple steps or involves long documents.
- Behavioral signals: repeated edits, undo actions, topic switches, and the like, which usually indicate that the current form is not working well.
A layered “rules first, model fallback” approach is recommended:
- Keyword and regex rules cover high-frequency, high-certainty scenarios. They offer low latency, are explainable, and support gradual rollout.
- A structured classifier scores the task intent.
- When the context is long or the intent is ambiguous, introduce a lightweight semantic model as a fallback, with a confidence threshold.
Intent recognition should not output a single hard label but rather a probability distribution across intents. Under low confidence, it is better to skip the recommendation entirely—this is the first line of defense against false positives:
INTENT_SIGNALS = {"coding": (r"\b(code|function|script|refactor|error|bug)\b", 0.9),"spreadsheet": (r"\b(spreadsheet|formula|pivot|forecast)\b", 0.9),"presentation": (r"\b(slides|presentation|deck)\b", 0.9),"inbox": (r"\b(inbox|email|unread|reply)\b", 0.8),}def recognize_intent(text: str, ctx: TaskContext) -> str:scores = {k: (1.0 if re.search(p, text) else 0.0) * wfor k, (p, w) in INTENT_SIGNALS.items()}scores.update(ctx.signals) # artifact/file/complexity signals also contribute to scoringbest, score = max(scores.items(), key=lambda kv: kv[1])return best if score >= 0.8 else "" # below threshold, no intent is returned, which means skipping the recommendation
Take “fixing an error in the editor” as an example: the user uploads a unit test file with a failing assertion (file_exts = {“.py”}) and repeatedly asks to explain the stack trace over several turns. The system recognizes the intent as coding and the artifact as code, and recommends extension capabilities related to code editing and debugging. If a spreadsheet file and text about summation formulas are also detected, the intent becomes spreadsheet and the candidates switch to spreadsheet-type capabilities. The context object is built from this:
ctx = TaskContext(intent="spreadsheet",artifacts={"spreadsheet"},file_exts={".xlsx"},plan_steps=3,signals={"spreadsheet": 0.9},)
4. Key Design Two: Matching Strategy and Trigger Gating
4.1 Layered Matching
The first layer does coarse filtering: capabilities whose categories have no overlap with the task intent are excluded outright.
The second layer computes a relevance score among candidates, combining three parts:
- Rule score: a strong boost when the user explicitly mentions an artifact related to a capability’s trigger words.
- Intent coverage: the overlap ratio between the artifacts a capability applies to and the current intent, artifacts, and files.
- Semantic similarity: the vector similarity between the capability description and the current task text.
from math import expdef match_score(cap: Capability, ctx: TaskContext, sem_sim: float) -> float:# Strong boost when a trigger signal is explicitly mentioned, plus the capability's own base weighttrigger_hit = any(t in ctx.artifacts or t in ctx.file_exts or t == ctx.intentfor t in cap.triggers)rule = cap.priority + (5.0 if trigger_hit else 0.0)# Intent coverage: number of matched intents / total intents the capability claims to supporthit = len(set(ctx.artifacts) & cap.categories)coverage = hit / max(len(cap.categories), 1)# Weight w must be calibrated through offline replay and online experiments; values here are illustrativereturn 0.4 * rule + 0.3 * coverage + 0.3 * sem_simdef select(ctx: TaskContext, caps: list[Capability],embed) -> list[tuple[Capability, float]]:scored = [(cap, match_score(cap, ctx, embed(cap, ctx))) for cap in caps]scored.sort(key=lambda x: x[1], reverse=True)THRESHOLD = 0.55 # illustrative threshold; needs tuning per businessreturn [(c, s) for c, s in scored if s >= THRESHOLD][:3]
Semantic similarity is computed with cosine similarity, encoding the capability description and task text into vectors and comparing them:
from math import sqrtdef embed(cap: Capability, ctx: TaskContext) -> tuple[float, float]:"""Illustrative encoding: real systems should use a semantic vector model or a retrieval service."""a = " ".join([cap.name, cap.action, *cap.categories])b = " ".join([ctx.intent, *ctx.artifacts, *ctx.file_exts])return (len(set(a) & set(b)), len(a)), (len(set(a) & set(b)), len(b))def cosine(u, v) -> float:dot = u[0] * v[0]return dot / (sqrt(u[1] ** 2 + v[1] ** 2) or 1.0)
The decision layer ultimately outputs a single structured conclusion for use by the UI layer or for system-prompt injection:
import jsondef build_offers(conv) -> dict:ctx = extract_context(conv) # Chapter 3: context collectionoffers = []for cap, score in select(ctx, CATALOG, embed): # candidate retrieval and rankingif not should_offer(conv, cap, ctx): # trigger gatingcontinueoffers.append({"name": cap.name,"pitch": craft_pitch(cap, ctx), # value-proposition generation"score": round(score, 3)})# At most 3 offers shown at once, and they must never interfere with the normal answer to the user's current questionreturn {"offers": offers[:3]}# print(json.dumps(build_offers(conv), ensure_ascii=False, indent=2))# Illustrative output:# {# "offers": [# {# "name": "Spreadsheet capability",# "pitch": "Build formulas directly in this forecast sheet and clean up anomalous data",# "score": 0.93# }# ]# }
4.2 Trigger Gating
A high match score does not mean a recommendation must be shown. Gating decides “when to speak and how often,” with the core principle being minimal interruption:
- Timing: surface a hint when the task enters a stable execution phase, avoiding a recommendation pop-up the moment the user states a need; after repeated failures over multiple turns, offer one alternative.
- Deduplication: the same capability appears only once per conversation, and capabilities already adopted are no longer recommended.
- Cooldown: after a user explicitly ignores or disables a capability, do not show it again for a period (such as 7 days), and lower its base weight.
- Count: at most 3 per turn. If nothing meets the threshold, recommend nothing at all.
def should_offer(conv, cap: Capability, ctx: TaskContext) -> bool:profile = user_profile(conv.user_id)if cap.name in profile.blocked: # user has explicitly disabled itreturn Falseif cap.name in conv.applied: # already used in this taskreturn Falseif profile.cooled_until.get(cap.name, 0) > now():return Falseif any(o.capability == cap.name for o in conv.offers):return False # do not push the same capability repeatedlyif len(conv.offers) >= 3:return Falsereturn ctx.intent != "" and conv.turns_in_task >= 2
5. Key Design Three: Writing a One-Line Value Proposition That Is Short and Precise
5.1 Why One Line and 90 Characters
- Cognitive cost: a recommendation is a “side branch” of the task, and overly long copy directly interrupts the main line.
- Scenario fit: space is limited in sidebars, floating hints, and voice announcements, so short copy displays completely across all these forms.
- Comparability: a uniform length cap forces designers to cut modifiers and keep only the most valuable information.
90 characters is not a fixed standard but a “balance point between information density and reading burden.” Chinese uses full-width characters, and a single Chinese character typically occupies two character widths in both terminals and graphical interfaces, so constraining by display width is more reasonable than simply counting characters:
MAX_WIDTH = 90def display_width(text: str) -> int:# East Asian Wide / Fullwidth count as 2, others as 1return sum(2 if unicodedata.east_asian_width(ch) in ("W", "F") else 1for ch in text)def enforce_width(text: str, limit: int = MAX_WIDTH) -> str:if display_width(text) <= limit:return textout, used = "", 0for ch in text:w = 2 if unicodedata.east_asian_width(ch) in ("W", "F") else 1if used + w > limit - 1: # reserve room for the ellipsisbreakout += chused += wreturn out + "…"
5.2 Copy Structure
An effective value proposition generally contains three elements:
- Anchor: the user’s current specific artifact, such as “this forecast sheet” or “this script.”
- Action: what the capability can do for it, such as “build formulas” or “generate test cases.”
- Benefit: what the user gains, such as “no need to switch tools” or “no manual cleanup.”
For example, when the task is spreadsheet data processing and the context includes a forecast sheet, the value proposition could be: “Build formulas directly in this forecast sheet and clean up anomalous data” (23 Chinese characters, roughly 46 character widths).
Counter-example: “This capability is powerful and can significantly improve your office productivity.” It fits any task, and therefore delivers no value for any task. Whether a value proposition fits the task can be turned into a testable engineering constraint: template placeholders must come from the current context, and after generation, validate whether the copy contains an artifact, file, or intent element the user currently mentioned.
def craft_pitch(cap: Capability, ctx: TaskContext) -> str:anchor = pick_anchor(ctx) # e.g. "this forecast sheet" / "this script"if anchor is None:return "" # no concrete anchor, so skip the recommendationtext = cap.payoff_template.format(anchor=anchor)return enforce_width(text)def pick_anchor(ctx: TaskContext) -> str | None:if "spreadsheet" in ctx.artifacts and ctx.file_exts:return "this forecast sheet"if "code" in ctx.artifacts:return "this script"if "email" in ctx.artifacts:return "this email"return None
5.3 Quality Validation
Run automated validation before display; non-compliant copy is discarded outright and counted into monitoring metrics:
def pitch_ok(pitch: str, ctx: TaskContext) -> bool:if not pitch or display_width(pitch) > MAX_WIDTH:return Falseanchors = {"this forecast sheet": "spreadsheet","this script": "code","this email": "email"}keys = {k for a, k in anchors.items() if a in pitch}grounded = bool(keys & (ctx.artifacts | {ctx.intent}))generic = pitch in GENERIC_PHRASES # blacklist of generic boilerplatereturn grounded and not generic
Manual review can use three criteria:
- Relevance: is the recommended capability the one the current task most needs.
- Specificity: does it contain a concrete object or action from the current task.
- Conciseness: can it be read at a glance, without redundant modifiers.
6. Engineering Implementation: From Modules to Services
- Module decoupling: collection, matching, gating, and copy each stay independent, easing unit testing and gradual rollout.
- Asynchrony: recommendation is side-path logic and must never block the user’s main request. A message queue can absorb the recommendation computation, and on failure it degrades to “no recommendation,” never affecting the quality of the main answer.
- Observability: collect impression count, adoption rate, dismissal rate, copy length distribution, and human relevance scores in a unified way, and detect abnormal fluctuations through monitoring alerts.
- Centralized configuration: thresholds, cooldown durations, and the per-turn count cap live in a configuration center, supporting per-scenario gradual rollout and adjustments without a release.
- Security and compliance: context collection follows the minimum-necessary principle, extracting only the structured features needed for recommendation; content safety scanning must be placed before copy generation rather than relying on post-hoc review as a fallback.
Evaluation Framework
In the offline phase, sample from real conversations and label a three-way classification of “appropriate / irrelevant / redundant,” then compute precision and recall. In the online phase, run A/B experiments:
- Core metrics: adoption rate (the proportion of users who click the recommendation and complete the jump or invocation), while also tracking task completion rate and retention to ensure recommendations are not achieved at the expense of the primary task.
- Guardrail metrics: dismissal rate, negative feedback rate, and the impact of recommendation impressions on response latency.
- Ablation experiments: separately disable semantic matching, trigger gating, and copy validation, and observe changes in each metric to determine the actual value of each stage.
7. Common Pitfalls and Best Practices
| Common pitfall | Potential consequence | Recommended practice |
|---|---|---|
| Attaching recommendations to every reply | Users develop “ad fatigue” and gradually ignore the hints | Combine with gating so recommendations trigger only when the task matches |
| Using generic propositions unrelated to the task | Low information value, poor click-through, damaged trust | Propositions must be anchored to the user’s current artifact |
| Recommending too many capabilities at once | Attention is divided and conversion actually drops | Cap at 3; recommend nothing when nothing meets the threshold |
| Tracking only impression count | Cannot tell whether recommendations are actually useful | Use adoption rate and task completion rate as the core metrics |
| Recommendation logic blocking the main path | Adds latency and, in extreme cases, drags down the main answer | Execute asynchronously and degrade to “no recommendation” on failure |
8. Summary
The essence of task-aware capability recommendation is finding a balance between “letting users know about more capabilities” and “not disturbing the user while they complete their task.” The key lies not in how complex the recommendation algorithm is, but in three things:
- See accurately: reliably recognize the user’s intent and current artifact.
- Say less: one line, no more than 90 characters.
- Stay close: the value proposition must be anchored to what the user is doing right now.
In practice, a closed loop formed by context collection, layered matching, trigger gating, and copy validation—measured by adoption rate rather than impression count—makes extended capabilities appear at the right moment and truly become an aid to users completing their tasks.
