learning-it by example

#229 Enterprise architecture and AI agents 5.5 min

A Reference Architecture for Enterprise AI Agents, as Code

I wrote a made-up agent platform down as data, planted three bad arrows among sixteen, and a check found all three.

1. In the Python agent platform architecture check, which calls does the layer rule allow?
2. In the Python architecture check of the made-up agent platform, how many of its sixteen calls broke a rule?
3. In the Python architecture check of the made-up agent platform, why did the search index calling the audit log break the rule?
4. What does the Python agent platform architecture check not verify?
5. In a layered enterprise AI agent platform, where should the controls be enforced?

Practice only: nothing is saved and no score counts towards anything. Each answer comes with the reason.

  1. Remove the refund shortcut

    Copy the code folder first. In arch.py, delete the line that lets refund_agent call order_tools directly. Predict how the number of calls and the number of broken rules change, then run python compare.py. When I ran it, there were 15 calls, 2 calls broke a rule, 1 call went around the gateway, and the diagram text was 37 lines.

    A hint

    The shortcut was one of the calls that went around the gateway to a resource.

  2. Plant a different shortcut

    In arch.py, replace the line where search_index calls audit_log with a call from planner to order_db. Predict what the check prints for it, and how many calls now go around the gateway. When I ran it, the new call was listed as skips 1 layer(s) and 3 calls went around the gateway. Start from a fresh copy of the original code folder, so the numbers match.

    A hint

    Count the layers between agents and resources. The control layer sits between them.

  3. Make web chat use the front door

    In arch.py, change the call from web_chat to llm_service so that web_chat calls gateway instead. Predict whether it passes the layer rule, then run python compare.py. When I ran it, the call was reported as skips 1 layer(s). Explain in one sentence why a call from the experience layer straight to the gateway still breaks the rule.

    A hint

    The layers in order are experience, agents, control and resources. A call may stay in its layer or go down to the next one only.

  4. Add a part and its calls

    Add a new part called email_service to the resources layer in the PARTS dictionary. Add one call from gateway to email_service and one call from support_agent to email_service. Predict the part count, the call count and which new call is reported, then run python compare.py. When I ran it, there were 14 parts and 18 calls, and the new support_agent call was reported as skips 1 layer(s). Start from a fresh copy of the original code folder, so the numbers match.

    A hint

    A call is only valid if it stays in its layer or goes down to the next layer.

These tasks are for you to try on your own machine. Nothing is checked or saved.

What this does not show

A made-up platform of thirteen parts with three planted violations and one layer rule. The script only prints and exits 0, and nothing checks that the data matches what is deployed.

Up next in Enterprise architecture and AI agents

More in Enterprise architecture and AI agents

All Enterprise architecture and AI agents videos

Related videos