Skip to content

Add NOOA-backed extract.dimensions wrangle #1167

Description

@ebhills

Description

Add extract.dimensions, an AI-powered WranglesPY wrangle for extracting source-grounded dimensional measurements from messy product descriptions and records.

The initial scope covers:

  • length
  • width
  • height
  • diameter, including OD, ID, DIA, and Ø notation
  • depth
  • explicitly stated volume
  • miscellaneous dimensional measurements such as thickness, radius, bore, area, clearance, and gauge

Each result retains the numeric value or range, normalized unit, optional qualifier/label, and the shortest exact source text supporting the extraction.

How NOOA works here

This wrangle is also a focused evaluation of NVIDIA NOOA as a lightweight agent harness inside WranglesPY. The prototype uses the NOOA 0.0.10 release, which is now available on PyPI.

NOOA lets an agent operation be expressed as a typed Python method:

  • the method docstring supplies the extraction instructions;
  • annotated method arguments provide the input data;
  • the Pydantic return type becomes the structured-output contract;
  • PredictStrategy performs a focused structured prediction without the CodeAct generated-code/tool loop;
  • NOOA decodes and validates the response against the return type and can ask the model to correct an invalid response;
  • its LLM client uses LiteLLM model/provider names, so the wrangle is not tied to one provider.

Each product row is one Predict invocation, normally one provider request. Output-validation retries can add requests. Concurrent rows use separate agent instances because a NOOA agent serializes its own generation calls.

The default in-memory event store is sufficient for this use case. We do not need NOOA long-term memory, SQLite persistence, MCP, CLI, benchmarks, sandboxes, tracing/viewer, or CodeAct.

Desired behavior

Python:

results = wrangles.extract.dimensions(
    [
        "SS sink bowl 18 x 14 x 8 in deep; drain opening DIA 3.5 in",
        "Bottle, 750 mL capacity, 9.7 in H x 3.2 in OD",
        "Shelf 12-14 in wide, 3/4 in thick",
    ],
    threads=3,
)

Recipe:

wrangles:
  - extract.dimensions:
      input:
        - Description
        - Size
        - Packaging
      output: Dimensions
      model: gpt-5.4-mini
      api_key: ${OPENAI_API_KEY}
      threads: 4

Example result:

{
  "measurements": [
    {
      "kind": "diameter",
      "label": "outside diameter",
      "value": 3.2,
      "minimum": null,
      "maximum": null,
      "unit": "in",
      "qualifier": "outside",
      "source": "3.2 in OD"
    }
  ]
}

For a range, value is null and both minimum and maximum are populated. A miscellaneous measurement requires a descriptive label. An input with no supported dimensional fact returns an empty measurements list.

Prototype design

  • Add NOOA as the exact optional extra nooa==0.0.10; the base WranglesPY install remains free of this experimental dependency.
  • Add the same exact pin to requirements-full.txt for Python 3.12 and 3.13. Its environment marker leaves WranglesPY's Python 3.11 base path unaffected.
  • Import NOOA lazily so a normal import wrangles does not load NOOA or LiteLLM.
  • Use strict Pydantic models and reject uncontracted output fields.
  • Accept scalar text/records and lists in Python; accept one or multiple input columns in recipes.
  • Preserve input row order while allowing bounded row-level concurrency.
  • Pass provider credentials directly to the NOOA client; never add credentials to the prompt or output.
  • Treat product content as untrusted data and expose no tools to the Predict agent.

Intentional boundaries

  • Do not convert between units.
  • Do not calculate volume from other dimensions; return volume only when explicitly stated.
  • Do not interpret counts, model numbers, electrical ratings, weights, or ordinary pack quantities as dimensions.
  • Do not introduce saved models, caching, long-term memory, or additional infrastructure in this prototype.
  • A provider exception for any row currently fails the complete batch; the prototype does not yet add a Wrangles-level deadline or per-row error value.
  • Live quality, latency, cost, and failure behavior still need evaluation on representative sanitized product data before production use.

Dependency and deployment boundary

WranglesPY's requirements-full.txt will install nooa==0.0.10 on its Python 3.12 and 3.13 validation paths. Python 3.11 skips it through the version marker.

The deployed execute-recipe-dev image is owned by Lambda-Recipes, so merging WranglesPY alone will not make NOOA available in DEV. A separate Lambda-Recipes dependency branch will add the exact nooa==0.0.10 pin. DEV testing should begin only after that companion change is deployed with the intended WranglesPY release candidate.

Current caveats

  • NOOA 0.0.10 supports Python 3.12 and 3.13, not WranglesPY's Python 3.11 floor; calling this optional wrangle on 3.11 produces a clear installation/runtime error.
  • NOOA 0.0.10 has native-Windows import assumptions around fcntl and SIGUSR2. The prototype includes narrow guards only for Predict with in-memory storage. SQLite persistence and Unix signal debugging remain unsupported on native Windows; Linux/DEV behavior must be verified separately.
  • Every non-empty row produces a model request and validation retries can produce additional requests, so DEV testing must examine realistic concurrency, rate limits, latency, and cost.

Acceptance criteria

  • The Python API returns the documented scalar/list structured contract.
  • The recipe API supports one or multiple input columns and writes one structured object per row.
  • Tests cover scalar values, ranges, compact L×W×H groups, written fractions, shared trailing units, OD/ID/DIA, and labeled miscellaneous dimensions.
  • Representative evaluation cases exclude counts, identifiers, weights, electrical values, and packaging noise.
  • Invalid output shapes fail validation or are corrected through NOOA's validation retry.
  • Empty input, row order, bounded concurrency, and missing optional dependency behavior are tested.
  • Base WranglesPY import and Python 3.11 installation remain unaffected.
  • WranglesPY CI installs the exact pin through requirements-full.txt on Python 3.12/3.13 paths.
  • The companion Lambda-Recipes branch installs nooa==0.0.10 in the DEV runtime.
  • A Linux DEV smoke test confirms dependency availability, existing credential routing, one real structured extraction, and a small multi-row run.
  • A sanitized golden corpus is reviewed before the wrangle is considered production-ready.

Offline validation completed

  • Focused core/schema/recipe tests: 20 passed; the 2 optional NOOA runtime tests skip cleanly when NOOA is absent.
  • Actual NOOA 0.0.10 contract tests using its offline fake LLM client: 2 passed, including strict structured validation and validation retry.
  • The package builds successfully with the exact wrangles[nooa] pin.
  • Ordinary import wrangles does not import NOOA.
  • No test makes a live provider request.

Remaining DEV verification

After the WranglesPY and Lambda-Recipes dependency changes are available together in DEV:

  1. Confirm nooa==0.0.10 is installed in the deployed Linux runtime.
  2. Run one real recipe extraction through the existing model/key-routing path.
  3. Run a small multi-row sample to observe output quality, ordering, retry behavior, latency, rate limits, and cost.
  4. Record the deployed WranglesPY version/commit and Lambda image revision so the smoke evidence is reproducible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions