Skip to main content

Two-phase AI-assisted search library with zoom-out and zoom-in workflows

Project description

Zoom Search

Zoom Search quality versus cost benchmark summary

Python >=3.10 License: MIT Package: zoom-search Tests: pytest

Quickstart · Providers · Streaming · Benchmarks · Advanced Configuration

Zoom Search is a precise AI web search library for Python. It rewrites questions, searches broadly, zooms into high-value source domains, deduplicates results, formats evidence, and can synthesize sourced answers through an async API.

It is built for applications that need stronger source discovery, traceability, and answer grounding than a single search call.

Why Zoom Search

  • Better source discovery: rewrite the original question into stronger search variants.
  • Source-domain zoom-in: search broadly first, then focus on high-value domains.
  • Traceable evidence: preserve source domains, duplicate provenance, warnings, and metrics.
  • Provider-flexible: use built-in engines or custom OpenAI-compatible and native HTTP providers.

Install

pip install zoom-search

Quickstart

Run a deterministic local demo without API keys:

import asyncio

from zoom_search import search


async def main() -> None:
    response = await search(
        question="What hotels in Shenzhen have rooms with exercise bikes?",
        demo_mode=True,
        output_mode="answer_with_sources",
        seed=7,
    )
    print(response.answer)
    print(response.results)


asyncio.run(main())

Real Provider Example

import asyncio

from zoom_search import search


async def main() -> None:
    response = await search(
        question="Which vector databases support hybrid search and metadata filtering for Python apps?",
        llm_engine="gemini",
        llm_model="gemini-2.5-flash",
        llm_api_key="YOUR_GEMINI_API_KEY",
        search_engine="tavily",
        search_api_key="YOUR_TAVILY_API_KEY",
        output_mode="answer_with_sources",
    )
    print(response.answer)
    print(response.search_context)


asyncio.run(main())

Common Usage

Return only normalized search results:

response = await search(
    question="Latest SQLite performance improvements",
    demo_mode=True,
    output_mode="results_simple",
)

Use recent conversation context:

response = await search(
    question="What about hotels with in-room fitness equipment?",
    previous_conversation=[
        "I am planning a business trip to Shenzhen.",
        "I prefer hotels with wellness facilities.",
    ],
    demo_mode=True,
    output_mode="answer_with_sources",
)

Streaming

import asyncio

from zoom_search import astream_search


async def main() -> None:
    async for event in astream_search(
        question="What hotels in Shenzhen have rooms with exercise bikes?",
        demo_mode=True,
        output_mode="answer_with_sources",
        seed=7,
    ):
        if event.type == "answer_delta":
            print(event.text, end="")
        if event.type == "completed":
            print(event.response.request_id)


asyncio.run(main())

Benchmarks

Historical evaluations show better useful result coverage and stronger final answers with bounded extra time and token cost.

Case Good results Answer quality Extra time Extra tokens
Playwright authentication reuse 5 -> 7 6.6 -> 8.7 +5.89s +2,324
GitHub Actions secrets inherit 1 -> 4 2.0 -> 7.8 +8.93s +2,936
Hydrangea pruning comparison 4 -> 12 7.2 -> 8.4 +12.17s +5,073

See the full benchmark notes in docs/benchmarks.md.

Examples

Runnable examples are available in the examples/ directory:

python examples/demo_mode.py
python examples/streaming.py
python examples/conversation_history.py

Documentation

License

Zoom Search is open source under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zoom_search-0.1.2.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zoom_search-0.1.2-py3-none-any.whl (75.2 kB view details)

Uploaded Python 3

File details

Details for the file zoom_search-0.1.2.tar.gz.

File metadata

  • Download URL: zoom_search-0.1.2.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for zoom_search-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8fc78d6d65325892c7eb90223088466af6612060383d44fbf4d56b319c46e87b
MD5 bfffd05a53a4c564d23a1af78ba60b01
BLAKE2b-256 65e937f584b1abc93b34fd866bdd88bb89eddb16ab4e1e95c48356f253e32c49

See more details on using hashes here.

File details

Details for the file zoom_search-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: zoom_search-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 75.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for zoom_search-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c983ad7d8225547e1cfbc6d85fcf9e64f0428f4853dae6ed3ed1828a7b205e57
MD5 22d157888c48c89c4b6f866b354aa477
BLAKE2b-256 082cd1deace1c46e24badb11f5d4f17fce6ce7d6d6adab060d250221fa2b7f53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page