Desk is a complete support app you run yourself. Visitors ask questions in a chat widget; the assistant answers from your help center and links its sources; when it can't help, or the visitor asks for a person, the chat goes to your team, who reply from a dashboard. Everything updates live.
It's also a reference app for ModelRiver: streaming, conversation history, human handoff and live updates all come from ModelRiver, so Desk itself stays small. The source is MIT-licensed at github.com/modelriver/desk.


What's included
| Part | What it does |
|---|---|
| Chat widget | Answers from your help articles with citations, streams replies as they're written, and hands the chat to your team when needed. Embed it on any site through /widget. |
| Help center | Your public articles as a searchable site, with sections, a table of contents, related articles and "Was this helpful?" votes. |
| Team dashboard | Every conversation, who's handling it, and who's waiting. Take over, reply, hand back to the AI, or archive. |
| Tickets | Requests your team answers by email, with replies, internal notes, an assignee, a status and AI-drafted replies. Customers follow and answer theirs in a customer portal. See Tickets. |
| Knowledge base | Write articles in an editor that formats Markdown as you type, organize them in folders, and arrange them by dragging. Publish, unpublish or delete several at once. |
| Insights | Questions the help center couldn't answer, and the articles rated least helpful, so you know what to write next. |
| Integrations | Optional, read-only lookups in Shopify, Stripe, Cal.com or your own API, so the assistant can answer from a verified visitor's own orders, billing or bookings. |
The bot in the widget shows what it's doing: online while it waits, listening while the visitor types, thinking while it writes, solved when it has answered, and stepping aside when it passes the chat to your team.


