From Entry Button to Task Session: The Evolution and Implementation of an Intelligent Messaging Assistant

    This article examines the shift of intelligent assistants in messaging apps from passive, request-response chatbots to proactive, task-driven agents. It breaks down the required architecture into four layers—event ingestion, task orchestration, message delivery, and context/generation—and explains why context engineering, push frequency control, retained general-purpose and multimodal capabilities, privacy/compliance design, and staged rollouts are the real engineering challenges. Readers will find practical design guidance, sample event and message payloads, and a mapping of the required infrastructure to general cloud service categories.

    1. From an Entry Button to a Task Session: A Shift in Interaction Model

    A recent signal from the industry is worth noting: a mobile messaging app replaced the floating assistant button above the conversation list with a conversation entry organized around “tasks” in its test build. The change may look like nothing more than a new position and icon, but it actually marks a shift in how the intelligent assistant is positioned within the messaging scenario—from a passive Q&A tool invoked only when the user has a question, to a task executor that continuously senses state in the background and initiates conversations on its own.

    Understanding this shift requires seeing the limits of the old model first. Traditional chatbots follow a strict request-response model: the user submits input, the model returns output, and the context expires as soon as the session ends. This works well for information retrieval, but it is nearly useless for needs with time attributes and state dependencies, such as “summarize my schedule every morning” or “notify me when a package is delivered.” The trigger for these needs does not come from user input; it comes from changes in events in the outside world.

    The core of the new model is redefining a “session” as a task container that can persist. A task has a lifecycle (created, running, waiting, completed, archived), trigger conditions (scheduled time, thresholds, external events), state storage, and the ability to push messages multiple times. What the user still sees is a conversation interface, but underneath it is an event-driven long-running flow.

    2. Architecture Breakdown: Event-Driven Plus a Rich Media Channel

    Building a task-based assistant typically requires four layers of capability working together.

    The first layer is event ingestion. Before a task can be triggered, there must be an event source. Common event types fall into three categories: time-based events (a fixed time each day, a countdown expiring), data-change events (a subscription about to expire, inventory or price crossing a threshold), and external callback events (logistics status updates, payment result notifications). The engineering recommendation is to unify them behind an event bus that normalizes heterogeneous sources into a standard event structure:

    1. {
    2. "event_id": "evt_20260101_0001",
    3. "type": "shipment.status_changed",
    4. "occurred_at": "2026-01-01T08:00:00Z",
    5. "subject": "task_8842",
    6. "payload": { "status": "delivered" },
    7. "dedup_key": "task_8842:delivered"
    8. }

    The dedup_key field is easy to overlook in practice but critical. External events often arrive duplicated and out of order. Without an idempotency key, users can receive multiple duplicate notifications within the same minute, and that loss of experience is far worse than a missing feature.

    The second layer is task orchestration. A combination of “state machine plus delay queue” is recommended: the state machine constrains legal transitions, while the delay queue handles delayed actions such as “remind me after N days” or “append a message after delivery.” Pay special attention to persisting delayed tasks. If delay information lives only in memory, it is lost on service restart, so the metadata for delayed tasks should be written to persistent storage and recovered by a scheduler that scans it.

    The third layer is message delivery. A task-based assistant places clearly higher demands on channels than ordinary text messaging: it needs rich media cards, image and file attachments, read receipts, and the ability to merge multiple messages from the same task into one conversation thread. The industry typically relies on rich communication message channels to carry this kind of structured card, and aggregates multiple pushes from the same task under a unified identifier within the conversation, so users are not drowned in fragmented notifications.

    The fourth layer is context and generation. A task push is not template concatenation; the model needs to generate natural language based on the current context while preserving structured fields for the client to render. A practical approach is to have the model output a structured result and let the client decide how to present it:

    1. {
    2. "task_id": "task_8842",
    3. "summary": "Your package was delivered this morning",
    4. "level": "info",
    5. "actions": [{ "label": "View details", "type": "deep_link" }]
    6. }

    3. Context Engineering: The Real Difficulty of a Task-Based Assistant

    Once tasks are introduced, the biggest engineering challenge moves from “model capability” to “context organization.” Passive Q&A only handles the current turn’s input, but a proactive task must answer three questions: who does this task belong to, how far has it progressed, and what should be said right now.

    In practice, it helps to split context into three layers and manage their lifecycles separately. The session layer stores the most recent turns of conversation to keep tone and references consistent. The task layer stores the task goal, constraints, and completed steps, with a lifecycle tied to the task and usually fairly long. The fact layer stores preferences and long-term information the user has explicitly confirmed, and needs its own authorization and expiration mechanism. Mixing all three in the same context is a common root cause of “memory confusion” and “duplicate pushes” in task-based assistants.

    Another commonly underestimated problem is push frequency control. Proactive capability cuts both ways; unconstrained proactivity gets switched off by users quickly. Reasonable strategies include merging similar tasks, suppressing notifications during quiet hours, priority tiers (urgent, important, normal), and a daily cap for each task category. The frequency-control logic should be decoupled from the task orchestration layer and implemented as an independent policy component, so it can be adjusted without affecting the main flow.

    4. Capability Boundaries: Keep General Q&A and Multimodal Input

    It is worth noting that task orientation does not exclude general capabilities. Beyond handling reminders, such an assistant should still answer weather and general-knowledge questions and support image and file uploads for scenarios like receipt recognition and screenshot understanding. This tells architects that the task engine and the conversation engine should exist in parallel, with intent recognition deciding the route, rather than letting task logic swallow all traffic. The multimodal input pipeline (upload, preprocessing, extraction, writing back into context) should be an independent subsystem shared by both paths.

    5. Privacy, Compliance, and Staged Rollout

    Proactive pushing naturally involves user schedules, subscriptions, location, and spending information, so compliance design must come first rather than be patched on afterward. Four actionable principles: first, minimum necessity—a task reads only the fields required to achieve its goal; second, explicit authorization—sensitive categories such as location and health need separate switches that are off by default; third, explainability—every proactive message should be able to state why it was triggered and offer a one-tap way to turn off that task; fourth, minimal data retention—raw events are cleaned up according to policy after delivery completes, keeping only the audit records that are necessary.

    For release, this kind of capability suits a small-scale staged rollout with regional limits. Start with a single region and a single language to validate push accuracy and the user opt-out rate, then expand gradually. Evaluation metrics should not focus only on click-through rate; task completion rate, notification opt-out rate, and uninstall rate matter more, and the latter two are the true health indicators of a proactive capability.

    6. Mapping to General Cloud Capabilities

    You do not need to build all the infrastructure yourself; it maps to general cloud product categories. Use a message queue for event ingestion and peak shaving; a database for task metadata and state; a distributed scheduling service for delayed scheduling; object storage for attachments and images; and logging plus monitoring and alerting for tracing and push-effectiveness analysis. To reduce the cost of model integration and operations, you can also evaluate the combination of model services and general capabilities such as messaging and storage offered by Baidu AI Cloud.