---
sidebar:
  hidden: true
title: roboto.ai.core.context
---
## Module Contents

### AnalysisScope

```python
class roboto.ai.core.context.AnalysisScope(/, **data: Any)
```

`from roboto.ai.agent_thread import AnalysisScope`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/context.py#L92-L127)

Bases: `pydantic.BaseModel`

The slice of data an agent is expected to analyze.

An `AnalysisScope` is delivered to every `AgentTool` invocation on the server side. Individual tools opt in to honoring the scope as they are adopted; this SDK type carries the configuration, it does not itself enforce anything. Fields set to `None` are unconstrained on that dimension; an `AnalysisScope` with every field `None` is equivalent to no scope at all.

**Parameters**

- **data** (`Any`)

**Attributes**

- **AnalysisScope.end_time** (`int | None`) = `None`: Upper bound (inclusive) of the analysis window, expressed as nanoseconds since the Unix epoch.
- **AnalysisScope.start_time** (`int | None`) = `None`: Lower bound (inclusive) of the analysis window, expressed as nanoseconds since the Unix epoch.

#### AnalysisScope.merge()

```python
def merge(override: AnalysisScope) -> AnalysisScope
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/context.py#L115-L127)

Zipper-merge `override` onto this scope, dimension by dimension.

For each field, the `override` value wins when it is set (not `None`); otherwise this scope's value carries through. Used to reconcile an invoke-time scope (`override`) against an authored template scope (`self`): a launch can override individual dimensions while inheriting the rest.

**Parameters**

- **override** (`AnalysisScope`)

**Returns**

- `AnalysisScope`

### ClientViewingContext

```python
class roboto.ai.core.context.ClientViewingContext(/, **data: Any)
```

`from roboto.ai.core import ClientViewingContext`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/context.py#L12-L89)

Bases: `pydantic.BaseModel`

What the Roboto client (e.g. the Web UI) is currently viewing when the user composed a message.

Passed to the agent as implicit context for resolving deictic references — "this dataset", "those files", "the visualizer state I'm looking at" — that the user would otherwise have to spell out. This type is purely informational; it is not enforced and never gates tool authorization.

Distinct from:

- [`AnalysisScope`](/reference/python-sdk/roboto/ai/core/context#roboto.ai.core.context.AnalysisScope), which is a hard analysis window honored by individual tools on the server side.
- [`AgentGoal`](/reference/python-sdk/roboto/ai/goals/types#roboto.ai.goals.types.AgentGoal), which declares typed outcomes the agent runner must drive the turn to satisfy.

The corresponding wire-format field is `client_context` (with a one-release `context` alias for migration).

**Parameters**

- **data** (`Any`)

**Attributes**

- **ClientViewingContext.collection_ids** (`list[str]`) = `None`: IDs of collections the user is currently viewing or has selected.

- **ClientViewingContext.dataset_ids** (`list[str]`) = `None`: IDs of datasets the user is currently viewing or has selected.

- **ClientViewingContext.device_ids** (`list[str]`) = `None`: IDs of devices the user is currently viewing or has selected.

  Device IDs are user-chosen rather than minted by Roboto, so unlike the other fields here a value may look like anything at all.

- **ClientViewingContext.display_time_anchor_label** (`str | None`) = `None`: What the client shows the user as the name of that t=0 — "Start of workspace", or a picked timestamp rendered as local time.

  Informational, like every field here: it lets the agent name the instant an offset is counted from, rather than leaving the reader to guess. `None` whenever `display_time_anchor_ns` is `None`.

- **ClientViewingContext.display_time_anchor_ns** (`int | None`) = `None`: Epoch nanoseconds the client renders as t=0, set only while the user is reading timestamps as an elapsed count from that instant, and `None` otherwise.

  Informational, like every field here: it lets the agent resolve a bare relative time the user types ("around 65 s") to an absolute instant, and the agent still reports absolute nanoseconds back.

- **ClientViewingContext.file_ids** (`list[str]`) = `None`: IDs of files the user is currently viewing or has selected.

- **ClientViewingContext.misc_context** (`dict[str, Any] | None`) = `None`: Miscellaneous client-supplied context that doesn't fit the typed fields above. Use sparingly; prefer adding a typed field when a recurring shape emerges.

- **ClientViewingContext.table_state** (`dict[str, Any] | None`) = `None`: The resource table on screen, when the user composed the message from one: its `target` (`datasets`, `files`, ...) and its live `definition` -- the same shape a View stores: RoboQL text or filter controls, plus visible columns, sort, and page size.

  Sent whether or not a View is loaded, so the agent can describe ad-hoc filters and so "save what I'm looking at as a View" names something concrete. Informational, like every field here.

- **ClientViewingContext.view_ids** (`list[str]`) = `None`: IDs of Views -- saved, shareable searches over one resource type -- applied to a resource table the user is looking at.

  Informational, like every field here: it lets the agent resolve "this View" without the user naming it, and the agent still reads the View through its own tools.

- **ClientViewingContext.visualizer_state** (`dict[str, Any] | None`) = `None`: State of the visualizer, when the user composed the message from the visualizer view. A relatively opaque JSON blob.
