Skip to content

About

Haystack 2.x and 3.x components for live web search and page extraction into Documents, with a RAG pipeline and an Agent. The key stays in a Secret.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Haystack components for live web search and page extraction

Two @component classes for Haystack pipelines and agents, on SpecStream, the live web data engine: SpecStreamWebSearch turns a query into Documents and links from the live web, and SpecStreamPageReader turns URLs into Documents holding each page's main text as Markdown. They need only haystack-ai and run on Haystack 2.x and 3.x.

File What it is
specstream_components.py SpecStreamWebSearch and SpecStreamPageReader, serializable, key held in a Secret
rag_pipeline.py search, then read the best pages, then a prompt and OpenAIChatGenerator: an answer with its URLs
agent.py A Haystack Agent with both components as ComponentTools
specstream_api.py The calls underneath, standard library only

Search runs on the fast tier: $1 per 1,000 searches, 937 ms median over 6,548 live calls in the 7 days to December 1, 2026. Page reading is $0.80 per 1,000 pages, and a page with no text is not charged.

Run

git clone https://github.com/specstream/haystack-specstream-component
cd haystack-specstream-component
python specstream_api.py check          # live, no key, nothing charged
API reachable: 70 drop-in APIs on 78 routes at https://api.specstream.ai
  ready list:    14,686 rows  /data/nursing-homes
  ready list:    10,885 rows  /data/nursing-homes/ownership/for-profit
  ready list:     7,504 rows  /data/nursing-homes/harm-citations

Get a key under Agents & API at specstream.ai/workspace. A new account gets $2 of credit with no card, which is 2,000 fast searches.

pip install -r requirements.txt
export SPECSTREAM_API_KEY=your_key OPENAI_API_KEY=your_openai_key
python rag_pipeline.py "What changed in the latest stable release of PostgreSQL?"
python agent.py "Which US states passed AI hiring laws in 2026?"

HAYSTACK_MODEL picks the OpenAI model; it defaults to gpt-4.1-mini. Any Haystack chat generator works in its place.

The pipeline

from haystack import Pipeline
from specstream_components import SpecStreamPageReader, SpecStreamWebSearch

pipe = Pipeline()
pipe.add_component("search", SpecStreamWebSearch(top_k=5))
pipe.add_component("reader", SpecStreamPageReader(max_pages=3))
pipe.connect("search.links", "reader.urls")

docs = pipe.run({"search": {"query": "EU battery regulation due diligence deadline"}})["reader"]["documents"]
for d in docs:
    print(d.meta["url"], d.meta["title"], len(d.content))

SpecStreamWebSearch gives documents (each result's best matching lines, with url, title and published in meta) and links. SpecStreamPageReader reads PDFs and Office files as well as HTML. Both keep the key in a Haystack Secret, so pipe.dumps() writes only the name SPECSTREAM_API_KEY to YAML. On Haystack 3, load that YAML with Pipeline.loads(yaml, allowed_modules=["specstream_components"]), as 3.x loads only modules you allow.

Tested on haystack-ai 3.5.0 and 2.31.1: the pipeline connects, saves to YAML and loads again, the Agent takes both tools with their parameters, and a wrong key comes back as the API's own 401 message.

Ready data lists in Haystack

For structured rows (companies, facilities, filings, each with its source URL), the specstream-haystack package adds SpecStreamListFetcher and SpecStreamListTool. The two components here cover the open web; that package covers the lists. They work side by side.

Prices

Price
Free credit on sign-up $2, which is 2,000 fast searches, no card
Fast search $1 per 1,000
Extract API, page text as Markdown $0.80 per 1,000 pages
Monthly Pro Pass $49 a month: 5,000 ready list rows a month and $49 of API credit

Links

License

MIT

About

Haystack 2.x and 3.x components for live web search and page extraction into Documents, with a RAG pipeline and an Agent. The key stays in a Secret.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages