# Context and questions

Separate facts from the decision rule. One context can answer several independent questions.

Source: https://shvydko.ai/en/docs/concepts/context

## State: task facts

state accepts JSON: a string, object, array, or any other JSON value. Text works for an email; an object with fields works for a ticket. Send the data needed for the decision: a support message, order status, rules, or a document excerpt.

A URL in the text does not automatically load the page. Extract its content in your own application and send the relevant excerpt. Files, images, audio, and video are not separate supported inputs for this API.

### Structured state

```json
{
  "state": {
    "message": "I want to change the delivery address",
    "shipment_status": "not_dispatched",
    "policy": "The address can be changed before dispatch"
  },
  "questions": {
    "change_allowed": {
      "type": "noul",
      "instructions": "Does the provided rule allow changing the address for this order?"
    }
  }
}
```

## Questions: the decision rule

questions is an object in which each question has its own identifier, type, optional instructions, and criteria in the appropriate format. Give each question one clear task and explain the differences between criteria.

Questions in one request share the same context. Do not ask one question to use another question's answer. For a dependent decision, make a second request in your code after receiving the first response.

- Choice: named categories from which to select one.
- Score: ordered scale levels from first to last.
- Noul: a statement or question with a yes/no answer.

## Plan for unknowns too

Add an “insufficient information” category if the task allows uncertainty. If a fact is missing, the model does not automatically retrieve it from your database or other requests.

Input text may contain instructions from a third party. Define the task in your own instructions, separate quotations from rules, and test conflicting instructions on your own dataset. JSON alone does not guarantee protection against incorrect decisions.

## Storage and sharing

Usage history stores request metadata, tokens, timing, status, and cost. A saved example in Shares separately contains state and questions, so review its contents before sharing.

New examples are organization-only by default. Public access must be chosen explicitly and also requires the organization's permission. Remove personal data, secrets, and real customer documents from demonstrations.

- [Privacy policy](https://shvydko.ai/en/privacy)
- [Saved examples](https://shvydko.ai/en/console/shares)

## Related documentation

- [Choice](https://shvydko.ai/en/docs-markdown/primitives/choice.md)
- [Score](https://shvydko.ai/en/docs-markdown/primitives/score.md)
- [Noul](https://shvydko.ai/en/docs-markdown/primitives/noul.md)
- [Limits and context](https://shvydko.ai/en/docs-markdown/api/limits.md)
