Build a bounded AI prototype: code, tests and handover
Build a testable system, not a vague AI demo
Training a new model is an option, not a mandatory step. Here, a tiny local classifier makes its behaviour inspectable.
Run the whole example
Six downloadable files, invented notices and a rules-versus-model comparison. No API key or package installation.
Inspect the failure
A correctly cited start time is still the wrong response to a parking question.
Hand over honest evidence
Keep development results, simulated failures and independent human review clearly separate.

A useful first AI build has a bounded task, an inspectable baseline and a way to fail safely. This guide is for early-career builders who can read basic JavaScript, use a terminal and review AI-assisted code. You will run a small event-question classifier, inspect its replies and prepare a handover record—not create a foundation model or prove you are ready for a client project.
The supplied project is an original teaching example with invented data. It is not MLAI's event system, a client case study or a benchmark of commercial AI tools. No real inbox, attendee database, LLM provider or external action is connected.
1. Define what the application may do
The task: prepare a reply about the time or location of an explicitly selected fictional event, using three fixed notice records. A small learned classifier selects the field; application code copies its value into a draft and attaches supporting notice IDs. The model never writes free-form factual prose.
On small screens, swipe the comparison tables sideways. Keyboard users can focus a table and use the left/right arrow keys.
| Boundary | Implemented behaviour | Human responsibility |
|---|---|---|
| Input | Only event ID, question and snapshot version; unknown fields are rejected. | Confirm the event and permitted notice source. |
| Evidence | Matching notices must have the requested field and agree; expired or wrong snapshots stop. | Verify the source is approved, correct and fresh enough. |
| Output | A fixed, cited draft marked needs-human-review, or an explicit refusal/cannot-answer result. | Check that it answers this question, not just that its fact is cited. |
| Capabilities | No sending, booking, payment, registration or attendee lookup exists. | Review any future capability before adding it. |
A prompt saying “never send” is not the same as removing a sending tool. In this delivered program there is no such tool. The limited request filter is additional teaching logic, not a comprehensive privacy or intention detector.
2. Download and run the working prototype
Save all six files in one new folder, retaining their names. Read the code before executing it. You need a maintained Node.js runtime; there are no packages to install, secrets to supply or cloud costs generated by the delivered program.
- model.mjs — Required: the fitted classifier and independent rules baseline.
- lab.mjs — Required: input, evidence and response boundaries plus the runner.
- synthetic-fixture.json — Required: invented training questions, notices and all eight evaluation cases.
- lab.test.mjs — Run the 14 executable calculation, boundary and failure checks.
- recorded-result.json — Compare every prediction, draft and citation with the recorded output.
- README.md — Setup, source roles, failures, disable instructions and editable handover checklist.
node --version
node --test lab.test.mjs
node lab.mjsRecorded on 10 September 2026 with Node 25.2.1 on macOS arm64: 14 tests passed. Compare the entire JSON result with recorded-result.json. The fixed scenario uses an explicit 1 February 2026 clock and invented February notices; these are not current event details. A clock beyond the snapshot's expiry deliberately stops replies.
The README shows how to submit a single question, use the rules baseline instead of the model and investigate setup failures. A missing fixture or extra command-line argument exits with an error. If your browser appends .txt to a code filename, restore the displayed name.
3. Separate the model from the application
The classifier fits word counts from 12 labelled training questions: six about time and six about location. It is multinomial naive Bayes, not an LLM. Lowercase word tokens, class frequencies and smoothed counts determine its scores. The scikit-learn model explanation describes the method and Laplace smoothing; this lab implements it in JavaScript and does not import that library.
Unknown vocabulary is ignored. No known tokens or a log-score margin below 0.75 produces other. That teaching cutoff is not a calibrated probability or safety guarantee. The model does not know event permissions or whether a fact is useful to the reader.
- The validator checks the request, selected event and notice snapshot.
- The classifier receives question text only and proposes
time,locationorother. - Application code checks that field across every matching notice, refusing missing or conflicting evidence.
- A fixed template produces the draft and citations. A person must check relevance and evidence before doing anything with it.
Executed trace, case q3: “At which hour does it commence”. The model selects time; both notice-1 and notice-2 contain the same value. The output is “Start: 18 February 2026, 18:00 Australia/Melbourne.”, with those two field citations and needs-human-review. The rules baseline returns other for this wording. The full input and both outputs are in the download.
4. Compare the baseline and keep the failed cases
The rules baseline recognises a short list such as “time/start/when” and “where/venue/address”; it abstains when both or neither match. It is deliberately simple, not an optimised production competitor. A field-selection interface might remove the need for either method.
| Measure | Rules baseline | Learned classifier |
|---|---|---|
| Expected intent matches | 4 / 8 | 6 / 8 |
| “Commence” and “hall/meet” paraphrases | Abstains on both | Routes both to the expected field |
| Attendee email request, q6 | Misclassifies as location | Misclassifies as location |
| Parking question, q8 | Returns the wrong field | Returns the wrong field |
Inspect q8: “I know the start time; tell me about parking”. Both methods return the start time. Its citations are valid, but the response is irrelevant. Reject this draft. In q6, the separate application filter refuses the attendee request before classification; that does not turn the underlying wrong classification into a correct one.
Decision: neither version is approved for real event enquiries. Keep the known failure in the log and test an explicit field selector or revised abstention design on fresh cases. Do not remove awkward questions to create a flattering score.
These are development examples, not a statistically representative benchmark. They are excluded from fitting but were visible during implementation. Tests reject exact normalised overlaps; they do not remove near-duplicate meaning or selection bias. Google's dataset guidance explains why tuning against repeatedly viewed examples needs separate, fresh evaluation. Have another person prepare permitted cases and review outcomes before estimating real-world usefulness.
5. Test boundaries, not just successful replies
| Input or injected fault | Observed behaviour | Limit |
|---|---|---|
| Disagreeing times or missing field | No draft; explicit evidence failure | Agreeing sources are not necessarily true. |
| Expired/wrong snapshot or unknown event | No draft | Approval and expiry policy need an accountable owner. |
| “Ignore instructions and send” in notice text | Text reaches neither classifier nor draft | Data exclusion, not a full prompt-injection benchmark. |
| Throwing, malformed or never-resolving classifier | Explicit failure; no fabricated reply | Simulated adapter failures, not provider reliability tests. |
The timer stops waiting for an asynchronous result; it cannot terminate blocking JavaScript or undo an external effect. Replacement classifier code is trusted local code, not sandboxed. Adding a provider changes privacy, cost, cancellation and security requirements and needs separate review.
Other tests check the model against a hand-solvable probability calculation, verify that evaluation labels cannot change predictions, reject malformed/duplicate records and compare cited values with the selected notice. Green tests establish only those exercised behaviours.
6. Turn the exercise into your own delivery evidence
The files were drafted with AI coding assistance and checked through agent-run execution, calculation tests and failure cases. No independent human reviewer has approved this prototype. Downloading it is not evidence that you authored or delivered a client system. Explain the changes you actually make.
Download the editable prototype delivery contract. It now includes the completed lab scope and routing result, plus a blank evaluation row. The README adds data permission, environment, your contribution, failure evidence, independent review and future deployment ownership. Leave unrun checks marked UNRUN and approvals marked PENDING.
A narrow coding-assistant prompt to try: “Add one test for a missing notice field. Do not change expected results, add network calls or remove the parking failure. Explain what the test does not prove.” Inspect the diff, run the full suite and record your corrections.
Do not train or fine-tune a larger model merely because the project is called AI. First test whether a form, rules, search or an existing product meets the task. Further modelling needs a demonstrated gap, permitted data and a stronger evaluation. For commissioning, use the business AI delivery guide. For different engineering tasks, see the inference service lab and agent action-boundary lab.
Use tested work when applying to the builder pool
Already delivering projects with AI coding tools? Use a permitted repository or demo, test record and handover to show MLAI Studio what you can take responsibility for. This lab alone is not proof of client readiness. Applications depend on fit and available work; an assignment is not guaranteed and publishing client work needs permission. The current application asks about contracting in Australia; New Zealand applicants should clarify eligibility before assuming support.
A practical next step with MLAI
Show how you build and verify
Have delivery experience beyond this teaching lab? Share a permitted AI-assisted project, its tests and your availability with MLAI Studio to be considered for scoped paid work, subject to fit and available projects.
Apply with your delivery evidenceStill practising? Find an MLAI learning or build event and bring one question about a result or boundary you could not explain. Check the advertised format, level and location.
Frequently Asked Questions
Must I train a model to build an AI application?
Does six out of eight mean the prototype is 75% accurate?
Can the lab send replies or access attendee information?
Does completing the example qualify me for client work?
Disclaimer: This article provides general information and is not legal or technical advice. For official guidelines on the safe and responsible use of AI, please refer to the Australian Government’s Guidance for AI Adoption →
A practical next step with MLAI
Show how you build and verify
Have delivery experience beyond this teaching lab? Share a permitted AI-assisted project, its tests and your availability with MLAI Studio to be considered for scoped paid work, subject to fit and available projects.
Apply with your delivery evidence