---
name: desearch-setup
description: Set up Desearch (search, Extract, X data) for this project
user-invocable: true
allowed-tools: Bash(curl:*), Bash(npm:*), Bash(pip:*), Bash(uv:*)
---

# Desearch setup

Wire Desearch into this project so the agent can search the web, extract page content, and read X data,
and cite what it finds.

## Step 1 — key

Ask the user for their key from https://console.desearch.ai and export it:

```bash
export DESEARCH_API_KEY=<key>
```

## Step 2 — verify

```bash
curl -s https://api.desearch.ai/search \
  -H "Authorization: $DESEARCH_API_KEY" \
  -H "content-type: application/json" \
  -d '{"query":"latest open source model releases","summary":true}'
```

A 200 with a `results` array means it is working. With `"summary": true`, `summary.text` is a short answer and `summary.citations` lists the cited pages. A 401 means the key is wrong.

## Step 3 — SDK, if the project has a package manager

```bash
pip install desearch-py      # python
npm install desearch-js      # javascript
```

## Reference

- Endpoints and schemas: https://www.desearch.ai/docs/api-reference
- OpenAPI: https://api.desearch.ai/openapi.json
- Full context for agents: https://www.desearch.ai/llms-full.txt

## Rules

- Always pass through the source URLs Desearch returns; never present a result without its link.
- Do not hardcode the key into source files. Read it from the environment.
