An agentic system is software where an LLM decides the next step in a loop: think, call a tool, read the result, repeat. In architecture terms, the agent is just a component that needs clear boundaries, like any other service. Give it a small set of explicit tools, because every extra tool increases the chance of wrong calls and makes behavior harder to test. Always add hard limits such as a maximum number of steps, a timeout, and a budget, so a confused agent cannot run forever. Log every tool call and result as an architecture concern, because this trace is your main way to debug and audit what the agent did.
Simple example: a support agent
Situation: a customer writes „Where is my order 123?“. The goal is that an agent finds the order and sends the customer an email.
How to read the code below: it is short Python-style pseudocode, not a file you run. It only shows the shape of the agent loop. The functions llm.decide, search_orders and send_mail are placeholders for your own code.
MAX_STEPS = 5 # rule 1: hard limittools = {"search_orders": search_orders, "send_mail": send_mail} # rule 2: only these 2 tools existfor step in range(MAX_STEPS): action = llm.decide(goal, history, tools.keys()) # LLM picks the next step if action.name == "finish": break result = tools[action.name](**action.args) # run the chosen tool history.append((action, result)) # rule 3: keep a trace

Kommentar verfassen