Skip to main content

Module workflow

Module workflow 

Source
Expand description

The bitmap-workflow DSL. Needle emits a compact workflow in one shot — WHICH constraints to apply to the SPLADE-expanded candidate rows, and WHICH bitmap program to run — and it compiles here to IKL set-algebra over the roaring index. This is the reasoning contract SteelDB drives on:

query → SPLADE/entity-link expansion (candidate rows = scope) → Needle DSL {constraints, program, args} → compile: refined = scope ∩ constraint₁ ∩ … (roaring AND) → bitmap program over refined → deterministic template (crate::agent::synth)

Constraints are IKL atoms/expressions (powertrain/electric, (num range_km gt 500), (not …)), AND-ed together and with the candidate scope. The compiled anchor is a plain IKL string the existing programs already accept, so the DSL “compiles to the bitmap program” with no new engine.

Functions§

compile_anchor
Compile the candidate scope (tokens from the query’s SPLADE/entity-link expansion) plus the DSL constraints into a single IKL anchor: (and (or scope…) constraint₁ …). Empty → whole corpus.
execute
Execute a workflow DSL against the corpus. scope = candidate tokens from query expansion (may be empty → whole corpus). Returns (result_json, is_error); the result carries a "program" key so crate::agent::synth renders it deterministically.