# How It Works

ToggleX uses a three-stage AI pipeline that runs in the background as you browse.

#### Stage 1 — Understanding your goal

When you're working, ToggleX analyzes your current interactions — what you're clicking, what's on screen, what you did a moment ago — to predict what you're trying to accomplish. This prediction is what allows ToggleX to offer relevant context rather than generic suggestions.

#### Stage 2 — Identifying relevant elements

A lightweight AI model scans the current webpage and identifies which elements are most relevant to your predicted goal. It scores and ranks page elements based on how likely they are to be useful, narrowing down from hundreds of elements to the handful that matter.

#### Stage 3 — Predicting the next step

A more powerful AI model takes those top candidates and predicts what you're likely to do next — whether that's the next document you'll need, the next field to focus on, or the next logical step in your workflow. ToggleX surfaces this prediction so you can act on it or move on.

This three-stage approach keeps ToggleX fast (the lightweight model handles the heavy lifting) and accurate (the larger model only focuses on what matters).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://toggle.gitbook.io/togglex/how-it-works.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
