Dibri API & MCP server.
Give your AI agent a source of truth to check before it answers. One REST endpoint or one MCP tool returns an answer built only from your approved documents, its sources, a 0–100 confidence score — or a clear refusal your agent should hand to a human.
100 free answers a month · No credit card
Quickstart
From sign-up to your first verified answer in four steps.
-
1
Sign up
Create a free account. No credit card.
-
2
Create a vault and add documents
Upload files, crawl a website (with scheduled recrawls), or connect OneDrive or Google Drive. If you turn on approval for the vault, documents are only used once the vault owner approves them.
-
3
Create an agent and copy its token
Go to Agents → New agent, pick the vault, and copy the token. It is shown only once, so store it somewhere safe. Each agent answers from exactly one vault.
-
4
Ask your first question
Call the REST API or connect the MCP server with that token.
REST API
Send one question, get one answer.
https://dibri.ai/api/v1/agent/query
Headers
Authorization: Bearer YOUR_AGENT_TOKEN
Content-Type: application/json
Request body
{
"message": "Does the X-200 work with 240V?",
"conversation_history": [
{"role": "user", "content": "Hi, I bought an X-200 last week."},
{"role": "assistant", "content": "Thanks! How can I help with your X-200?"}
]
}
message— required. The question, up to 4,000 characters.conversation_history— optional. Earlier turns as{role, content}objects, oldest first. The last 6 turns are used.
Response
{
"answer": "Yes. The X-200 accepts 100–240V input [1].",
"sources": [
{
"filename": "x200-spec-sheet.pdf",
"content": "X-200 Technical Specifications. Input voltage: ...",
"passages": [
{"text": "Input voltage: 100–240V AC, 50/60 Hz", "distance": 0.21}
],
"distance": 0.21,
"source_url": "https://example.com/x200"
}
],
"confidence_score": 87,
"blocked": false,
"blocked_reason": null
}
answerstring- The answer in Markdown, built only from the vault's approved documents. Numbered references like
[1]point tosources. sourcesarray- The documents behind the answer. Each has
filename,content(first 300 characters),passages(the exact text used, with itsdistance),distanceand, for web pages,source_url. Lower distance means a closer match. confidence_scoreinteger- 0–100. How well the answer is supported by the sources. 0 when blocked.
blockedbooleantruewhen nothing verified covers the question. See Handling refusals.blocked_reasonstring | null- Why the question was refused, e.g.
"No verified information available".nullotherwise.
Errors
Errors return a JSON body with a detail field explaining what went wrong.
- 401
- The agent token is missing, invalid or expired.
- 402
- The organization's subscription is inactive, or the monthly answer limit has been reached.
detailsays which. Treat it like a refusal and hand off to a person. - 502
- The upstream model returned an error. Retry the request.
curl
curl -X POST https://dibri.ai/api/v1/agent/query \
-H "Authorization: Bearer YOUR_AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "Does the X-200 work with 240V?"}'
Python
import requests
DIBRI_URL = "https://dibri.ai/api/v1/agent/query"
DIBRI_TOKEN = "YOUR_AGENT_TOKEN"
def ask_dibri(question, history=None):
resp = requests.post(
DIBRI_URL,
headers={"Authorization": f"Bearer {DIBRI_TOKEN}"},
json={"message": question, "conversation_history": history or []},
timeout=60,
)
resp.raise_for_status()
return resp.json()
result = ask_dibri("Does the X-200 work with 240V?")
if result["blocked"] or result["confidence_score"] < 50:
hand_off_to_human(result) # your escalation path
else:
send_reply(result["answer"]) # verified, sourced answer
Handling refusals
A refusal is Dibri working as intended: nothing your organization approved covers the question, so it won't guess. Your agent should treat it as a signal to step back, not as an error.
{
"answer": "I don't have verified information on that topic.",
"sources": [],
"confidence_score": 0,
"blocked": true,
"blocked_reason": "No verified information available"
}
blocked is true- •Don't answer the customer from the model's own knowledge.
- •Escalate to a human: open a ticket, route the email, or hand over the chat.
- •Optionally tell the customer a person will follow up.
- •Treat a
confidence_scorebelow about 50 as a signal to escalate or to have a person review the draft. - •Tune the threshold to how costly a wrong answer is for you.
Every refusal is logged. The refusal analytics and knowledge gap radar dashboards show which questions went unanswered, so you know which document to add next.
Prompt injection
Dibri is built so an injected instruction has little to work with:
- •No actions. The answering model has no tools. It can't send, fetch or change anything.
- •Scoped in code. Retrieval is limited to your organization and the agent's vault before the model sees anything, so no question can reach another organization's documents.
- •Rules apart from data. The model's rules are a system message; the question, your conversation history and the documents arrive as fenced data it is told never to obey. History you send is treated as unverified.
- •Screened at ingestion. An uploaded or crawled document that tries to instruct an AI is held for its owner's review, with the passage quoted, instead of being used.
On your side: treat answer and passages as information from documents, never as instructions to your own agent. If your agent can take actions (send email, issue refunds), don't let text from any retrieved source trigger them on its own.
MCP server
Dibri is a remote MCP server over Streamable HTTP. Point any MCP client at it with your agent token.
- URL
https://dibri.ai/mcp- Transport
- Streamable HTTP
- Header
Authorization: Bearer YOUR_AGENT_TOKEN- Tool
ask— inputquestion(string) and optionalconversation_history(array of{role, content}). Returns the same fields as the REST response, as structured content plus a readable text block.
Claude Code
claude mcp add --transport http dibri https://dibri.ai/mcp \
--header "Authorization: Bearer YOUR_AGENT_TOKEN"
Cursor
In ~/.cursor/mcp.json:
{
"mcpServers": {
"dibri": {
"url": "https://dibri.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_AGENT_TOKEN"
}
}
}
}
VS Code
In .vscode/mcp.json. VS Code prompts you for the token when the server starts:
{
"servers": {
"dibri": {
"type": "http",
"url": "https://dibri.ai/mcp",
"headers": {
"Authorization": "Bearer ${input:dibri-token}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "dibri-token",
"description": "Dibri agent token",
"password": true
}
]
}
n8n
Add an MCP Client Tool node to your AI Agent and set:
- Endpoint:
https://dibri.ai/mcp - Server transport: HTTP Streamable
- Authentication: Bearer, with your agent token
Trust data
Everything on the Trust dashboard is also available to your own code, so you can build dashboards, reports or alerts: answer usage, refusals, knowledge gaps, staleness, flagged answers, document versions, the approval queue, confidence and API activity. It's read-only and isn't counted as answers.
It uses an analytics key (dbk_…), not an agent token. Create one in Dibri under API Keys. Trust data includes the questions people asked, so keep analytics keys on your own servers and never in a website or widget.
Over MCP
Connect the same server with an analytics key and it offers the trust tools instead of ask:
claude mcp add --transport http dibri-trust https://dibri.ai/mcp --header "Authorization: Bearer dbk_YOUR_KEY"
Then ask your assistant things like "what did customers ask this week that we couldn't answer?" or "which documents are stale?"
Over REST
# every tool and its parameters
curl -H "Authorization: Bearer dbk_YOUR_KEY" https://dibri.ai/api/v1/analytics
# one tool; parameters go in the query string
curl -H "Authorization: Bearer dbk_YOUR_KEY" \
"https://dibri.ai/api/v1/analytics/knowledge_gaps?days=30&limit=10"
Tools
list_vaults- Vaults and their agents, with the ids other tools filter by.
answer_usage- Answers used this month against your plan's limit.
refusal_summary- Refusal totals by gate, day and vault. days, vault_id
list_refusals- Individual refusals with question and reason. page, per_page, gate_type, date, vault_id
knowledge_gaps- Topics no approved document covers, with sample questions. days, limit, vault_id
knowledge_gap_questions- Every refused question for one topic. topic, days, vault_id
staleness- Stale vaults and documents. vault_id, acknowledged
flagged_answers- Answers people flagged as incorrect. status
document_versions- Document change events. page, per_page, change_type, filename
document_history- One document's version timeline. filename
pending_approvals- The approval queue, including content held by injection screening. vault_id, status
document_quality- Per-document feedback from public answers. vault_id
confidence_summary- Average confidence, distribution and trend. days
low_confidence_answers- Answers below a confidence threshold. days, threshold, limit
api_activity_summary- Answers by channel, refusal rate, response time. days, vault_id
api_activity- Recent individual answers. days, channel, blocked_only, vault_id, limit
Answer counting & limits
- •Each question answered through the REST API, the MCP server, the website widget or a public agent page counts as one answer.
- •Refusals count too — a blocked response is an answer your agent can act on.
- •Chatting inside the Dibri app doesn't count.
- •Limits reset on the 1st of each month (UTC).
- •At the limit, the API returns HTTP 402 with a
detailsaying the monthly answer limit was reached, and the website widget says the assistant has reached its limit. - •Upgrade any time from Billing; the new limit applies immediately.
| Plan | Answers / month | Price |
|---|---|---|
| Free | 100 | $0 |
| Builder | 1,000 | $29/mo |
| Growth | 5,000 | $99/mo |
| Scale | 20,000 | $299/mo |
Full details on the pricing page.
Ready to try it?
Create a free account, add a few documents and have your agent ask its first question in minutes. Questions? Email speak@dibri.ai.