惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Engineering at Meta
Engineering at Meta
Vercel News
Vercel News
Y
Y Combinator Blog
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
M
MIT News - Artificial intelligence
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
F
Fortinet All Blogs
博客园 - 司徒正美
I
InfoQ
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
U
Unit 42

Show HN

Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal). Release v0.1.2.1 · kouhxp/yapsnap GitHub - noopolis/moltnet: Self-hostable chat network for AI agents. Pre-built bridges for Claude Code, Codex, and the Claws. Rooms, DMs, history. No Slack bots, no Matrix, no glue code.
GitHub - search-router/simple-search: Open-source referen...
KolibriFly · 2026-05-28 · via Show HN

CI License: MIT Python Code style: Ruff Typed: mypy

An open-source reference / demo application built on top of the Search Router API. This repository is not the Search Router API itself, and it is not an MCP server — it is a self-contained metasearch service (FastAPI + Jinja UI) that shows how to integrate the API in a production-shaped app: pluggable backend adapters, deterministic mocks for keyless local dev, Redis caching, circuit breaker, RTL UI, and a small demo ads cabinet.

The hosted API lives at search-router.com. This repo is the recommended starting point if you want a working end-to-end example you can fork.

Home page, light theme Home page, dark theme

What this repo is — and isn't

Is:

  • A working reference UI + service on top of the Search Router API.
  • A template you can fork: drop in your own backend adapter, ship.
  • A keyless demo: docker compose up and you have a real-looking search UI backed by deterministic mocks.

Isn't:

Features

  • Use cases: grounding LLM answers with fresh web data, agent tool calls, and building search/RAG-adjacent UIs. The Search Router API returns titles, URLs, and snippets across multiple search engines; full-page Infocontexts are on the upstream roadmap.
  • Backend: Python 3.12+, FastAPI, Pydantic v2, httpx, defusedxml.
  • Frontend: Server-rendered Jinja2 with a small modern design system — light/dark, logical CSS properties, full RTL coverage for ar, he, fa, ur (and any other RTL tag you add).
  • Storage: Optional Redis cache; degrades to a NullCache when Redis is not configured.
  • No keys required: Missing credentials transparently swap real adapters for mock implementations, so docker compose up produces a fully working, beautiful demo out of the box.
  • Pluggable backends: Drop in your own provider via the search_service.backends entry point — no fork required.
  • Production-minded: Circuit breaker, structured JSON logging, security headers, CSRF, rate limiting, admin-token-gated health/introspection.
  • Demo ads cabinet: Included app/ads/ package (auction, auth, storage, throttling) illustrates how a monetization layer could plug into a search UI. It's a demo surface, not part of the Search Router API.

Quick start

git clone https://github.com/search-router/simple-search.git
cd simple-search
cp .env.example .env
docker compose up --build
# open http://localhost:8000/

To run without Docker:

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,redis]"
uvicorn app.main:app --reload
# open http://localhost:8000/

The home page works immediately (mock-backed). Set SEARCH_ROUTER_API_KEY in .env to switch the Search Router adapter to its real upstream.

Getting a Search Router API key

The bundled adapter calls the Search Router API at https://search-router.com/api/search (header X-API-Key). The API returns search results — titles, URLs, snippets, and image metadata — suitable for grounding LLMs and powering search UIs.

search-router.com gives you:

  • 2000 free credits to start.
  • When your balance drops below 500, top it up with another 2,000 credits for free — unlimited refills while the promotion is active.

To obtain a key:

  1. Sign up at https://search-router.com.

  2. Open your account dashboard and create an API key.

  3. Copy the key into your local .env:

    SEARCH_ROUTER_API_KEY=sr_live_xxxxxxxxxxxxxxxxxxxxxxxx
  4. Restart the app (docker compose up --build or uvicorn …). The /api/v1/backends endpoint will now report search_router as ready and queries will hit the real upstream.

Without a key, the adapter transparently falls back to the deterministic mock backend — you can develop and demo the UI without signing up.

Configuration

Configuration lives in .env (secrets and environment-level knobs) and config.yaml (declarative backend wiring, feature flags). See .env.example for the full list with comments.

Variable Required Default Purpose
APP_ENV no dev dev or prod; tightens defaults in prod.
APP_CONFIG_FILE no config.yaml Path to the declarative config file.
LOG_LEVEL no INFO Standard Python logging levels.
SEARCH_ROUTER_API_KEY no (empty) Real Search Router credentials — get one at search-router.com. Empty → adapter falls back to mock.
REDIS_URL no (empty) Optional cache. Empty → NullCache.
ADMIN_TOKEN prod (empty) Required to call /api/v1/health and /api/v1/backends.
SESSION_SECRET prod (empty) Signs ads-cabinet session cookies. Empty in dev → ephemeral per-process.

See docs/deployment.md for the hardening checklist before running with APP_ENV=prod.

API

Method Path Body
POST /api/v1/search/web { q, backend, language, region, page, limit, … }
POST /api/v1/search/images same shape + image_filters
GET /api/v1/backends introspection list
GET /api/v1/health service + redis + per-backend status
GET /docs OpenAPI / Swagger UI

Example:

curl -s http://localhost:8000/api/v1/search/web \
  -H 'Content-Type: application/json' \
  -d '{"q":"python async search","limit":5}' | jq

Full schema: docs/api.md.

UI

  • GET / — search hero, segmented Web / Images toggle, locale picker.
  • GET /search?q=…&type=web — web results with breadcrumb cards, pagination.
  • GET /search?q=…&type=images — image grid with <dialog>-based lightbox.
  • Light/dark theme via prefers-color-scheme plus a manual toggle.
  • Full RTL support: pass ?ui_locale=ar (or he, fa, ur) and the entire layout mirrors automatically. Result text uses dir="auto" so mixed-script snippets (e.g. python مكتبة البحث) render correctly inside an RTL page.

Web search results Image grid results

Project layout

.
├── app/
│   ├── api/          FastAPI routers (v1)
│   ├── backends/     BaseBackend + search-router adapter + mocks
│   ├── core/         config, cache, circuit breaker, i18n, logging, security
│   ├── search/       schemas, registry, router, normalizer, ranking
│   ├── ads/          ads cabinet (auth, storage, auction)
│   ├── ui/           Jinja templates, static assets, translations
│   └── main.py       app factory
├── tests/
│   ├── unit/         schemas, normalizer, adapter, breaker, cache
│   ├── integration/  end-to-end API round-trips through mock backends
│   └── ui/           server-rendered template assertions (incl. RTL)
├── docs/             architecture, adapters, search-router, i18n, api, deployment
├── config.yaml       declarative backend and feature wiring
├── Dockerfile
└── docker-compose.yml

Adding a new backend

See docs/backend-adapters.md. In short:

  1. Subclass app.backends.base.BaseBackend.
  2. Implement search_web, search_images, plus capabilities().
  3. Either:
    • Register it in config.yaml under search.backends.<name> and add a factory entry in app/search/registry.py; or
    • Expose it via the search_service.backends entry point group from a separate Python distribution — the registry will pick it up automatically.

No public route or response schema needs to change.

Testing

pytest -q
ruff check .
mypy app/

Unit tests cover schemas, i18n, normalizer, the Search Router adapter (with httpx.MockTransport), the circuit breaker, and the cache key builder. Integration tests round-trip through the mock backends to validate the API and UI rendering, including RTL.

Documentation

License

MIT.