Query

Ask a question

Ask for the context your feature needs at the moment it needs it.

ts
const result = await rollup.query({
  question: "What should I recommend for dinner?",
  domain: "food"
})

Request fields#

FieldTypeDescription
questionstringRequired. The question to answer about the consented user’s history or context.
domainstringOptional. A scope such as food or travel, within the application’s existing access.

Make the question useful#

  • Ask about a concrete product decision or aspect of the user’s history.
  • Include the time frame when recent change matters.
  • Use an optional domain to narrow the relevant context.
  • Allow for insufficient evidence instead of assuming every question has an answer.

A dinner question can inform food preferences; it does not establish current opening hours, availability, or what the user wants tonight. Combine the answer with the application’s current context and the user’s choices.

Choose the right primitive#

Use profile() for a frequently reused preference. Use query() for a new question. Use search() when the feature needs to show an actual local memory or piece of media.