> For the complete documentation index, see [llms.txt](https://docs.unbrowse.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unbrowse.ai/for-agents/how-an-agent-uses-unbrowse.md).

# How an Agent Uses Unbrowse

This page is the operating model for an AI agent that has Unbrowse available.

The current mental model is one step: **get the result**. The agent describes the internet result it needs — intent, optional URL, optional params, and explicit approval for writes — and Unbrowse decides how to satisfy it. That may mean a direct document fetch, a shared contract in the route graph, a standard adapter, a local-auth browser capture, HAR inspection, or indexing a newly discovered route for the next call.

The agent should not choose between `resolve`, `execute`, `go`, `snap`, `fetch`, HAR, or cookies for ordinary work. Those are implementation layers under the typed hole.

The public contract is inspectable:

```bash
unbrowse contract surface
```

It exposes five client-fillable holes:

* `intent`
* `wallet_proof`
* `approval`
* `local_capability_result`
* `typed_pointer`

In shell or code, the same surface is:

```bash
unbrowse "top stories with point counts"
unbrowse "top stories with point counts" --url "https://news.ycombinator.com"
```

```ts
import { createHole } from "unbrowse/sdk";

const hole = createHole();
const result = await hole.fill({
  intent: "top stories on Hacker News with point counts",
  url: "https://news.ycombinator.com",
});
```

Use the old route view only when debugging or when a host cannot call the hole directly. In that compatibility path, resolve gathers candidates and execute replays one chosen route. It is not the preferred surface for new agents.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.unbrowse.ai/for-agents/how-an-agent-uses-unbrowse.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
