All applications

Materials science · Aner 0.1.2

Which concrete mixes earn a lab test?

A materials lab has five slots to find concrete mixes that reach 50 MPa. Aner can rank 83 recipes directly. The agent lets a scientist question that ranking in ordinary language, inspect the proposed action and check the answer against real 28-day tests.

Illustration of a test frame applying force to a concrete specimen between two platens.
Training formulations
333
Held-out formulations
83
Follow-up slots
5
Selected at or above 50 MPa
5 of 5

When does the agent earn its place?

A lab that repeats the same five-slot screen already has everything it needs in the native program. The agent becomes useful when a scientist sees the shortlist and decides what to investigate next.

For the scheduled screen

Call the fitted model, sort its predictions and take five. This runs offline. The direct call and the agent’s screening call returned identical values for all 83 recipes.

screen.aner
let forecast = model.predict(candidates)
let queue = shortlist(forecast, budget).unwrap()

For an unplanned follow-up

Edit the question passed to lab.ask, a method defined in this notebook. Qwen receives the question and descriptions of the three supported analyses. The ingredient and strength data stay with Aner. Aner uses the existing fit and frozen queue, computes the eligible row and shows the proposed action for review.

lab-agent.anernb
let question = "Which mix does the ratio rule add that the fitted model leaves out?"
let plan = lab.ask(question)
if plan.is_ok() { print(plan.unwrap().describe()) } else { print(plan.unwrap_err()) }

Four questions, one frozen shortlist

Only the question changes between these recorded runs. Each accepted action grants the predictor one formulation. The original five test slots stay fixed.

Ingredient quantities and strength predictions are available at review time. Archived assays are opened after the queue is frozen.
Scientist’s questionInterpreted requestBounded action and result
“Which mix does the ratio rule add that the fitted model leaves out?”Find a recipe selected only by the water-to-binder rule.One recipe, mix 909. Forecast 55.65 MPa. Archived assay 44.52 MPa.
“Which mix did the fitted model promote that the binder rule would pass over?”Find a recipe selected only by the fitted model.One recipe, mix 754. Forecast 61.88 MPa. Archived assay 67.31 MPa.
“Of the five mixes we would send to the lab, which uses the least cement per cubic metre?”Minimize the cement quantity among the five ridge selections.One recipe, mix 130 at 362.6 kg/m³ cement. Forecast 60.50 MPa. Archived assay 71.30 MPa.
“Which mix costs least?”The dataset contains ingredient masses and strength. Cost requires prices.Request declined. 0 follow-up tool calls and 0 follow-up predictions.

The scientist changes the question while the fit, data and test budget stay fixed. The notebook supports these three analyses. Adding a new kind of analysis takes an explicit policy in Aner. An earlier version of the intent descriptions declined the same cement question. Review time was not measured. Inspect the notebook. Read the recorded decisions.

See how one row reaches the predictor

The notebook displays the interpreted request, recipe ID and proposed scope. Running the notebook’s lab.run method calls the reviewed plan’s predict method below. It passes the fitted model and the single recipe that Aner selected.

lab-agent.anernb
fn predict(tool: AgentTool, model: FittedRidge) -> ContextPrediction {
    return agent.call_tool(tool, proposal, scope, model, recipe)
}

What the scientist delegates

Qwen interprets the request and proposes a tool call. The predictive model supplies numerical strength estimates. The scientist controls the data, allowed tool, review step, ranking rule and test budget in Aner.

  1. Propose a call

    A local Qwen model receives the scientist’s request and one read-only tool contract. It proposes predict_strength for the candidate group.

  2. Review and approve

    Aner checks the requested tool and scope. A read-only proposal remains pending until the scientist runs the dispatch cell.

  3. Predict and rank

    The native tool scores each candidate from its ingredient quantities. Aner orders scores, breaks ties by ID and reserves five slots.

  4. Open the assays

    After the chosen follow-up, the evaluator joins the frozen IDs to historical tests. Reaching 50 MPa counts as one success.

Inspect the proposed action

The request names the budget and strength target. Only the read-only function and its authorized population are available to the language model.

lab-agent.anernb
let tool = agent.register_tool(predict_strength, "read_only")
let local = llm.client(provider: "ollama", model: "qwen2.5:14b-instruct",
    endpoint: "http://127.0.0.1:11434", timeout_ms: 120000)
