# Seltz Search — Pi Extension

A Pi coding agent extension that integrates [Seltz.ai](https://seltz.ai) for web-grounded search and answers.

## What is Seltz.ai?

Seltz is an AI search platform that provides a REST API for real-time web search and RAG-powered answers. It returns structured, context-engineered documents optimized for AI consumption — making it ideal for coding agents that need up-to-date information about APIs, libraries, documentation, pricing, and more.

## What This Extension Does

Registers two tools in Pi:

- **`seltz_search`** — Searches the web and returns structured documents with URLs, content, and publication dates.
- **`seltz_answer`** — Returns a direct, cited answer to a natural-language question using Seltz's RAG engine.

Together they give Pi the ability to look up current information during coding sessions without needing external browser access.

## Installation

### npm

```bash
pi install npm:pi-seltz-search
```

### Git

```bash
pi install git:codeberg.org/iobear/pi-seltz-search
```

### Local

```bash
pi install ./path/to/pi-seltz-search
```

### Quick test (one-off)

```bash
pi -e ./path/to/pi-seltz-search
```

## Quick Start

```bash
# Option 1: Environment variable
export SELTZ_API_KEY="your-api-key"

# Option 2: Global config file (recommended)
mkdir -p ~/.seltz
echo '{ "api_key": "sk-your-api-key" }' > ~/.seltz/config.json

# Then start pi
pi
```

Then just ask Pi a question about something current — it will know to use Seltz.

The extension resolves the API key in this order (first match wins): tool parameter → `SELTZ_API_KEY` env var → `~/.seltz/config.json` → `.seltz/config.json` (project-local).

## License

See the Seltz.ai [Terms of Use](https://seltz.ai/terms).
