Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .changeset/web-search-initial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
'@link-assistant/web-search': minor
---

Add web search microservice with multi-provider aggregation

**Features:**

- Multi-provider search aggregation (Google, DuckDuckGo, Bing)
- Multiple merge strategies: Reciprocal Rank Fusion (RRF), weighted scoring, interleaving
- Configurable provider weights for reranking
- URL normalization for proper deduplication across providers
- API-first design with fallback to web scraping
- browser-commander integration for direct browser search testing

**JavaScript Library:**

- Search provider interfaces with API support and scraping fallback
- Result merger with RRF, weighted, and interleave strategies
- WebSearchEngine class for multi-provider search
- Express.js REST API server
- CLI tool for command-line usage

**Rust Library:**

- Async search providers using reqwest and scraper
- Result merger with same strategies as JavaScript version
- WebSearchEngine with async search
- Axum REST API server
- CLI tool with clap

**REST API Endpoints:**

- GET /search?q=<query> - Search all providers
- POST /search - Search with options in body
- GET /search/:provider?q=<query> - Search single provider
- GET /providers - List available providers
- GET /health - Health check

**CI/CD:**

- Added rust.yml workflow for Rust CI (lint, test matrix, build)
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ jobs:

- name: Run tests (Deno)
if: matrix.runtime == 'deno'
run: deno test --allow-read
run: deno test --allow-read --allow-env

# Release - only runs on main after tests pass (for push events)
release:
Expand Down
117 changes: 117 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Rust CI

on:
push:
branches:
- main
paths:
- 'rust/**'
- '.github/workflows/rust.yml'
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'rust/**'
- '.github/workflows/rust.yml'

concurrency:
group: rust-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings

defaults:
run:
working-directory: rust

jobs:
# === LINT AND FORMAT CHECK ===
lint:
name: Lint and Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Check formatting
run: cargo fmt --all -- --check

- name: Run Clippy
run: cargo clippy --all-targets --all-features

# === TEST ===
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: [lint]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Run tests
run: cargo test --all-features --verbose

- name: Run doc tests
run: cargo test --doc --verbose

# === BUILD ===
build:
name: Build Package
runs-on: ubuntu-latest
needs: [lint, test]
if: always() && !cancelled() && needs.lint.result == 'success' && needs.test.result == 'success'
steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Build release
run: cargo build --release --verbose

- name: Check package
run: cargo package --list
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ dist
package-lock.json
.eslintcache
CLAUDE.md
# Rust build artifacts
rust/target
# Case study raw data files (downloaded from external sources)
docs/case-studies/*/data/
Loading