0.0
The project is in a healthy, maintained state
Searches the web via a local SearXNG instance and returns the results as clean numbered markdown. The capability layer (WebSearch.search); the native Ask::Tools::WebSearch agent tool is an optional integration that registers when ask-tools is present. Configure endpoint via SEARXNG_URL env var.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.25
~> 13.0
~> 6.0
~> 3.26
>= 0.1
 Project Readme

ask-web-search

Gem Version

A web search tool for the ask-rb ecosystem. It provides Ask::Tools::WebSearch, which searches the web via a local SearXNG instance and returns numbered markdown results for LLM consumption. It has no Rails dependencies; it depends only on ask-tools.

Prerequisites

A running SearXNG instance. The default is http://localhost:8888.

Start one with Docker:

docker run -d --name searxng -p 8888:8080 searxng/searxng

Or use the provided docker-compose.yml in the searxng directory of this repository:

Installation

gem "ask-web-search"

Configuration

Set the SEARXNG_URL environment variable to point to your SearXNG instance:

export SEARXNG_URL=http://localhost:8888

Defaults to http://localhost:8888.

Quick Start

require "ask/web_search"

tool = Ask::Tools::WebSearch.new
result = tool.execute(query: "ruby programming language")
puts result

Results are returned as a numbered markdown-like string:

1. Ruby - A Programmer's Best Friend
   https://www.ruby-lang.org
   Ruby is a dynamic, open-source programming language...

2. Ruby on Rails
   https://rubyonrails.org
   Rails is a web application framework...

If no results are found, returns "No results found.".

Full documentation

The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs. Core: Web Search covers ask-web-search in depth, including the ask-agent integration and the MCP server. API reference: https://ask-rb.github.io/ask-docs/reference/api.

Development

bundle install
bundle exec rake test

License

MIT