Retrieval
Answer repeated customer questions from approved sources.
Use a retrieval source bucket to draft or support email answers for common customer questions without creating a separate chat surface.
Token first
Make sure the agent has these scopes.
Create a new token or update the agent's current token before trying the calls below.
Required token scopes
Outcome
What this gives you.
Agents answer recurring customer questions with citations from approved company, inbox, and file context.
Use when
The operational shape.
- Customers ask the same policy, pricing, onboarding, billing, or operational questions by email.
- A support or success inbox needs consistent answers without moving the conversation out of email.
- You want retrieval evidence attached before an agent drafts or a human approves a reply.
API sequence
The calls to make.
Create the source bucket
Define the approved sources the answer may use. This can combine public pages, email history, Files folders, contacts, calendar context, and configured intelligence records.
{
"name": "Customer answer base",
"bucket_type": "support_class",
"owner_type": "tenant",
"owner_id": "ten_123",
"sources": [
{
"type": "public_web",
"seed_urls": ["https://example.com/help"],
"allowed_domains": ["example.com"],
"max_pages": 50
},
{
"type": "email",
"inbox_id": "inb_support",
"label_id": "lbl_answered"
},
{
"type": "files",
"folder_id": "fld_support_docs",
"include_children": true
}
]
}
Estimate and index
Show expected indexing size and AI cost before queueing the indexing job.
{
"force": false,
"sensitive_source_approved": false
}
{
"force": true,
"sensitive_source_approved": true,
"chunks": [
{
"source_type": "email",
"text": "Customer support policy and onboarding notes."
}
]
}
Run retrieval for a customer email
Ask against the source bucket using the current email and contact as context.
{
"bucket_id": "rb_support_answers",
"query": "What should we tell this customer about invoice payment timing?",
"task": "email_answer",
"inbox_id": "inb_support",
"context": {
"message_id": "msg_123",
"thread_id": "thr_123",
"contact_id": "ctc_123",
"subject": "Invoice timing question"
},
"output_type": "evidence"
}
Send or hold the reply
Use the retrieval answer as evidence for a reply. Tokens configured with approval requirements will hold the send for review.
{
"reply_to_message_id": "msg_123",
"to": [{"email": "customer@example.com"}],
"text_body": "Thanks for asking. Based on our payment policy, invoices are due within 15 days unless the agreement says otherwise."
}
Controls
Review points.
- Source buckets are configured independently, then referenced by retrieval runs and workflows.
- Retrieval runs have zero direct retrieval-unit cost; answer generation and embeddings are billed through the normal AI usage model.
- Use approval-gated sending when answers affect contracts, billing, legal commitments, or sensitive customer state.