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

# Run Ask Oqo as a custom agent

> Run Ask Oqo in experiments as a custom agent from a CLI download, with a personal API key as its sign-in, and measure how well it answers.

> [!NOTE]
>
> Custom agents are in private beta. Email [support@oqoqo.ai](mailto:support@oqoqo.ai) to enable them for your organization.

To measure how well Ask Oqo answers questions about your projects, add it as a [custom agent](https://docs.oqoqo.ai/setup/custom-agents.md) and score its replies with tasks and rubrics, as you would for any agent.

## Prerequisites

* [Ask Oqo](https://docs.oqoqo.ai/operate/ask-oqo.md) works for you on the **Ask Oqo** page: it has a model under **Oqoqo AI features**, and you connected it to your projects.
* The ID of the project that Ask Oqo should use, from `oqoqo projects current` or the dashboard URL (`/projects/prj_…`).

> [!WARNING]
>
> The API key acts as you in every run of this agent, including runs that a teammate launches. In those runs, Ask Oqo can read and change your projects, as it can on the **Ask Oqo** page, and its chats appear in your Ask Oqo history.

## Steps

**1. Create a personal API key**

Nobody can sign in through a browser during a run, so the CLI signs in with a personal API key from the `OQOQO_API_KEY` environment variable. In [**Profile → API keys**](https://docs.oqoqo.ai/setup/profile.md#api-keys), create a key and copy it.

**2. Find the Linux x64 release of the CLI**

Each run downloads the Oqoqo CLI, which serves Ask Oqo over the Agent Client Protocol (ACP) with `oqoqo acp ask-oqo`. Runs use its Linux x64 build, `oqoqo-linux-x64`. To find that build's URL and SHA-256:

1. Open `https://oqoqo.ai/install` in a browser. The installer script names the release location of the `stable` channel.
2. Open the release manifest, `latest.json`, at that location.
3. Copy the `url` and `sha256` of the `linux-x64` entry.

The URL names one release, so runs keep that exact build, and the CLI doesn't update itself while `OQOQO_API_KEY` is set. For a newer build, enter a new `url` and `sha256` in the agent's settings, then save.

**3. Create the custom agent**

In **Manage → Agents**, select **Connect custom agent** and enter:

| Field | Value |
| - | - |
| Name (the page title, **Name this agent**) | `Ask Oqo` |
| Install | **Download** |
| Download URL | The `url` of the `linux-x64` entry |
| SHA-256 | The `sha256` of the `linux-x64` entry |
| Command | `oqoqo` |
| Arguments | `acp ask-oqo --project-id <project-id>` |

Under **Environment variables**, add `OQOQO_API_KEY` with your key as its value, then select **Connect agent**. Oqoqo saves the download, a binary rather than an archive, as `oqoqo` and runs it with the arguments.

**4. Test the agent**

Select **Test agent**. The test asks Ask Oqo for its name and what it can help with, and the status updates on the page. When it answers, the status is **Ready** and **Models** lists the models it offers: turn on the ones to compare.

If the status is **Needs attention**, match the error:

| Error | Fix |
| - | - |
| The key isn't valid, or you revoked it | Create a new key and set it as `OQOQO_API_KEY`. |
| Ask Oqo isn't connected for you | Connect it on the page the error names, then test again. |
| The download doesn't match its SHA-256 | Copy the `url` and `sha256` from the same `linux-x64` entry. |
| This version of the CLI can't run this command | The pinned build is [too old](https://docs.oqoqo.ai/operate/cli.md#when-oqoqo-refuses-an-old-release). Enter a current `linux-x64` `url` and `sha256` in **Download URL** and **SHA-256**, save, and test again. |

**5. Write tasks about your projects**

Ask Oqo calls its tools through your Oqoqo account, not on the run's machine, so it can't use the run's files, services, or a treatment's tools. Write [tasks](https://docs.oqoqo.ai/experiments/tasks.md) that ask about your projects instead, such as "How many tasks does this project have?", with a rubric that judges the reply.

**6. Run an experiment**

Select **New experiment**, and choose your tasks, **Ask Oqo** with the models to compare, and the **Raw Agent** treatment (no tools), because a treatment's tools don't reach Ask Oqo. Then select [**Launch**](https://docs.oqoqo.ai/experiments/launch.md).

## Interpret the results

On the experiment's [**Matrix**](https://docs.oqoqo.ai/evaluation/results.md#matrix) with the **Evals** metric, each cell shows the share of trials in which Ask Oqo's reply passed the rubric, for each task and model. Switch the metric to **Cost**, **Tokens**, or **Duration** to compare what each model costs.

| What you see | What to do |
| - | - |
| A model passes most tasks | Compare its cost and duration with the other models before you choose it for Ask Oqo under **Oqoqo AI features**. |
| A task fails for every model | Read a run's **Traces** to see which Oqoqo tools Ask Oqo called, and check the rubric against the correct answer. |
| Runs fail before Ask Oqo answers | Read the run's [frictions](https://docs.oqoqo.ai/evaluation/frictions.md). A failed custom agent step shows under **Custom agent** in **Where to fix**. |

## From the CLI and the plugin

Only the agent's API key stays in the dashboard. To create the same agent with the CLI, run:

```bash theme={null}
oqoqo project ai apply --operation '{"action":"create_custom_agent","name":"Ask Oqo","source":{"kind":"manual","install":{"kind":"download","url":"<linux-x64 url>","sha256":"<linux-x64 sha256>","command":"oqoqo"},"args":"acp ask-oqo --project-id <project-id>"},"env":["OQOQO_API_KEY"]}' --output json
```

The result gives the agent key and the dashboard link where you set `OQOQO_API_KEY`. Then test the agent:

```bash theme={null}
oqoqo project ai test-agent <agent-key>
```

See [`oqoqo project ai apply`](https://docs.oqoqo.ai/cli/agents-and-models#oqoqo-project-ai-apply) and [`oqoqo project ai test-agent`](https://docs.oqoqo.ai/cli/agents-and-models#oqoqo-project-ai-test-agent). From the plugin, send the same operation to **Create custom agents and change agents, models, and Oqoqo AI settings** ([`manage_project_ai`](https://docs.oqoqo.ai/mcp-server/tools#manage_project_ai)), then call **Test a custom agent** ([`test_custom_agent`](https://docs.oqoqo.ai/mcp-server/tools#test_custom_agent)).

## Other ways to run it

* **Run your own ACP agent.** Follow the same steps with your agent's npm package, Python package, download, or ACP Registry entry. See [Custom agents](https://docs.oqoqo.ai/setup/custom-agents.md).
* **Track the answers over time.** Schedule the experiment to see whether the answers change as your projects do. See [Track results over time](https://docs.oqoqo.ai/guides/track-agents-over-time.md).

## Next steps

> [card] [Custom agents](https://docs.oqoqo.ai/setup/custom-agents.md)
>
> Connect and test your own ACP agent.

> [card] [Ask Oqo](https://docs.oqoqo.ai/operate/ask-oqo.md)
>
> Choose Ask Oqo's model and connect your projects.

> [card] [Use an API key](https://docs.oqoqo.ai/operate/cli.md#use-an-api-key)
>
> Sign in to the CLI with a personal API key.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.