How it uses ModelRiver
- A visitor asks a question. Desk searches your articles and private notes and picks the best passages.
- It sends them, with the question, to
POST /v1/ai/asyncwithstream: trueand the visitor'ssession_id. The browser joins the request's channel with@modelriver/clientand shows the answer as it streams. - The conversation is stored in a ModelRiver session. Desk keeps no copy of the messages; its own SQLite file only maps conversations to sessions.
- When your team takes over, their replies and the visitor's next messages are added with
POST /v1/sessions/:id/messages. The AI sees them as part of the conversation when it takes over again. - The widget and the dashboard follow the conversation with live updates. Desk's own changes (a takeover, a hand-back, an archive) go out as signals.
Private notes shape answers but are never quoted, cited or linked. The AI never has access to Desk's database or to your connected services: Desk's server decides what to look up and sends the model only the result.
Quick start
You need Node.js 26.12.1 or later and a ModelRiver API key.
git clone https://github.com/modelriver/desk.gitcd desknvm usenpm cicp .env.example .env # then set MODELRIVER_API_KEYnpm run create-adminnpm run devOpen http://localhost:3000 for the help center and chat widget, and http://localhost:3000/dashboard for the team side. Your first sign-in sets up two-factor authentication.
Create the workflow
In the ModelRiver console, import examples/support_assistant.workflow.json with Import workflows and publish it Live. It's a chat workflow named support_assistant with Sessions on and the prompt from examples/workflow-system-prompt.md. It answers with Anthropic claude-haiku-5-5 and falls back to OpenAI gpt-6-luna, so the assistant keeps answering if one provider is down. Pick models your project has keys for. To use another name, set MODELRIVER_WORKFLOW.
Set up email
Recommended. Desk runs without email, but these need it:
| Needs email | Without it |
|---|---|
| Raising a ticket from the chat | No code can confirm the visitor's address, so the ticket has no email and your team can only answer in the chat |
| Replying to tickets | Only internal notes work |
| Customer portal sign-in | Customers can't get a code, so they can't sign in |
| Account lookups | Only visitors signed in on your site (with an identity token) can be looked up |
| Team notifications | Nobody hears about new tickets or people waiting unless they're watching the dashboard |
Add a provider, its key and your addresses to .env, then restart:
EMAIL_PROVIDER=resend # or postmark (POSTMARK_SERVER_TOKEN), or ses (AWS_REGION and keys)RESEND_API_KEY=re_…EMAIL_FROM="Acme Support <[email protected]>" # on a domain the provider has verifiedSUPPORT_REPLY_TO=support@acme.com # a mailbox your team reads: customers' replies to tickets go hereAPP_URL=https://support.acme.com # for links in emailsCheck it with Dashboard → Settings → Send a test email. In development, EMAIL_PROVIDER=log prints every email, verification codes included, to the terminal instead of sending it.
Configuration
Desk reads its settings from .env. The main ones:
| Variable | Default | What it's for |
|---|---|---|
MODELRIVER_API_KEY | Your project API key. Server-side only | |
MODELRIVER_API_URL | https://api.modelriver.com/v1 | The ModelRiver API |
MODELRIVER_WORKFLOW | support_assistant | The workflow that answers questions (Sessions on) |
DATA_DIR | ./examples/data | Your articles and notes (see below) |
DATABASE_PATH | ./var/support.db | SQLite file for users and conversation mapping |
APP_URL | The address of your Desk, for links in emails and search engines | |
EMAIL_PROVIDER | Recommended. resend, postmark, ses or log, for tickets, email verification and team notifications (see Set up email) | |
EMAIL_FROM | The sender, on a domain your provider has verified | |
SUPPORT_REPLY_TO | EMAIL_FROM | Where customers' replies to ticket emails go: a mailbox your team reads |
ARCHIVE_RETENTION_HOURS | 24 | How long archived conversations are kept before they're deleted, in ModelRiver too |
WIDGET_FRAME_ANCESTORS | Sites allowed to embed the widget | |
GLOBAL_MESSAGES_PER_MINUTE, GLOBAL_MESSAGES_PER_DAY | 20, 800 | Site-wide caps on AI answers, set for the Free plan. Raise them on a paid plan |
The look starts from support.config.json; Dashboard → Settings changes it without a restart (see Your brand), and turns the chat and handoffs on or off (see Chat switches).
Your content
DATA_DIR has two folders:
public/: Markdown articles. They make up the help center and the assistant cites them. A folder is a section and a subfolder a subsection; article URLs follow them, like/articles/billing/refunds.private/: internal notes and playbooks (.mdor.txt). The assistant uses them, but never shows, quotes or links them.
Edit everything from Dashboard → Knowledge, where changes go live without a restart. You can also edit the folder directly; restart Desk afterwards to pick up those changes.
An article or Markdown note can be a draft: Save draft keeps it out of the help center and everything sent to the AI, Publish adds it, and Unpublish moves it back to draft. In the file itself, a draft has status: draft in its front matter.
Your brand
Admins set the look and how the help center shows up in search under Dashboard → Settings. Changes apply at once, with no restart.
| Tab | What you can set |
|---|---|
| Appearance | The header logo, with an optional dark-mode version (SVG preferred, shown 26 px tall). Hiding the name beside the logo, once there is one. One brand color, which sets buttons, links and highlights for light and dark mode; black, white and grey give ink buttons, near-black in light mode and near-white in dark mode. Body and heading fonts from a short list on Google Fonts, and the corner style. The home page's heading, the line under it, and the example question in its question box |
| SEO | The name, added to every page's title as "Page — Name". The home page's own title and meta description, with a search-result preview. The favicon (a square SVG, or a 512 × 512 PNG) |
These are saved in Desk's database and laid over support.config.json, which still sets the defaults. A blank field, or Reset to defaults, goes back to the file (or, for the home page's text, to Desk's own wording). Fonts other than the system's load from Google Fonts.
Chat switches
Dashboard → Settings → General has three switches under Chat assistant. They apply at once, and who changed them, and when, shows beside them and in the audit log.
| Switch | When it's off |
|---|---|
| Visitors can chat | The chat button, the home page's question box and the embedded widget go away, and new chats and messages are refused. Articles and search keep working. Useful during an incident or while articles are being rewritten |
| Visitors can talk with a person | Visitors can still chat with the assistant, but asking for a person doesn't hand the chat over. The assistant says no one from the team is available right now, and the visitor can raise a ticket instead (see When no one is available). Turn it off when no one is around to answer |
| Customers can raise tickets | No new tickets from the chat or the customer portal. With Talk with a person also off, the assistant just says no one is available right now. Customers can still read and reply to their tickets, and your team can still open tickets from the dashboard |
Talking to a person
The chat goes to your team when the visitor asks for a person (including when they accept the assistant's offer after an answer it wasn't sure of), or when the AI can't respond. While someone is handling a chat, the AI stays quiet; anyone can hand it back. Teammates can get an email for every new conversation or only when a visitor asks for a person, chosen in their account settings.
Replies from the team show the teammate's name in the visitor's chat, with the profile picture they set under Account settings → Profile (round initials in the dashboard for anyone without one).
When no one is available
With Visitors can talk with a person off:
- The visitor asking for a person, in any wording, gets a short reply saying no one from the team is available to chat right now, and a Raise a ticket form opens in the chat: what they need, and their email, which they confirm with a 6-digit code before the ticket is raised, so nobody can raise one in someone else's name. A visitor who already verified their email isn't asked again. Once raised, they see the ticket's reference, like #K7F3Q9. The form is also in the chat's menu, in place of Talk to a person.
- Your team gets each message as a ticket under Tickets, with the visitor's email (marked Verified when they proved it) and a link to the chat it came from. The visitor is told the ticket's reference. The dashboard counts open tickets, and teammates who get "someone wants a person" emails get one for each.
- Taking over still works. The switch only stops visitors from asking: anyone on the team can still open a conversation and take it over from the dashboard, and chats already waiting for a person stay waiting.
- If the AI can't answer while it's off, the chat isn't passed to the team: the visitor is asked to try again or raise a ticket.
Two roles: admins manage the team, the knowledge base and settings; agents handle conversations.
Tickets
Dashboard → Tickets holds requests your team answers by email, on their own time. A ticket is raised by a visitor from the chat while no one is available, from a chat a team member turns into one (Create ticket), or is opened by hand (New ticket) for a call or an email.
| Status | Open (needs the team), Waiting on customer or Solved, one tab each, oldest open ticket first. Filter by Me or Nobody |
| Replies | Sent by email from EMAIL_FROM, signed with the team member's name, with the ticket's reference in the subject, the customer's message quoted and a View ticket and reply link to the customer portal. Answers by email go to SUPPORT_REPLY_TO. A reply that fails is kept on the ticket and retried automatically for about 16 hours; Send again sends it straight away |
| Subjects | Admins list what customers usually write about under Tickets → Subjects. Customers pick one when they raise a ticket, in the chat or the portal, or choose Something else |
| Confirmation | A visitor or customer who raises a ticket with a proved email gets its reference and a link to the portal. The confirmation and every reply share email threading headers, so they stay in one thread |
| Notifications | Each team member chooses, under Account settings: Tickets assigned to you (on by default: assigned by someone else, or the customer replied) and Every new ticket (new tickets, and replies on tickets nobody has). Failed emails are retried like replies |
| Internal notes | Seen only by your team, and never sent to the AI |
| AI drafts | Draft with AI writes a reply from your articles and private notes for the team member to edit and send. It marks [add details] instead of guessing. Each draft is one request to your workflow, counted in the site-wide AI caps; Desk deletes the session ModelRiver starts for it |
| History | Every message, reply, note, status and assignee change, with who did it and when |
| Retention | Solved tickets are deleted 90 days after they were solved |
Customers who reply in the portal add to the ticket and open it again. Replies by email land in your SUPPORT_REPLY_TO mailbox rather than in Desk; set the ticket back to Open when one arrives.
Customer portal
/customer-portal is where customers see the tickets raised with their email, read your replies, answer them and raise new ones. There's no password: they sign in with a 6-digit code sent to their email. The help center's header links to it as Your tickets once email is set up.
| From a reply email | View ticket and reply signs them in and opens that ticket. The link works for 30 days, for that ticket's address only |
| Otherwise | They enter their email and the code. The answer is the same whether or not the address has tickets, so the form can't be used to find your customers |
| What they see | Their own tickets: subject, reference, status, their messages and your replies. Never internal notes, the assignee or anyone else's tickets |
| Raising a ticket | Marked Verified, since the code proved the address. Up to 5 a day per address, in the portal and the chat together |
| Staying signed in | 14 days, in an HttpOnly cookie. Sign out ends it on the server too |
Sign-in codes, tickets and replies are rate-limited per address, per IP and site-wide, and 5 wrong codes lock an address for 15 minutes.
Blocking a customer
Block this customer on a ticket, or Tickets → Blocked customers for any address, stops that email at once: no sign-in or verification codes, no ticket links, no new tickets in the portal or the chat, and no replies. Any portal session ends. They aren't told, and your team can still email them. Unblock on the same page undoes it; both are in the admin audit log.
Integrations
Connectors let the assistant answer "where's my order?", "when does my plan renew?" or "when is my appointment?" from the visitor's own records. Admins turn them on under Dashboard → Integrations by pasting a key.
| Connector | What the assistant can see | Key |
|---|---|---|
| Shopify | Recent orders: status, items, shipping and tracking links | Admin API token with only read_orders |
| Stripe | Subscription, plan, renewal date and recent invoice links | Restricted key (rk_…) with read access |
| Cal.com | Upcoming bookings with reschedule and cancel links | API key |
| Custom HTTP | Up to 20 facts from your own API | Your URL and a signing secret |
- Visitors prove their email first. They verify with a 6-digit code sent by email, or your site passes a signed identity token for visitors who are already signed in. Lookups only ever use that verified email, so nobody can see someone else's records. It lasts for the rest of the chat, up to 24 hours (
VERIFIED_HOURS) or 2 hours without a message, then they verify again. - Read-only. A Shopify token with write scopes, or a full Stripe secret key, is refused. Refunds and changes are answered with a link or handed to your team.
- Only what's needed. Each connector keeps a short, fixed list of fields; addresses, phone numbers and card details are never read into the conversation.
- Keys stay on your server. They're encrypted with
DESK_SECRET_KEYand never shown again. Desk calls each service directly; ModelRiver only sees the short result, as part of that turn's request. - On the record. Every lookup is listed with a masked email and its result, and your team sees it on the conversation.
No extra AI request is made for a lookup. The README has the setup steps for each connector, the Custom HTTP request format, and how to sign identity tokens.
Deploy
Desk is one Node.js process and one SQLite file. Everything it keeps (articles, notes, the database and your branding) lives in one data folder, so it runs anywhere that folder survives a restart. Each option has its own guide:
| Option | Good for | HTTPS | You need |
|---|---|---|---|
| Ubuntu server | A VPS you control, including small ones (512 MB) | nginx and Let's Encrypt, set up for you | Ubuntu 22.04 or later and a domain |
| Docker Compose | Any server with Docker | Caddy, automatic | Docker with Compose 2.23 or later and a domain |
| Fly.io | Managed hosting from the command line | Fly | A Fly account and flyctl |
| Render | Managed hosting from a link | Render | A Render account on a paid instance type |
| Railway | Managed hosting with automatic updates | Railway | A Railway account |
| By hand | Other Linux distributions | Your own proxy | Node.js 26.12.1 or later |
Updating covers new versions on each of them, by hand or on a schedule. On an Ubuntu server it's sudo desk-update, which backs up first and goes back on its own if the new version doesn't start.
The Docker image, ghcr.io/modelriver/desk, is built for amd64 and arm64 and is what Docker Compose, Fly.io, Render and Railway run. The 1 tag follows every 1.x release; a full tag like 1.0.1 pins one version.
Whichever you choose:
- Import the workflow first. Create the workflow in the ModelRiver console and publish it Live, or every answer fails.
- HTTPS is required. Desk's sign-in cookies are secure-only in production, so the dashboard only works over HTTPS. Every option sets it up.
- Two secrets.
DESK_SECRET_KEY(32 bytes, base64:openssl rand -base64 32) encrypts connector keys, andDESK_IDENTITY_SECRET(openssl rand -base64 48) signs identity tokens. Make them once and keep them: ifDESK_SECRET_KEYchanges, keys saved on the Integrations page can't be read. - One instance. Rate limits live in memory and the database is one file, so never run two copies against the same data.
APP_URL. Set it to your Desk's address once you know it. It's used for links in team emails and in the sitemap.- Email, recommended. Set up email so visitors can raise tickets your team can answer, prove their email for account lookups, and so your team gets notified. Each guide shows where to add the settings.
Other platforms
Any host that runs a Docker image with a persistent disk can run Desk: one instance, the disk mounted at /data, port 3000, and HTTPS in front. Tell Desk where the visitor's address comes from so rate limits work: CLIENT_IP_HEADER for a header your host sets, or TRUST_PROXY_HOPS for the number of proxies that add to X-Forwarded-For.
Hosts without a persistent disk don't fit: Cloudflare Containers resets the disk when a container sleeps, and Vercel and other serverless functions keep nothing between requests.
Next steps
- Desk on GitHub: source, issues and the full README
- Sessions API: read, extend and follow conversations
- Client SDK: streaming and live sessions in the browser