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

# search

> Search for companies and people using natural language

Search Landbase's database using a natural language query. Returns a `run_id`, `session_id`, `dataset_id`, and a `content` field with your results.

## search

Submit a natural language search query for companies and contacts.

**Usage**

```bash theme={null}
landbase-cli search <query> [flags]
```

<ParamField path="query" type="string" required>
  Natural language prompt describing the companies or people you want to find.
</ParamField>

**Flags**

| Flag                  | Default                | Description                                                                                                                    |
| --------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `--download[=<path>]` | `./results.jsonl`      | Write results to a file. Supports `.jsonl`, `.jsonl.gz`, `.csv`, `.parquet`                                                    |
| `--session=<label>`   | —                      | Continue a prior conversation with a follow-up prompt. Accepts a session label or session ID                                   |
| `--agent=<name>`      | `fast_dataset_creator` | Select the search agent. Use `advanced_dataset_creator` for custom SQL, aggregations, exact filters, and custom output columns |
| `--format=<format>`   | `json`                 | Output format: `json` or `table`                                                                                               |
| `--limit=<n>`         | —                      | Maximum number of results to return                                                                                            |
| `--no-update-check`   | —                      | Skip the daily update check                                                                                                    |
| `--verbose`           | —                      | Print request/response details to stderr                                                                                       |

## Advanced Dataset Creator

The default search agent is `fast_dataset_creator`, which is the fastest path for everyday natural-language audience builds. Use `advanced_dataset_creator` when the audience needs custom logic that is hard to express as fixed filters, such as custom SQL, aggregations, exact filtering, ratios, or output columns.

Advanced Dataset Creator uses a two-step confirmation flow:

1. Send the request with `--agent=advanced_dataset_creator` and a `--session=<label>`.
2. Review the proposed query in the response.
3. Confirm in the same session with a follow-up such as `"yes, run it"`.

**Examples**

```bash theme={null}
# Find companies
landbase-cli search "find B2B SaaS companies in San Francisco"

# Save results to a file
landbase-cli search "find B2B SaaS companies in San Francisco" --download=results.jsonl

# Follow-up in the same session
landbase-cli search "only show ones with 50+ employees" --session=sf-saas

# Limit results and format as table
landbase-cli search "find AI engineers in London" --limit=20 --format=table

# Use Advanced Dataset Creator for a precise custom query
landbase-cli search --agent=advanced_dataset_creator --session=sales-ratio \
  "Find companies where the AE-to-SDR ratio is between 1.5 and 3.0. Return company name, website, AE count, SDR count, and ratio."
landbase-cli search --agent=advanced_dataset_creator --session=sales-ratio "yes, run it" --download=sales-ratio.jsonl

# Use Advanced Dataset Creator for aggregations
landbase-cli search --agent=advanced_dataset_creator --session=state-counts \
  "How many companies are in each US state, sorted by count? Return the top 10."
landbase-cli search --agent=advanced_dataset_creator --session=state-counts "yes, run it"
```
