cd /news/ai-agents/ai-agent-architecture-5-questions-be… · home › topics › ai-agents › article
[ARTICLE · art-151054] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

AI agent architecture: 5 questions before writing code

A developer outlined a five-question framework for designing AI agent architecture before writing any code, covering task division between agents and programs, execution environment, available data, desired outcome, and result delivery. The approach is illustrated with an Instagram Direct AI sales assistant that splits responsibilities between Python, which enforces a conversation script and validates collected information, and Claude, which draws on instructions and a knowledge base to generate replies, with a human doctor confirming appointments routed to Telegram.

by read2 min views3 publishedOct 16, 2026

I always start an AI system's architecture by analyzing the problem we need to solve and the data we have. That determines which platform should run the automation and which tools to use

Choosing a solution means answering five questions

Who does what: an AI agent, a Python program, or a combination of solutions

Where the work happens: on a remote virtual private server (VPS), on a computer, or somewhere else

What data is available: where requests come from and which knowledge base the system can use

What result we want: an appointment, an inquiry, or another action

How we receive that result: where it arrives, in what form, and how often

These answers define the architecture: what each component does, where it runs, which data it receives, and what it passes on. The choice of tools follows their roles in that workflow

For example, my AI sales assistant for Instagram Direct uses this division of responsibilities. It needs both a natural conversation with the client and strict adherence to a script. The solution therefore combines Python code and Claude, each with a different job Python controls progress through the script: has all the required information been collected, and does the model's response stay within the defined boundaries? Claude uses its instructions and the knowledge base to determine what to say to the client

The conversation script and the knowledge base have different roles in this architecture. The script defines the workflow with the client and the information that must be collected. The knowledge base supplies the content for answers. Code and the model connect those parts: a natural conversation still has to follow the defined script

The other parts connect to the intended outcome as well: requests arrive through Instagram Direct, and the information collected during the conversation goes to the doctor as a card in Telegram. The appointment is created after the doctor's confirmation. A person therefore belongs in the workflow too, retaining that decision

This defines the AI system architecture: responsibilities are divided between code, the model, and a person; the required data and the path to the intended result are defined. And notice that all these decisions happen before the first line of code

── more in #ai-agents 4 stories · sorted by recency
── more on @claude 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/ai-agent-architectur…] indexed:0 read:2min 2026-10-16 · —