Skip to content

Ask, answers from your docs

Ask answers a reader's question from your product's own docs, cites each page it used, and says so when no page answers.

One question, asked to answered

Filled: what the reader sees. Each question is kept, answered or not.

An answer, line by line

A Customer's agent asks over the docs MCP why a lookup cost nothing, and gets this.

Response
HTTP/1.1 200 OK
Content-Type: application/json
X-Cost: price=0, currency="USD"
X-Request-Id: req_47b0e9c25d1a3f86c0e7

{
  "question": "Why did a lookup for initech.com cost nothing?",
  "answer": "A lookup that finds no company is a miss, and a miss is free.",
  "citations": [
    { "page": "/docs/errors#not_found", "section": "not_found" }
  ],
  "version": "v4",
  "answered": true
}
FieldWhat it holds
answerAt most 120 words, each sentence backed by a citation; a sentence no page supports is dropped before the answer leaves
citationsUp to 8 pages and sections, each at the Version the reader calls
answeredfalse when no page answers; then reason says why and results holds the search results
handoffWith handoff on, the link that opens a help request with the question attached

A price is never paraphrased: it prints from the Offer, as the reference does.

Where a reader asks

Who asksWhereWhat comes back
A developer reading the docsThe search box, under the resultsThe answer, each sentence linked to its section
A Customer's agentask on the docs MCP at /docsThe answer as text, with citations and version as data
A member in the portalThe help page, before a help requestThe answer, then a button that opens the request with the question attached

With signedIn, Ask also reads a signed-in reader's own plan and usage, for questions such as "how many calls are left".

When Ask does not answer

Ask never acts, never reads another Customer's records, and never charges the reader. Each way it declines says why.

The caseThe reader gets
No page supports an answeranswered: false, reason: "no_page", the search results, and the help link when handoff is on
A question about another Customer, or one that asks Ask to act or spendanswered: false, reason: "out_of_scope", and the Verb's docs page when one does what was asked
Text in the question that tries to instruct AskRead as words to search, never as an order, as untrusted text is everywhere
A usage question from a reader who is not signed inThe docs' answer alone, with reason: "sign_in" and the sign-in link
The reader's questions for the day are spent429 ask_limited, with Retry-After and the search results in results
Your AI allowance is spent and your spend cap holds503 ask_paused, with the search results; search never stops
A question over 500 characters400 invalid_param, naming the limit
The model behind Ask does not answer in 20 secondsanswered: false, reason: "unavailable", and the search results

Every question is kept, answered or not, with Question.list on the Operator plane. An unanswered one joins the unmet asks your product reports on its life.

Thirty questions a day

The lookup by domain answers 30 questions a reader a day, and hands the rest to a person.

definition.ts
19 lines
import { define, secret } from 'apis.dev'

/** Any company by its domain, with its headcount and sector, and cited answers over its docs. */
export default define({
  name: 'companyfacts', domain: 'companyfacts.apis.dev',
  sources: {
    firms: { origin: 'https://firms.example.com', key: secret('FIRMS_KEY') },
  },
  Company: {
    domain:    { type: 'url!#',   from: 'firms', map: 'website' },
    employees: { type: 'number?', from: 'firms', map: 'headcount' },
    sector:    { type: 'string?', from: 'firms', map: 'industry' },
  },
  offer: {
    'Company.get': 0.002, 'Company.search': 0.005,
    free: { 'Company.get': 100 },
  },
  docs: { ask: { day: 30, handoff: true, signedIn: true } },  // on your AI allowance
})

How much a reader may ask

WhatHow much
Questions a reader asks each dayday, from 1 to 500; 20 when the file names none
A question500 characters
An answer120 words and 8 citations
LanguagesThe reader's locale where the docs are written in it; else the docs' first locale, said so in the answer
KeptEvery question and answer, 400 days, then cold with the rest of the product's history
Who paysYour AI allowance; a reader never pays for a question. Ask is a Launch feature