A3S Search
Overview
A3S Search is an embeddable meta search engine library. It aggregates results from multiple search engines, deduplicates them, and ranks them using a consensus-based scoring algorithm.
Basic Usage
use ;
async
Features
- Multi-Engine Search: Aggregate results from multiple engines in parallel
- 9 Built-in Engines: DuckDuckGo, Brave, Bing, Wikipedia, Sogou, 360, Google, Baidu, Bing China
- Result Deduplication: Merge duplicate results based on normalized URLs
- Consensus Ranking: Results found by multiple engines rank higher
- Async-First: Built on Tokio for high-performance concurrent searches
- Timeout Handling: Per-engine timeout with graceful degradation
- Extensible: Add custom engines via the
Enginetrait - Dynamic Proxy Pool: IP rotation with pluggable
ProxyProvidertrait - Health Monitor: Automatic engine suspension after repeated failures
- HCL Configuration: Load settings from
.hclconfig files - Headless Browser: Chrome and Lightpanda backends for JS-rendered engines
- Auto-Download: Automatically detects or downloads browsers
- Native SDKs: TypeScript (NAPI) and Python (PyO3) bindings
Quick Start
Installation
[]
= "0.9"
= { = "1", = ["full"] }
Feature Flags
| Feature | Description |
|---|---|
chromiumoxide |
Shared CDP client (required by chromium/lightpanda) |
chromium |
Chrome/Chromium headless backend |
lightpanda |
Lightpanda headless backend (Linux/macOS) |
all-headless |
Enable both chromium and lightpanda |
# Default (no headless engines)
= "0.9"
# With Chrome/Chromium backend
= { = "0.9", = ["chromium"] }
# With Lightpanda backend
= { = "0.9", = ["lightpanda"] }
# With both backends
= { = "0.9", = ["all-headless"] }
Basic Search
use ;
let mut search = new;
search.add_engine;
let query = new;
let results = search.search.await?;
println!;
Headless Browser Mode
Enable headless browser for JS-rendered engines (Google, Baidu, Bing China):
use ;
use ;
use ;
use Arc;
async
CLI Usage
Installation
Homebrew (macOS):
Cargo:
Commands
# Basic search
# With specific engines
# Limit results
# JSON output
# Use proxy
# List available engines
Available Engines
| Shortcut | Engine | Type |
|---|---|---|
ddg |
DuckDuckGo | HTTP |
brave |
Brave Search | HTTP |
bing |
Bing International | HTTP |
wiki |
Wikipedia | HTTP |
sogou |
搜狗搜索 | HTTP |
360 |
360搜索 | HTTP |
g |
Google Search | Headless |
baidu |
百度搜索 | Headless |
bing_cn |
必应中国 | Headless |
SDKs
Native bindings for TypeScript and Python, powered by NAPI-RS and PyO3.
TypeScript (Node.js)
import { A3SSearch } from '@a3s-lab/search';
const search = new A3SSearch();
// Simple search
const response = await search.search('rust programming');
// With options
const response = await search.search('rust programming', {
engines: ['ddg', 'wiki', 'brave', 'bing'],
limit: 5,
timeout: 15,
proxy: 'http://127.0.0.1:8080',
});
for (const r of response.results) {
console.log(`${r.title}: ${r.url}`);
}
Python
=
# Simple search
=
# With options
=
SDK Types
Both SDKs expose headless browser configuration types:
TypeScript:
type BrowserBackend = "Chrome" | "Lightpanda"
interface HeadlessConfig {
backend: BrowserBackend
browserPath?: string
maxTabs?: number
launchArgs?: string[]
}
interface SearchConfig {
timeout: number
engines: Record<string, EngineConfig>
headless?: HeadlessConfig
}
Python:
Architecture
System Overview
┌─────────────────────────────────────────────────────┐
│ A3S Search │
├─────────────────────────────────────────────────────┤
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Rust │ │ Python │ │ Node.js │ │
│ │ Core │◄───┤ SDK │ │ SDK │ │
│ └────┬────┘ └─────────┘ └─────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────┐ │
│ │ Search Orchestrator │ │
│ │ • Parallel execution (tokio::join_all) │ │
│ │ • Timeout handling │ │
│ │ • Health monitoring │ │
│ └─────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────┐ │
│ │ Engine Layer │ │
│ │ HTTP Engines: ddg, brave, bing, wiki, ... │ │
│ │ Headless Engines: google, baidu, bing_cn │ │
│ └─────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────┐ │
│ │ PageFetcher Layer │ │
│ │ HttpFetcher │ PooledHttpFetcher │ Browser │ │
│ └─────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘
Core Components
| Component | Description |
|---|---|
Search |
Main orchestrator for parallel engine execution |
Engine trait |
Abstract interface for search engines |
PageFetcher trait |
Abstract interface for page fetching |
Aggregator |
URL deduplication and consensus ranking |
BrowserPool |
Shared headless browser process management |
ProxyPool |
Proxy rotation with auto-refresh |
API Reference
Search
BrowserBackend
HeadlessConfig
SearchConfig (HCL)
timeout = 10
health {
max_failures = 5
suspend_seconds = 120
}
headless {
backend = "Chrome" # or "Lightpanda"
browser_path = null # auto-detect
max_tabs = 4
launch_args = []
}
engine "ddg" {
enabled = true
weight = 1.0
}
engine "google" {
enabled = true
weight = 1.0
}
Engine Trait
Development
Build Commands
# Build default (all features)
# Build without headless
# Run tests
# Format
# Clippy
Release
Releases are published to GitHub Releases with:
- CLI binaries (darwin-arm64, darwin-x86_64, linux-arm64, linux-x86_64)
- Python wheels (Python 3.9-3.13, many platforms)
- Node.js bindings (.node for multiple platforms)
# Create and push tag to trigger release
A3S Ecosystem
A3S Search is part of the A3S ecosystem:
a3s-box - MicroVM sandbox
a3s-code - AI coding agent
a3s-lane - Queue
a3s-memory - Memory
a3s-search - Search
License
MIT