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

# The Computational Model

> Value → Function → Process → Agent, and how deterministic and probabilistic computation coexist.

## The hierarchy

Sense's design starts from a small hierarchy of computational units, each
one strictly more capable — and more autonomous — than the last:

<Frame>
  ```txt theme={null}
  Value
    ↓
  Function
    ↓
  Process
    ↓
  Agent
  ```
</Frame>

### Function — bounded computation

```txt theme={null}
input → computation → output
```

A function has no goal of its own and no independent lifecycle. It runs
when called, produces a result, and is done. This is where every
mainstream language already lives, and it's where Sense's deterministic
core lives too — see [Functions](/language/functions).

### Process — has a lifecycle, not necessarily a goal

```txt theme={null}
created → running → paused/resumed → terminated
```

A process is independently executing — it persists across time in a way a
function call doesn't. `session` is Sense's first taste of this: an
execution/context boundary rather than a plain function call. See
[Sessions](/ai-native/sessions).

### Agent — pursues something

An agent is an autonomous process that:

* pursues an objective
* reasons over its own state
* selects actions
* operates within capabilities and policies
* observes outcomes and updates its state

This is `agent` in Sense — a genuine runtime entity with identity, state,
and (as of the current implementation) a real pause/resume lifecycle. See
[Agents](/ai-native/agents).

<Info>
  These are semantic foundations, not a claim that the final syntax will
  always look this way. The hierarchy needed to be understood before syntax
  was locked in, which is why Sense's actual keywords (`fn`-less function
  declarations, `session`, `agent`) came late in the design process rather
  than first.
</Info>

## Deterministic and probabilistic computation

The other axis of Sense's model is *how certain a value is*. Traditional
languages have exactly one answer: everything is certain, because
everything is computed. Sense needs a second lane:

<Tabs>
  <Tab title="Deterministic">
    ```txt theme={null}
    Int
    String
    Bool
    Array
    Function
    ```

    Ordinary values, computed by ordinary code. What every language already
    has.
  </Tab>

  <Tab title="Probabilistic">
    ```txt theme={null}
    Answer<T>
    ```

    The result of `ask(...)`. Carries a `.value`, a
    `.confidence`, and a `.source` — see
    [Model, Ask & Answer](/ai-native/model-ask-answer). There is no
    implicit unwrapping: an `Answer<String>` is never silently usable
    wherever a `String` is expected.
  </Tab>
</Tabs>

The critical design rule here: **the language must not pretend
AI-generated results are deterministic.** It would be easy (and tempting,
for ergonomics) to let `ask(...)` just return a plain string. Sense
deliberately doesn't, because the entire point is to keep "I know this" and
"I inferred this with 50% confidence" visibly, structurally different —
forever, not just at the one call site where a programmer happened to
remember to check.

## A declarative future, not built today

Every example on this site is procedural — you write the steps:

```sns theme={null}
for user in users:
    send_email(user)
```

A more declarative style is possible in principle: a program states a
*desired outcome*, and the runtime constructs an execution plan itself to
reach it, respecting whatever constraints are declared alongside it. That
planner is **not implemented** (see [Roadmap](/roadmap)), deliberately:
building a fake one would mean pretending Sense has AI planning it
doesn't. Declaring a goal with no real planner to act on it would just be
a function call with extra ceremony — worth adding only once there's an
actual planner for it to mean something to.

## Continue

<CardGroup cols={2}>
  <Card title="Design order" icon="list-ol" href="/philosophy/design-order">
    Why syntax was decided *last*, and what that ordering protected against.
  </Card>

  <Card title="Model, Ask & Answer" icon="brain" href="/ai-native/model-ask-answer">
    The probabilistic half of the model, as it actually exists today.
  </Card>
</CardGroup>
