Tulip Logo IconTulip
Recipes

Workspace Assistant

One chat assistant with every capability of the app, for the signed-in user.

The in-app assistant talks to the chat and acts for the signed-in user. Give it the whole capability catalog: what it may do is decided by the user's permissions and the workspace's settings for the assistant, not by which tools it has.

The agent

export const assistantAgent = defineAgent({
  name: "assistant",
  title: "Assistent",
  model: openrouter("openai/gpt-5-mini", { reasoning: { effort: "low" } }),
  instructions,
  tools: { ...capabilities, web_search: webSearchTool },
});

Add it to Agents.init({ agents }) and activate it once per workspace (see Manage agents). Until then the chat refuses messages.

The chat

Send turns with chat.send() from an authenticated procedure, and render them with useAssistantChat() and ChatThread (see Chat). Every change the assistant makes asks first, unless an admin allowed the tool for the assistant:

  • Once: approves this one call.
  • For this chat: approves the tool for the rest of the chat, until the user takes it back.

Tools with confirmation: "passkey" always ask, with a passkey (see Approvals).

Instructions

Organize the instructions per domain the catalog covers, in one prompt:

  • operating principles: tools for every factual claim, one clarification question at most
  • one short section per domain, such as delivery, time analytics and documents, with its rules
  • when to use web search, and when not
  • change rules: only when asked, ids from tool results, no confirmation in text since the approval in the chat is the confirmation, no retry after a denial
  • response style

Give one assistant the tools, instead of splitting the chat over several agents: it keeps the whole conversation in one context.

Starter prompts

Show a few things the assistant can do, not everything:

  • one lookup ("Which tasks are open in project X?")
  • one analysis ("How healthy is initiative Y?")
  • one change ("Create an initiative Z in project X")

On this page