#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.
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.
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.
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.
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
Related videos
- #248 TOGAF and ArchiMate: Where an AI Agent Fits, as Code Enterprise architecture and AI agents
- #230 Agent Gateway: One Front Door for Models, Tools, Agents Enterprise architecture and AI agents
- #241 C4 Diagrams for AI Systems, Written and Checked as Code Enterprise architecture and AI agents
- #242 Architecture Decision Records for AI Choices, With a Lint Enterprise architecture and AI agents
