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

# Core constructs

> The .voss language constructs for confidence, context, budgets, routing, agents, memory, tools, and errors.

The language exists because AI workflows repeat the same control patterns.

## Confidence

`probable<T>` represents a value with confidence metadata.

```voss theme={"theme":"github-dark"}
let intent: probable<string> = classify(message)

if intent @ 0.80 {
  return intent.value
}

return "unknown"
```

## Context budgets

`ctx` makes token windows explicit.

```voss theme={"theme":"github-dark"}
ctx (budget: 3000 tokens) {
  let answer = ask(model, prompt)
  return answer
}
```

## Budget fallback

`within budget` expresses controlled degradation.

```voss theme={"theme":"github-dark"}
within budget(tokens: 4000, latency: 10s) {
  return deep_research(topic)
} fallback {
  return quick_summary(topic)
}
```

## Semantic routing

`match similar` routes by meaning rather than keywords.

```voss theme={"theme":"github-dark"}
match message {
  similar("refund request") -> route_refund(message)
  similar("technical support") -> route_support(message)
  _ -> route_generic(message)
}
```

## Agents

Agent primitives express lifecycle directly.

```voss theme={"theme":"github-dark"}
agent Researcher(topic: string) -> Finding {
  return search_and_summarize(topic)
}

let handles = topics.map(t => spawn Researcher(t))
let findings = gather(handles)
```

## Memory, tools, and errors

Voss also includes memory primitives, `@tool` definitions, prompt classes, `try/catch`, and `use` imports.

## Coordination constructs

The same language scales from one agent to a whole team. These constructs declare an [engineering organization](/orchestration/overview) — roles, culture, gates, and memory — as compiler-checked config.

```voss theme={"theme":"github-dark"}
principles {
  diff: "Smallest diff that solves it"
  evidence: "No claim without evidence"
}

team "default" {
  ceiling { budget: 120000 tokens; scope: ["src/**", "tests/**"] }

  role backend {
    model: "cheap"
    mode:  "edit"
    scope: ["src/server/**"]
    tools: ["fs", "code", "test", "git"]
    budget: 24000 tokens
  }
}

gate done {
  require tests_passed
  require independent_review
  require evidence_refs
}

memory {
  decisions: ".voss/decisions"
  sessions:  ".voss/sessions"
  semantic:  ".voss-cache/semantic"
}
```

| Construct         | Purpose                                                                                     |
| ----------------- | ------------------------------------------------------------------------------------------- |
| `principles { }`  | Engineering culture injected into every agent — see [Principles](/orchestration/principles) |
| `team "name" { }` | The role roster, scope, budget, and tools — see [Team config](/orchestration/team-config)   |
| `gate done { }`   | What must hold before a card ships — tests, independent review, evidence                    |
| `memory { }`      | Where decisions, sessions, and semantic memory persist                                      |

<Note>
  The goal is AI workflow control and team coordination, not Python syntax parity.
</Note>
