> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exterview.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How Smaya Works

> Smaya's first release: a read-only question-and-answer loop grounded in your knowledge base and the record on screen, with citations on every answer.

## Purpose

Smaya is a real agent, not a search box. In its first release, it will answer, read-only. The same design lets it act safely as it grows, because it runs a bounded loop with a human approving anything that changes data. This page shows that loop and how Smaya decides it is done.

## The agent loop

You give Smaya a question or a goal. It perceives the current state, reasons about a plan, and works one step at a time. Read and navigate steps proceed on their own. Any step that would change data is proposed and held for a person to approve. After each step it observes the new state and checks the result against the goal, then either continues or exits. This reason, act, observe cycle is the ReAct pattern: Smaya reasons about the next step, acts, then observes the result before deciding again.

```mermaid theme={null}
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#EEF2FF','primaryBorderColor':'#4B6CFE','primaryTextColor':'#0F172A','lineColor':'#64748B','clusterBkg':'#F8FAFC','clusterBorder':'#E2E8F0'}}}%%
flowchart TD
  A([Ask a question or set a goal]) --> B([Perceive the record + your knowledge])
  B --> C([Reason and plan the next step])
  C --> D{Does this step change data?}
  D -- No, read or navigate --> E([Act])
  D -- Yes --> F([Propose and wait for approval])
  F -- Approved --> E
  E --> G([Observe the new state])
  G --> H{Goal met?}
  H -- Not yet --> C
  H -- Yes --> I([Exit and report])
```

*Smaya plans one step at a time: read and navigate steps run on their own, any step that would change data waits for human approval, and it observes the result before continuing until the goal is met. Only the read-only path is planned for the first release.*

## How Smaya decides it is done

The loop is goal-bounded, never open-ended. Every iteration ends at a decision that resolves to exactly one end state, and a hard ceiling on steps means a run can never spin forever.

<CardGroup cols={2}>
  <Card title="Completed" icon="circle-check">
    The goal's success criteria are met. Smaya returns the answer, artifact, or completed action.
  </Card>

  <Card title="Waiting for approval" icon="user-clock">
    A step would change data. Smaya pauses at the approval gate and executes
    nothing until a person confirms.
  </Card>

  <Card title="Failed safely" icon="shield-check">
    A check or guard tripped. The run stops with no partial change left behind,
    and the state is unchanged.
  </Card>

  <Card title="Escalated to a human" icon="user-plus">
    Confidence is low, or a step limit is reached. Smaya hands off to a person with the full trace attached.
  </Card>
</CardGroup>

## Today versus the full loop

<Note>
  The first release runs the read-only slice of this loop: perceive, retrieve,
  answer, with citations, and no acting step. The propose, approve, and act
  stages are how Smaya grows into a co-pilot on the same foundation. See [Meet
  Smaya](/smaya/overview) for the three tiers.
</Note>

## Guardrails on every turn

<CardGroup cols={2}>
  <Card title="Scope-lock" icon="lock">
    Answers are bounded to the record on screen and your organization's data, enforced at retrieval, not left to the prompt.
  </Card>

  <Card title="Citation-required" icon="quote-left">
    No data claim ships without a source. An uncited or malformed answer is
    blocked, not surfaced.
  </Card>

  <Card title="Injection defense" icon="shield-halved">
    Retrieved documents and on-screen state are treated as data, never as
    instructions. Content cannot escalate what Smaya is allowed to do.
  </Card>

  <Card title="Audience and privacy redaction" icon="user-shield">
    Every response is filtered by the viewer's role. Sensitive classes never reach a role that should not see them.
  </Card>
</CardGroup>

## What you can see

Every answer carries its citations. When Smaya acts, in the stages that add acting, you see the plan it followed, each proposed action, and the approval record for anything that changed data. That trace is both the explanation for the user and the record for a compliance reviewer.

## FAQs

<AccordionGroup>
  <Accordion title="Is the loop free to do whatever the model decides?">
    No. The loop is goal-bounded and runs in controlled steps. It ends at an evaluated decision, not on the model's say-so, and a hard step ceiling forces a handoff to a person rather than spinning.
  </Accordion>

  <Accordion title="What happens to a half-finished action if something fails?">
    Nothing is left half-done. A failed run stops safely with the state unchanged,
    rather than applying a partial change.
  </Accordion>

  <Accordion title="Does the acting loop run today?">
    Smaya hasn't shipped yet. Not even in the first release — that release runs
    only the read-only path: perceive, retrieve, and answer. The acting stages are
    further out on the roadmap and add the propose, approve, and act steps.
  </Accordion>

  <Accordion title="Can retrieved content trick Smaya into doing something?">
    No. Retrieved text and on-screen state are treated strictly as data. They cannot change what Smaya is permitted to do, which is enforced as a zero-tolerance control.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Meet Smaya" icon="compass" href="/smaya/overview">
    What Smaya is, and the capability stages.
  </Card>

  <Card title="Human Oversight" icon="user-check" href="/smaya/oversight">
    The approval gate and the control model in full.
  </Card>
</CardGroup>
