Back to all posts

Developer & technical insights November 30, 2026 5 min read

The Anatomy of a Myna Agent

by Yousef Borno CEO of Myna

The model is one part of your AI agent. The runtime around it does the rest. Next to it, a customer asks to move an appointment to Friday, the checks pass, and the agent confirms the new time.

When most people hear “AI agent,” they picture ChatGPT with a phone number. A customer types a question and gets a paragraph back. That’s fine for drafting an email, but it’s a bad way to run part of a business. A model on its own doesn’t know your prices, can’t touch your calendar, and will happily tell a customer they’re booked whether or not anything was booked.

A Myna agent uses the same kind of model, but the model is only one part of it. Here’s what the other parts are, and what happens to one message on its way through them.

The model is one part

At the center of every agent is a large language model. It’s what lets the agent understand “cn i come fri instead” as easily as a perfectly written email. What turns it into an agent is everything built around it: the tools it can use, the knowledge it can look up, what it remembers about each contact, and the rules it can’t break.

A model on its own turns a customer message into a text reply, with no tools, records or checks. A Myna agent has knowledge, memory, tools and rules around the model, so it moves the booking, updates the contact and then sends the reply

You see the difference the moment a customer asks for something real. A model on its own can only write a reply. A Myna agent can move the appointment, update the contact record, open a ticket or pass the conversation to your team, and then tell the customer what actually happened. Booking is just one example. Whatever you give an agent tools for, it can do.

What sits around the model

Every Myna agent runs inside the Myna Runtime. It has two parts:

  • The AI model reads the message, works out what the customer needs, decides what to do and writes the reply.
  • The control layer is ordinary software built around the model. It checks every message before the model sees it, gives the model only the information it needs, runs the tools, and checks every reply before it reaches your customer.

The Myna Runtime: messages from any channel pass the pre-gates, the AI model reads context modules and runs tools that return evidence, and the post-gates check the reply, with one repair, before it is sent on the same channel

The model never works alone. The control layer decides when it runs, what it sees and what happens to its answers. It works the same way on SMS, WhatsApp, email, webchat and every other channel, and there’s nothing to install. You don’t write a prompt either. You describe the job, pick a persona and switch on tools, and the runtime turns those choices into the right instructions for each step.

The whole idea fits in one line: use the model for judgment and language, and use software for anything that has to be certain.

Why not one big prompt?

A lot of agents are built on a single long prompt that holds the personality, the rules, the tool instructions, the prices and the formatting. It works on day one. Then the business adds rules and edge cases, the prompt keeps growing, and things start to slip. “Keep replies short” sits next to “explain every service in detail,” and the model picks which one wins. A rule about never confirming a booking early carries the same weight as a rule about emoji, and writing it in capital letters doesn’t change that. We wrote more about this in why giant prompts fail.

Myna splits that work apart. Instructions, persona, tool rules and knowledge are kept as separate modules, and each step only reads what it needs. The rules that always have to hold, like opt-outs and quiet hours, live in the software, so they never depend on the model remembering them.

One message, eight stages

Every message goes through the same eight stages, in the same order. Say a customer texts “Can I move my appointment to Friday?”

The eight stages in order: inbound, pre-gates, context, planner, tools returning evidence to the planner, composer, post-gates with one repair, and send

  1. Inbound. The runtime records who wrote, what they said and which channel it came from.
  2. Pre-gates. Code checks the message before any model runs.
  3. Context. The runtime pulls in only what this turn needs: your instructions, the persona, knowledge from Memory Hub, a summary of the conversation and the contact’s current record.
  4. Planner. The model works out what the customer wants and calls tools by name, reading each result before deciding the next step. It never writes a word the customer sees.
  5. Tool evidence. Each tool returns a record of what actually happened, like booked, Friday 10:00. That’s evidence, not a message.
  6. Composer. One reply gets written from that evidence only, in your persona’s voice and at the right length for the channel.
  7. Post-gates. Code checks the reply before it goes anywhere.
  8. Send. Only the runtime sends, and every turn is traced, so you can see the plan, the tool calls and the checks behind any reply.

The checks on both sides of the model

The pre-gates and post-gates are what make all of this predictable. They’re code, not prompt instructions, so they behave the same way every time.

The pre-gates catch duplicate messages, contacts who have opted out, conversations someone on your team has taken over, channel rules, message caps and business hours. If a check fails, the message is stopped or held, and no model ever runs.

Messages from every channel arrive at inbound and hit the pre-gates: duplicates, opt-out, takeover, channel, caps and hours. Blocked messages stop, deferred ones wait, and only messages that pass move on to context, before any model has run

The post-gates compare every claim in the reply with what the tools actually returned, and catch anything that would leak the agent’s internal instructions. A reply that fails gets one repair. If it fails again, the customer gets a safe, honest line instead. A booking that didn’t go through can never be reported as done.

The composer writes one reply from the tool evidence, the persona and the channel policy. The post-gates check its claims against the evidence and look for leaked instructions. A failed reply gets one repair, else a safe line, and only a reply that passes is sent

When rules conflict

Every rule in the runtime has a rank, and the higher one always wins.

Rules in order of rank: safety first, then truth and your instructions, then the channel, then the persona's voice

If staying in your persona’s playful voice would mean bending a fact, the fact wins. If a channel needs a shorter reply than your persona likes to write, the channel wins. Corrections you approve in the Playground can change how your agent words things, but never the facts it states.

The short version

  • The model understands and decides. The runtime controls everything around it.
  • Rules that must hold are code, checked before the model runs and again before anything is sent.
  • Replies are written from what the tools actually did, so a failed action never gets reported as done.
  • It works the same on every channel, and there’s no prompt to write.

If you want every stage in full detail, it’s all in the docs under The Anatomy of a Myna Agent.

Sign up free