Nous.Tools.BraveSearch (nous v0.13.3)

View Source

Built-in tool for web search using Brave Search API.

Brave Search provides high-quality web search results with privacy focus.

Setup

You need a Brave Search API key to use this tool:

  1. Get your API key from https://brave.com/search/api/

  2. Set the environment variable:

    export BRAVE_API_KEY="your-api-key-here"

Or configure in your application:

config :nous,
  brave_api_key: System.get_env("BRAVE_API_KEY")

Rate Limits

  • Free Plan: 1 query/second, up to 2,000 queries/month
  • Base AI Plan: Up to 20 queries/second, 20M queries/month
  • Pro AI Plan: Up to 50 queries/second, unlimited monthly queries

Usage

agent = Nous.new("lmstudio:qwen3-vl-4b-thinking-mlx",
  tools: [&BraveSearch.web_search/2]
)

{:ok, result} = Nous.run(agent, "What's the latest news about AI?")

The AI will automatically search the web when it needs current information.

Summary

Functions

Search for news using Brave Search API.

Search the web using Brave Search API.

Functions

news_search(ctx, args)

Search for news using Brave Search API.

Arguments

  • query: The search query (required)
  • count: Number of results to return (default: 5, max: 20)
  • country: Country code for localized results
  • search_lang: Language of search

web_search(ctx, args)

Search the web using Brave Search API.

Arguments

  • query: The search query (required)
  • count: Number of results to return (default: 5, max: 20)
  • country: Country code for localized results (e.g., "US", "GB", "DE")
  • search_lang: Language of search (e.g., "en", "es", "fr")
  • safesearch: "off", "moderate", or "strict" (default: "moderate")

Returns

A map containing:

  • query: The search query used
  • results: List of search results with title, url, description
  • result_count: Number of results returned
  • success: Whether the search succeeded