# `WardrikBrave`

Web search for agents, through Brave's LLM Context API.

A search returns the relevant passages of each page, not a list of links, so one call is usually
enough to ground an answer. Use it when agents need facts newer than their training, or facts
they'd otherwise guess at.

    children = [{WardrikBrave, name: MyApp.Brave, api_key: System.fetch_env!("BRAVE_API_KEY")}]

    WardrikCore.start_agent(
      agent_id: "acme/triage",
      model: "anthropic:claude-haiku-4-5",
      capabilities: [{WardrikBrave, brave: MyApp.Brave}]
    )

If every agent's keys hold `BRAVE_API_KEY`, nothing needs starting. Give the settings inline:

    capabilities: [{WardrikBrave, []}]

## Keys

Each search takes `BRAVE_API_KEY` from the agent's `WardrikCore.Keys` first, then falls back to
`:api_key`. Neither is kept in the store with the agent's state. Without a key, the search
returns an error saying so.

## Options

Given to `start_link/1`, or inline in place of `:brave`:

  * `:api_key` - the key to search with where the agent's keys hold none.
  * `:req_options` - merged into every request. `[]` unless set.
  * `:base_url` - `"https://api.search.brave.com"` unless set.

The tool is marked `open_world`, since the pages it finds could be written by anyone.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `settings`

```elixir
@spec settings(atom() | map()) :: map()
```

Returns the settings started under `brave`, or `brave` itself if it's a map.

Raises `ArgumentError` if nothing is started under `brave`.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Starts a process that holds the search settings under `:name`.

Takes `:name` (required) and the options in the module docs.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
