Skip to main content

Context.dev for Haystack

PyPI Python Test License

Haystack components for live web search, webpage and YouTube transcript retrieval, and bounded website crawling with Context.dev.

Installation

pip install context-dev-haystack

Create an API key in the Context.dev dashboard, then export it:

export CONTEXT_API_KEY="your-api-key"

Components

Component Purpose Import
ContextWebSearch Search the live web and return ranked Haystack Documents and source links haystack_integrations.components.websearch.context
ContextFetcher Fetch webpages or YouTube videos as clean Markdown Documents haystack_integrations.components.fetchers.context
ContextCrawler Crawl websites into Documents with explicit page and depth limits haystack_integrations.components.fetchers.context

All components support both run() and run_async(), Haystack serialization, custom timeouts, and retry configuration.

Search the live web

from haystack_integrations.components.websearch.context import ContextWebSearch

search = ContextWebSearch(top_k=5, include_markdown=True)
result = search.run(query="Recent advances in retrieval-augmented generation")

documents = result["documents"]
links = result["links"]

Use include_domains, exclude_domains, freshness, and country to constrain results. Extra Context.dev Search API fields can be supplied through search_params.

Fetch webpages or YouTube transcripts

from haystack_integrations.components.fetchers.context import ContextFetcher

fetcher = ContextFetcher()
result = fetcher.run(
    urls=[
        "https://haystack.deepset.ai",
        "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
    ]
)

documents = result["documents"]

Each URL becomes a Haystack Document. Webpages contain clean Markdown and page metadata; supported YouTube URLs return timestamped transcript Markdown.

Crawl a website

from haystack_integrations.components.fetchers.context import ContextCrawler

crawler = ContextCrawler(crawl_params={"maxPages": 25, "maxDepth": 2})
result = crawler.run(urls=["https://docs.haystack.deepset.ai"])

documents = result["documents"]

ContextCrawler defaults to one page to prevent accidental credit consumption. Set maxPages explicitly for larger crawls.

Async usage

result = await search.run_async(query="Haystack agents")
documents = result["documents"]

The fetcher and crawler process multiple input URLs concurrently in their async methods.

Development

See CONTRIBUTING.md for the Hatch-based development and release workflow.

License

Apache-2.0. See LICENSE.

Download files

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

Source Distribution

context_dev_haystack-0.1.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

context_dev_haystack-0.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file context_dev_haystack-0.1.0.tar.gz.

File metadata

  • Download URL: context_dev_haystack-0.1.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for context_dev_haystack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7eb3b1f86777c0a7838b159329ac1647099f92e543bd3b8b83f1c54532d339c9
MD5 7eb7ba9f97d32abc80a29d6e92c4e6d1
BLAKE2b-256 afa73e39298acb69f65ab377271c7bfcdc81ef567b9380aa3cfe29a7e9e42982

See more details on using hashes here.

Provenance

The following attestation bundles were made for context_dev_haystack-0.1.0.tar.gz:

Publisher: release.yml on context-dot-dev/context-haystack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file context_dev_haystack-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for context_dev_haystack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b7c44457a4b39d7414ba8f3e7c48f7c383969742bb95b8378a254964a31ec18
MD5 8b24804939962b0494bc3976baaf9430
BLAKE2b-256 19234ff24fe954fa6df2b0b9d3a6935b645124c50374bff9946ce683c0249aae

See more details on using hashes here.

Provenance

The following attestation bundles were made for context_dev_haystack-0.1.0-py3-none-any.whl:

Publisher: release.yml on context-dot-dev/context-haystack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page