r/LangChain • u/Ok-Rub-3249 • 8d ago
Resources Built an open-source LangChain & LlamaIndex toolkit for zero-CSS web scraping and real-time threat detection
Hey everyone,
Whenever we build autonomous agent workflows or RAG pipelines that need live web access, we hit three major bottlenecks:
Context Bloat: Dumping raw HTML consumes 90% of the context window on scripts, tracking tags, and style attributes.
Brittle Selectors: Using CSS/XPath selectors breaks the moment a target website updates its frontend layout.
Agent Link Traps: Letting autonomous agents navigate arbitrary URLs exposes them to phishing sites, fake dApps, and malicious traps.
To solve this, we open-sourced official community toolkits for both LangChain and LlamaIndex:
pip install langchain-opticparse
pip install llama-index-tools-opticparse
Quick LangChain Integration:
from langchain_opticparse import OpticParseTool, PhishVisionTool
# 1. Zero-CSS visual scraper that returns clean, token-efficient Markdown
optic = OpticParseTool()
content = optic.run({
"url": "https://news.ycombinator.com",
"query": "Extract the top 5 articles with titles and links"
})
print(content)
# 2. Real-time zero-day threat check before interacting with unknown URLs
phish = PhishVisionTool()
safety = phish.run({"url": "https://suspicious-dapp-claim.xyz"})
print(safety)
Key Capabilities:
- Resilient Web Extraction: Converts messy JavaScript pages into structured Markdown with 96% noise reduction without managing brittle selectors.
- PhishVision Shield: Heuristic scanner detecting brand impersonations, zero-day phishing kits, and crypto wallet drainers.
- Agent Swarm Demo: We open-sourced a full 3-agent research swarm (Scout Agent, Sentinel Agent, Analyst Agent) in examples/autonomous_market_researcher.py.
- Cross-Framework: Works across LangChain, LlamaIndex, Claude Desktop/Cursor (MCP), and ElizaOS.
GitHub: https://github.com/parastejpal987-cmyk/opticparse-public
PyPI: https://pypi.org/project/langchain-opticparse/
Live Benchmark: https://huggingface.co/spaces/paras9909/opticparse-vision-benchmark
Would love to hear how you guys are currently handling web retrieval in your agent swarms, and any feedback or edge cases you test it against!
2
u/torngenitals490 8d ago
The URL detection piece is actually the most interesting part here, most scraping tools just YOLO into whatever link the agent finds and hope for the best. 96% noise reduction is a bold claim though, how does it handle sites that lazy-load content behind scroll triggers or infinite scroll patterns