Platform
AI chatbox (Ask MantAI)
- Written for
- Dashboard users, and developers calling the chat endpoint.
- You need
- A dashboard account. For the API examples, a session token (see the API reference).
The MantAI AI chatbox lives on the Ask MantAI page in your dashboard. Ask in plain English about your vehicles, drivers, driving patterns, and sound diagnoses. It works from the same scoped fleet data you already see on every other page, not the open web.

What you see on the page#
| UI element | What it does |
|---|---|
| Hero banner | “Ask anything about your fleet”. It reminds you that answers draw on your vehicles, drivers, patterns, and sound diagnoses, and shows which fleet scope is active (for example, the Sample demo fleet or your organization). |
| Conversation | Your messages show up as dark bubbles, and replies stream in as readable text with lists and summaries drawn from the rides in scope. |
| Input bar | The placeholder reads Ask about vehicles, drivers, patterns, sounds…. Hit the arrow button to send, or tap the microphone and speak your question; it sends when you stop talking, or tap it again to finish early (Chrome, Edge, Safari). |
Open the chatbox in three steps#
| Step | Action |
|---|---|
| 1 | Sign in at mantai-api.mantai-backend.workers.dev using the magic link from your email. |
| 2 | Pick your scope (personal or organization) in the header. The assistant only ever sees data for the scope you choose. |
| 3 | Open Ask MantAI from the sidebar, then type a question (for example, Compare Marc and Sofía across their last rides) or tap the mic and say it. |
Anywhere in the docs, press ⌘K (Ctrl+K on Windows and Linux) and search for AI chatbox to jump right back here.
What you can ask about#
| Topic | Example questions |
|---|---|
| Vehicles | Which cars had high-risk sound findings this week? · When was the Sprinter last driven? · Which vehicle sounds like it needs a mechanic? |
| Fleet | How many km did we drive this month? · What harsh events happen most? · How healthy is the fleet acoustically? |
| Drivers | Who has the worst driving score right now? · Compare Marc and Sofía across their last rides. · Who brakes hardest per 100 km? |
| Sounds & maintenance | Summarize open brake findings. · Explain what a high-risk clip means for scheduling service. |
How answers stay specific to your data#
Every time you send a message, the dashboard puts together a compact JSON snapshot of your current scope, covering fleet totals, driver scores, recent rides, flagged sound clips, and vehicle health, and sends it along with your conversation to POST /v1/ai/chat. The model has no web access. It is instructed to answer from that context, your message history, and general vehicle knowledge, to say so when the context does not hold the answer, and not to invent vehicles, drivers, or diagnoses that are not in it. Those are instructions to a language model, not hard guarantees, so check figures that matter against the dashboard pages they come from.
- Streaming replies. Text appears as it is generated, in the dashboard and through the API alike.
- Voice input. Works in Chrome, Edge, and Safari through the browser microphone button. It is optional, and typing always works too.
- Suggested prompts. When a thread is empty, you get one-click starters for scores, sound risk, monthly km, and driver comparisons.
Call the same chatbox from your code#
The dashboard chatbox and your own integrations use the same endpoint. Authenticate with the same bearer session token you use for the REST API (see API reference).
curl -N -X POST https://mantai-api.mantai-backend.workers.dev/v1/ai/chat \
-H "Authorization: Bearer <session-token>" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "Which drivers had the most harsh braking this month?" }
],
"context": "{\"scope\":\"org:your-org-id\",\"fleet_km\":1240}"
}'Here is what goes in the request body:
| Field | Type | Purpose |
|---|---|---|
messages | array | The conversation turns ({ role: user | assistant, content: string }). Pass the whole thread when you want follow-ups to keep their context. |
context | string (JSON) | An optional fleet snapshot. The dashboard assembles this for you, and integrations can pass their own slimmed-down summary instead. |
Minimal JavaScript client
// Node.js 18+ (ES module). The reply streams back as plain text.
const res = await fetch("https://mantai-api.mantai-backend.workers.dev/v1/ai/chat", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${sessionToken}`,
},
body: JSON.stringify({
messages: [{ role: "user", content: "Any vehicle with critical sound risk?" }],
context: fleetSnapshotJson,
}),
});
if (!res.ok) {
const { error } = await res.json().catch(() => ({ error: res.statusText }));
throw new Error(`AI chat failed (${res.status}): ${error}`);
}
const reader = res.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
process.stdout.write(decoder.decode(value, { stream: true }));
}Privacy
GET /v1/rides and GET /v1/drivers. The endpoint itself requires a valid session but does not read your fleet data or check the context string: whatever a caller passes is forwarded to the model as is. When you call it from your own code, build the context only from data that caller is allowed to see.