Skip to main content

Guides

Parlyr vs NEXUS

When to use natural language parsing vs strategy synthesis

2 min read


KLOAKD has two modules that work out what you want. Here's how to choose between them.

Quick comparison

| | Parlyr | NEXUS | |--|--------|-------| | Input | A sentence ("extract all prices from …") | A URL, the page's HTML and a goal | | Output | The intent, its entities and the URL it names | An extraction program and its steps | | Best for | Turning a request into what to do | Generating extraction code for a page |

When to use Parlyr

Parlyr parses a natural-language request into an intent. Use it when your users describe what they want in words.

result = client.parlyr.parse("Extract all product names, prices, and ratings from https://example.com/products")
print(result.intent, result.confidence, result.entities, result.detected_url)

data = client.kolektr.page(
    result.detected_url or "https://example.com/products",
    schema={"name": "css:.product-name", "price": "css:.price"},
)

parse returns intent, confidence, entities, source, tier, requires_action, clarification_needed, reasoning and detected_url. It does not produce an extraction schema; you supply the selectors.

When to use NEXUS

NEXUS analyses a page and synthesises an extraction program for it. Use it when you don't want to write the selectors yourself.

page = client.evadr.fetch("https://example.com/products")
if not page.success or not page.html:   # failed fetch or login page
    raise SystemExit(page.error or "no HTML")

analysis = client.nexus.analyze("https://example.com/products", html=page.html)
plan = client.nexus.synthesize(
    "https://example.com/products",
    html=page.html,
    goal="product names and prices",
)
print(analysis.page_type, plan.strategy_name, plan.program)

Combining both

request = client.parlyr.parse("Get product names and prices from https://example.com/products")
url = request.detected_url or "https://example.com/products"

page = client.evadr.fetch(url)
plan = client.nexus.synthesize(url, html=page.html, goal="product names and prices")
print(plan.strategy_name, plan.program)

Next steps

Was this page helpful?