AddThisFeature

AI Chat Assistant

Give users a conversation that answers questions and helps them finish work in the app.

involved AI Assistants

What it adds

A persistent chat surface with streamed responses, stored conversation history, and a defined set of actions it may take on the user's behalf.

What your agent is told to do

5
  1. 1

    Store conversations as records owned by a user and a workspace, and load every message through the same authorization path the rest of the app uses. Do not trust a conversation identifier supplied by the client as proof of access.

  2. 2

    Stream tokens to the interface as they arrive, but persist a message only once the generation finishes cleanly. A stream that is cancelled, truncated, or errored must be marked incomplete rather than saved as an answer.

  3. 3

    Set a token ceiling and a wall-clock timeout for every request, and trim old turns from the context with a summary of what was dropped rather than sending the entire history each time.

  4. 4

    If the assistant can perform actions, let it only propose them and require the user to confirm before anything is written. Report success from the result of the action, never from what the model said it did.

  5. 5

    Page-specific context — the record being viewed, the current route, the actions available on that screen — is owned by Contextual Page Copilot. This feature owns the conversation, its storage, and its streaming; do not build a second context assembler here.

Edge cases it handles

8
  • Every conversation and message must be scoped to one user and one workspace. A user who switches workspaces must not see the previous workspace's threads, and an identifier guessed or replayed from another account must resolve to nothing.
  • A partial stream is not an answer. If the connection drops mid-generation or the user navigates away, the interface must show the turn as unfinished and offer to retry rather than leaving a half sentence in the transcript.
  • Timeouts, provider errors, safety refusals, and user cancellation are four different outcomes and need four different messages. A refusal is not a bug and must not be retried automatically.
  • Long conversations grow expensive and lose relevance. Cap the context window, and make the trimming visible enough that the user understands why the assistant no longer remembers something from an hour ago.
  • The assistant must never claim an action succeeded unless the app confirmed it. If the confirmation call fails after the model announced the result, correct the transcript rather than leaving the false claim in place.
  • The provider being unavailable must degrade the feature, not the page. The chat surface shows an unavailable state and the rest of the app keeps working.
  • Enforce a per-user and per-workspace spend or request ceiling, and tell the user plainly when they have reached it instead of failing with a generic error.
  • Pasted content the user does not realise is sensitive still leaves the app. State in the interface what is sent to the provider, and exclude fields the workspace has marked restricted.

Definition of done

8
  • Conversations and messages are readable only by the owning user within the owning workspace.
  • Cancelled, timed-out, and truncated generations are stored as incomplete and are never presented as finished answers.
  • Every request carries a token ceiling and a timeout, and context is trimmed rather than allowed to grow without bound.
  • Actions are proposed for approval, and reported outcomes come from the app rather than from the model's own claim.
  • Refusals, provider outages, and rate limits each produce a distinct, non-technical message.
  • The app remains fully usable when the model is unavailable.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.