Skip to content

About

LangChain and LangGraph agents that search the live web with SpecStream and cite every fact: $1 per 1,000 searches at a 937 ms median.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

LangChain and LangGraph agents on SpecStream live web search

Agent templates that search the live web with SpecStream, read the pages they cite, and answer with a source URL on every fact. The tools call GET https://api.specstream.ai/v1/web-search 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.

File What it does
python/specstream_tools.py web_search, read_pages and research_report as LangChain tools
python/react_agent.py A ReAct agent that searches, reads, and cites, built as a LangGraph graph by create_agent
python/tavily_dropin.py Your Tavily client and LangChain tools, pointed at SpecStream with one base URL
python/list_handoff.py A list question returns its first rows and a handoff to Deep Search
typescript/reactAgent.ts The same agent in LangGraph.js, built by createAgent

Run it

Get a key under Agents & API at specstream.ai/workspace. New accounts get $2 of credit with no card: 2,000 fast searches.

pip install -r requirements.txt
export SPECSTREAM_API_KEY=your_key
export AGENT_MODEL=anthropic:claude-opus-5-5     # any "provider:model" string init_chat_model accepts

python python/specstream_tools.py "who leads the WideSearch benchmark"
python python/react_agent.py "Which open source vector databases shipped a major release this month?"

npm install
npx tsx typescript/reactAgent.ts "your question"

The model needs its provider's package and key: pip install langchain-anthropic with ANTHROPIC_API_KEY for anthropic:claude-opus-5-5, or langchain-openai with OPENAI_API_KEY for an openai: model. create_agent and createAgent are the agent builders of LangChain 1.0, and they return a LangGraph graph you can stream, checkpoint and extend.

The tools

from specstream_tools import TOOLS          # web_search, read_pages, research_report
llm_with_tools = llm.bind_tools(TOOLS)
  • web_search(query, num=10): each result's title, URL and publish date, with a snippet of the page lines that best match the question. $0.001 a call.
  • read_pages(urls): the main text of 1 to 20 pages, PDFs, Word or Excel files as Markdown. $0.0008 a page, and a page with no text is not charged.
  • research_report(question, depth="quick"): a written report with the page behind each cited sentence. $0.10 quick, $0.30 standard, $1.00 deep.

Coming from Tavily

Keep TavilyClient and the LangChain code around it. Change the base URL and the key:

from tavily import TavilyClient
tavily = TavilyClient(api_key=SPECSTREAM_API_KEY, api_base_url="https://api.specstream.ai/compat/tavily")
tavily.search("your question", max_results=10)   # Tavily's JSON: results[].title, url, content
tavily.extract(["https://example.com/page"])     # results[].url, raw_content

POST https://api.specstream.ai/tavily/search answers too. Each search is one fast search at $1 per 1,000. The full guide is at specstream.ai/migrate/tavily, and the side by side at specstream.ai/vs/tavily.

When the question is a list

Ask for many results ("seed stage fintech startups in Paris that raised in 2026") and the reply has kind: "list", its first rows, and a handoff with the estimated size. Deep Search then returns every match as rows, each value with its source URL, priced before it runs.

More

License

MIT

About

LangChain and LangGraph agents that search the live web with SpecStream and cite every fact: $1 per 1,000 searches at a 937 ms median.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages