Teaching an assistant to read, not remember
The portal assistant gets its answers from live, permission-scoped tools instead of a giant prompt.
The easy version of an AI assistant is a long system prompt full of records. It demos well and fails quietly: the data goes stale, the prompt grows, and every user gets the same permissions as the prompt.
The MBS portal assistant takes a different route. It parses intent, picks a permitted tool, runs the same controller or query a human would use, and returns a fixed response envelope.
Retrieval over recall
When a staff member asks about a student’s results, the assistant does not recall a result from training. It calls a result lookup with the signed-in user’s scope, fetches the live record, and formats the answer. If the record changes, the next answer changes with it.
This is also a permission boundary. The tool registry is scoped by role, so the model cannot ask for data the user is not allowed to see. The assistant is not trusted; the tool is.
Guardrails in the response path
Every response is built from existing controller output, then passed through a guard that recursively strips password, token, secret, API-key and authorization fields. Zod validation strips unknown keys on writes. Redis caches hot reads, but a cache miss just means a slower answer, not a wrong one.
- Parse intent before choosing a tool.
- Scope every tool to the signed-in role and record.
- Fetch live data instead of stuffing records into the prompt.
- Return a fixed envelope so the UI never has to guess.
- Strip credential fields before anything leaves the server.
