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.
- 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.
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.
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.
| Scientist’s question | Interpreted request | Bounded 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.
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.
Propose a call
A local Qwen model receives the scientist’s request and one read-only tool contract. It proposes
predict_strengthfor the candidate group.Review and approve
Aner checks the requested tool and scope. A read-only proposal remains pending until the scientist runs the dispatch cell.
Predict and rank
The native tool scores each candidate from its ingredient quantities. Aner orders scores, breaks ties by ID and reserves five slots.
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.
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.
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.0Qwen 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.
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.
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.
| Slot | Mix ID | Predicted | Measured | ≥50 MPa |
|---|---|---|---|---|
| 1 | 123 | 71.46 | 66.90 | Yes |
| 2 | 829 | 67.01 | 74.99 | Yes |
| 3 | 137 | 66.87 | 74.50 | Yes |
| 4 | 754 | 61.88 | 67.31 | Yes |
| 5 | 130 | 60.50 | 71.30 | Yes |
Three ways to fill the same five slots
| Selection rule | Hits in five slots |
|---|---|
| Highest predicted strength | 5 observed |
| Lowest water-to-binder ratio | 4 observed |
| Uniform random selection | 0.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.
- Keep the 425 measurements at age 28 days so every candidate is evaluated at the same age.
- Group identical seven-ingredient recipes and average their listed strengths. Keep the first source row number as the recipe ID.
- 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.
- Run instructions
- Agent notebook
- Offline screening program
- Water-to-binder baseline
- Dataset preparation
- Data and provenance
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.