let scope = "candidate_28d"
let request = "We have five lab slots. Screen the candidate 28-day concrete mixes for a 50 MPa target."
let proposal = llm.tool_turn(local, tool, scope, request)
print(proposal.model())
print(proposal.text())

Compute strength from ingredients

Aner fits a ridge regression with α = 1 and standardizes ingredient quantities using the training recipes. The feature-only candidate frame carries row IDs for audit.

Aner predictive model
let parts = study.partition_groups(List("train"), List(), List("candidate"))
let model = ml.ridge(alpha: 1.0, standardize: true).fit(parts.train())
let candidates = parts.test().features()
let budget = 5
let target_mpa = 50.0

Qwen returned the tool name predict_strength and scope candidate_28d. Running the next cell dispatched that proposal. When the same proposal was tried with scope training_28d, Aner rejected the call with error R4901. Inspect the recorded tool exchange.

Reviewed notebook cell
let forecast = agent.call_tool(tool, proposal, scope, model, candidates)
print(forecast.unit())

What five test slots bought

5 of the five selected formulations reached 50 MPa in the archive. Only 13 of all 83 held-out formulations reached that strength. The figure shows both the selected mixes and the ones the queue missed.

Measured versus predicted strength for 83 held-out formulations. All five highlighted recipes reach 50 MPa. Mix 384 reaches 78.80 MPa despite a prediction of 51.55 MPa.
Each point is one held-out formulation. Eight mixes reached 50 MPa outside the queue. Mix 384 was the strongest in the archive subset at 78.80 MPa, but its prediction of 51.55 MPa placed it outside the top five. Across all 83 candidates, mean absolute error was 5.16 MPa for ridge and 11.81 MPa for a constant prediction of the training mean. View all predictions on GitHub.

The five selected formulations

Read from the first lab slot to the fifth. Hide the archived assays to see the queue as it stood at selection.

IDs identify the first source row for each formulation. Strengths are in megapascals (MPa).
SlotMix IDPredictedMeasured≥50 MPa
112371.4666.90Yes
282967.0174.99Yes
313766.8774.50Yes
475461.8867.31Yes
513060.5071.30Yes

Three ways to fill the same five slots

The random reference is the expected count across uniform draws of five distinct candidates. The other counts come from the recorded assays.
Selection ruleHits in five slots
Highest predicted strength5 observed
Lowest water-to-binder ratio4 observed
Uniform random selection0.78 expected

Four recipes appeared in both queues. Ridge’s fifth selection, mix 754, reached 67.31 MPa. The ratio rule chose mix 909. Its archived 44.52 MPa fell below both the 50 MPa target and its 55.65 MPa prediction. The blind reference is 5 × 13 / 83. The ratio rule divides water by the combined mass of cement, slag and fly ash.

Where the evidence comes from

From 1,030 measurements to 416 recipes

I-Cheng Yeh’s concrete dataset records seven ingredient quantities in kg/m³, specimen age in days and measured compressive strength in MPa. The ingredients are cement, blast-furnace slag, fly ash, water, superplasticizer, coarse aggregate and fine aggregate. UCI dataset and citation.

  1. Keep the 425 measurements at age 28 days so every candidate is evaluated at the same age.
  2. Group identical seven-ingredient recipes and average their listed strengths. Keep the first source row number as the recipe ID.
  3. Assign every fifth distinct recipe in source order to the candidate pool. Fit the model using the other 333 recipes. Candidate outcomes stay in a separate file until evaluation.

What the archive can establish

The recorded tests answer a retrospective question about these 83 formulations. Predicting new batches, plants or projects requires independent validation. The archive provides no lab or batch identifiers for an external-site evaluation. The source order also determines which formulations land in this split.

The five-slot budget and 50 MPa target are study choices. The next experimental step would be to manufacture the selected mixes and test independent specimens. Construction acceptance requires the project’s own sampling and testing procedure.

Run it in Aner 0.1.2

Clone the public GitHub repository to get the notebook, native programs, data and recorded results. The offline run reproduces the numerical queue. Open the notebook to inspect the model’s proposal and control when it runs.

From the repository root, run aner run screen.aner --prod. For the live notebook, serve qwen2.5:14b-instruct locally with Ollama at 127.0.0.1:11434 and execute the cells individually in the Aner notebook editor.

Data by I-Cheng Yeh (1998), Concrete Compressive Strength, UCI Machine Learning Repository. The archive and derived data are shared under CC BY 4.0.