Skip to main content
There are two things here. One is a set of helpers for your agents: copilot, drafted replies, conversation summaries, and tag suggestions. The other is AI assistants, which reply to customers on their own, search your knowledge base, call your APIs, and hand the conversation to a human when they cannot help. Both are configured under Admin → AI, and neither works until you add a provider.
AI is currently in beta. Assistant replies go out to customers, so test on a low-volume inbox first.

Providers

Libredesk talks to any OpenAI-compatible endpoint: OpenAI, Anthropic, OpenRouter, Groq, Together AI, Azure, LiteLLM, or a local Ollama. Pick a preset to pre-fill the base URL and model, then edit anything you want. There are two providers to configure:
1

Configure completion

Go to Admin → AI → Providers. Pick a preset, paste your API key, and save.
2

Configure embedding

Fill in the embedding provider on the same page. Dimensions must match the model’s output size (1536 for text-embedding-3-small, 3072 for text-embedding-3-large, 768 for nomic-embed-text).
3

Test the connection

Hit Test connection on each. Libredesk sends a real request and reports what the provider said, including a dimensions mismatch.

Completion fields

Changing the embedding model or dimensions re-embeds existing snippets automatically.
Model choice matters. The cheapest models ignore your instructions and guardrails and make things up. You do not need a frontier model either. A mid-tier model like Claude Haiku or GPT-5.4 Mini is the right balance for support replies. Move up a tier if you see replies drifting from your instructions.
Every AI feature calls your provider and costs money on your account. Max tokens, max turns, and max steps are the settings that cap how much a single conversation can spend.

Snippets

Snippets are the knowledge base. The assistant and copilot search them to answer questions. One library, shared by every assistant. Write each snippet as a self-contained answer, not a fragment. A snippet titled “Refund policy” with the full policy in the body works; a single line pulled out of a longer page does not. You can add snippets three ways:
  • Manually - New snippet, title and content.
  • Import from URL - Libredesk fetches the page, keeps the readable content, and adds it as a snippet you can edit afterwards.
  • Suggestions - mined from resolved conversations, see below.

Learn from resolved conversations

Turn on Learn from resolved conversations under Admin → AI → Suggestions. Resolved conversations where a human agent gave a reusable answer are mined into FAQ suggestions. Each suggestion shows the question, the drafted answer, and a link to the conversation it came from. Approving one adds it to snippets. Rejecting one drops it. Nothing reaches the assistant until you approve it.

Assistants

An assistant is a persona with its own name, avatar, tone, instructions, and set of tools. Create as many as you need: one for billing, one for order status. Assistants show up alongside your agents as assignees. A conversation gets an AI reply only when it is assigned to an assistant, so route work to one with an automation rule (or assign it by hand to try it out). The assistant replies on both email and live chat, and only on open conversations - never snoozed or resolved ones.

Settings

Handoff

The assistant hands the conversation to a human, unassigns itself, and posts an activity message when it:
  • decides it cannot help
  • hits its max turns
  • errors out or times out
  • sees someone other than the contact reply on the thread

Test and Performance

The assistant edit page has two extra tabs:
  • Test - send a sample customer message and see the reply it would draft, plus which snippets it used. Nothing is saved or sent.
  • Performance - conversations, replies, resolution rate, handoff rate, reopen rate, replies per conversation, and CSAT for that assistant.

Tools

Tools let an assistant call your own APIs while replying, to look up an order, check a subscription, or cancel something. Create them under Admin → AI → Tools, then grant them per assistant.
Parameters example
On GET the arguments go on the query string. On POST they are the JSON body.

Identity headers

Libredesk adds these headers to every tool request, server-side. The model never sees them and cannot change them.

Require verified contact

An email address a customer types into a chat proves nothing. With Require verified contact on, the assistant emails a one-time code to the contact and asks them to paste it back before the tool can run. Codes expire in 10 minutes and both sends and attempts are capped. Turn it off only if your endpoint authenticates the customer itself. Once it is off, anyone who can reach the chat widget can trigger that tool for that contact.
Tool URLs are fetched by your Libredesk server. If you accept tool definitions from people you do not fully trust, turn on SSRF protection.

Writing a custom tool

The tool config above is the easy half. The endpoint it calls is where the work is, and three rules cover most of it:
  1. Check your own secret first. Configure a header like X-Api-Key on the tool and reject any request that does not carry it. Your endpoint is on the internet; the tool config is the only thing that proves the call came from Libredesk.
  2. Take the customer’s identity from the headers, never from the arguments. Libredesk injects the headers server-side and the model cannot see or change them. Anything in the request body was written by the model, from what the customer typed, so treat it as untrusted input. If the model asks for account_id=99999, look up the account that belongs to the contact in the header and ignore the number.
  3. Gate sensitive data on X-Libredesk-Contact-Verified. A visitor can claim any email address in chat. That header is true only after the contact proved the address with a one-time code, so require it before returning anything you would not show a stranger.
Return small, flat JSON. The response goes into the model’s context and long payloads are truncated, so send the three fields the assistant needs to answer rather than your whole account object. A non-2xx response is handed back to the model as text, so error messages are worth writing properly. “No order found for that ID” lets the assistant ask the customer to check the number. A bare 500 usually ends in a handoff. The repo ships a runnable version of this at scripts/tools-server. Run it with go run ./scripts/tools-server, point a tool at http://localhost:7070/account, and it logs every header and argument it receives.

For your agents

These need only the completion provider, and work whether or not you use assistants.
  • Copilot - a panel in the conversation sidebar. Ask it anything about the conversation; it searches your snippets and the contact’s history. Insert its answer into the reply box or add it as a private note. Rename it under Admin → General.
  • Drafted replies - describe what you want to say in the reply box and let AI write the reply.
  • Rewrite prompts - fix grammar and spelling, and the other prompts in the reply box AI menu.
  • Summarize conversation - drops an AI summary into the conversation as a private note.
  • Tag suggestions - suggests tags from your existing tag list.

Limits

Assistant worker and run limits live in config.toml:
One assistant run is capped at 90 seconds on live chat and 3 minutes on email, with each provider call capped at 60 seconds. A run that hits a cap hands off to a human.