Engineering

Eliminating the engineer-in-the-loop for AI behavior tuning

Memory Stack engineering team Memory Stack

Here is the standard workflow when a non-engineer wants to change how an AI behaves.

They describe the change they need. Engineering puts it in the backlog. It gets prioritized — or it doesn't. A prompt gets edited. Someone reviews the diff. It merges. It deploys. A week later, the AI behaves differently.

Every step in that chain is rational. None of it should be necessary for a rule that doesn't touch code.


What a rule actually is

Most AI behavior tuning isn't algorithmic. It's policy. "Dismiss leads where the last activity is more than 90 days ago." "Escalate any ticket mentioning a compliance keyword." "Never suggest pricing to a prospect who hasn't had a discovery call."

These are rules a businessperson wrote, in language a businessperson uses. The reason they end up in prompts — embedded in long system messages that only engineers touch — is that there's no better place for them. The prompt is the only surface that the AI loads at runtime.

Engine rules change this. A rule is stored as a memory in Memory Stack. It's tagged for the agent or role that should load it. At session start, the agent retrieves all rules tagged for it. The rule is live.

No engineer in the loop. No PR. No deploy.


How it works in practice

We run this inside Operator Stack, which uses Memory Stack for its AI substrate. One agent — Clara — handles lead qualification. The team that runs Clara logs rules directly into Memory Stack when qualification criteria change.

A recent example: the team needed to tighten the Realscout lead dismissal threshold. The change was logged as a memory:

"Dismiss any Realscout lead where last activity > 90 days and no booked showing."

Tagged rule:clara. Saved. Clara's next session loaded the rule at init. From that session forward, Clara dismissed matching leads.

Time from "we need to change this" to "the change is live": the time it takes to type and save a rule. No ticket. No review cycle. No deploy. No thread to confirm nothing drifted.


The audit trail is built in

One concern with removing engineers from the loop: you lose the review discipline that comes with a PR. The diff, the reviewer, the merge timestamp — all of it creates an audit trail for how the AI's behavior changed over time.

Engine rules don't sacrifice this. Every rule load is logged with the rule ID, memory ID, user who created it, and timestamp. You can trace which rules governed any session — two weeks later, two quarters later.

If something goes wrong and you need to reconstruct what rules Clara was operating under on a specific date, the log is there. The rule is attributed to the person who wrote it, with the timestamp of every session it governed.

This is actually a stronger audit trail than a PR. A prompt change doesn't tell you which sessions ran under which version of the prompt. The rule citation log does.


The separation of concerns this creates

The right person owns the right thing.

Engineers own: the tools the AI has access to, the code that executes when the AI takes an action, the infrastructure that keeps it running.

Business owners own: the rules that govern what the AI should and shouldn't do, the thresholds, the escalation criteria, the scope constraints.

These have always been conceptually separate. Engine rules make them operationally separate. The person who understands the business rule is the one who sets it. They don't need to translate it into engineering language. They don't need to wait for a sprint.

When the team member who wrote the rule leaves, the rule stays — versioned, attributed, readable by whoever comes next.


Where this applies

Any AI that operates on behalf of a business function — not just code agents — needs behavioral guardrails that change at business pace, not engineering pace. Lead qualification. Email triage. Support ticket routing. Content approval workflows. Expense categorization.

The rules that govern each of these are owned by people who aren't engineers. Those rules change frequently — as often as the business criteria that drive them. Engine rules are the substrate that makes the right people the owners.


The honest version

Some changes still require engineers. Rules that depend on complex business logic, access to systems the AI isn't currently connected to, or behaviors that need new tools — those need code. Engine rules close the gap for policy changes that don't require new capabilities. That's most of what people mean when they say "we need to tune the AI."

The taxonomy of what's a rule vs. what's a code change is also something your team needs to establish. It's not automatic. But once the substrate is in place, the pattern becomes obvious quickly: if you can describe it in one sentence without referencing a code path, it's a rule.


Engine rules aren't a workaround. They're the correct model for who should own AI behavior in an org. Engineering builds the system; the people who run the business configure how it operates.

Give your AI tools persistent memory

Memory Stack gives every AI tool you use — Claude, Cursor, ChatGPT — access to the same shared context. No download, no key paste, no config file.

Start for free →