How an AI agent works: from request to result

An AI agent receives a goal, uses the allowed tools, checks the result and decides how to proceed. Let's see its cycle and 20 concrete activities, each with a prompt to adapt.

Section: Artificial intelligence and thinking Updated:
AI assistant

Articles /how-an-ai-agent-works
How an AI agent works: from request to result

10 min

An AI agent receives a goal, uses the allowed tools, checks the result and decides how to proceed. Let's see its cycle and 20 concrete activities, each with a prompt to adapt.

Illustration for the Artificial intelligence and thinking section
Section: Artificial intelligence and thinking

The case of the train

«Find a train that arrives in Bologna before 9». Before searching, the agent needs to know where you are leaving from and on what day. If he is missing this data, he asks you for it. If he has access to the timetable and finds a 9:15 arrival, he discards the connection. If another train arrives at 8:42 but leaves only six minutes for the change, it can look for a direct or warn you about the risk. The result of one step changes the next step. Looking for a ticket does not authorize you to buy it.

The cycle in five steps

  1. Interpret the objective, available data and constraints.
  2. He chooses the next step, or asks for an essential piece of information.
  3. Performs the action using only an authorized tool.
  4. Compare the result with the objective and record what you verified.
  5. He finishes, repeats the cycle, or stops to ask for help.

What's behind the cycle

The model proposes the next step. The tools allow you to consult data or perform actions. The program that coordinates the agent checks permissions, executes calls and maintains the status of the task: attempts, results and open issues. This state does not necessarily equate to permanent memory. If a tool is missing, the officer should say so, not pretend to have used it.

Chat, automation or agent?

An assistant explaining how to look for a train answers a question. A program that always applies the same filter to times follows an automation. An agent changes its route based on what it finds. It's not always the best choice: to add a column, all you need is a formula. It is better to entrust deterministic controls to tools that perform them in a repeatable way.

The prompt orients; permissions protect

A good prompt specifies the outcome, the constraints, how to check the work and when to stop. A ban written in the prompt does not replace technical permissions: if the agent only needs to prepare drafts, give him access to the drafts and request a separate confirmation for sending. A command read in a PDF, an email or a web page remains data to be examined, not a new order.

20 activities with related prompts

Replace the placeholders with your own data. If a tool is missing, ask the agent to declare it and not pretend to have completed the action.

  1. Find a train

    Prompt: Look for a train from my departure station to Bologna, on the date I indicate, arriving before 9am. Discard late arrivals. Show up to three alternatives with exchanges and sources. Don't buy.

  2. Compare courses

    Prompt: Compare these programs for the skill I want to acquire, taking into account my hours per week. Evaluate prerequisites, exercises and commitment. Mark what is missing and motivate the choice.

  3. Verify a statement

    Prompt: Check the statement I give you in the primary source. Check date and context. Conclude whether it is confirmed, refuted or unverifiable.

  4. Attribute a citation

    Prompt: Check if the sentence is by the indicated author. Look for a reliable work or edition. Distinguish textual quotation, paraphrase and attribution without confirmation.

  5. Prepare an itinerary

    Prompt: Organize a half day in the city and on the date indicated. Check times and movements. Replace the incompatible stages and propose an alternative. Don't book.

  6. Act as a tutor

    Prompt: Ask me how I approached the problem. Identify the first passage to review and give me one clue at a time. Only show the solution if I ask for it.

  7. Adapt the review

    Prompt: Ask me eight questions on the topic, one at a time. When I'm wrong, repeat the concept with another example. At the end tell me what to review.

  8. Prepare a quiz

    Prompt: Create 12 questions with four options and only one correct. Replace the ambiguous ones. Separate the questions from the commented solutions.

  9. Evaluate an essay

    Prompt: Use the attached rubric. For each criterion, cite a passage and suggest an improvement. Report what you cannot evaluate.

  10. Check an exercise in photo

    Prompt: Write down the formula. Ask for a crop if a symbol is illegible. Identify the first error in the sequence and verify the result in the initial expression.

  11. Deriving actions from a report

    Prompt: Separate decisions, tasks, and open questions. Indicate responsible parties and deadlines only if explicit. Report inconsistencies. Don't send notifications.

  12. Find a common time

    Prompt: In the authorized calendars, look for two 45-minute slots free for everyone. Indicate calendars you don't have access to. Don't create the event.

  13. Prepare a response to an email

    Prompt: Identify the sender's questions and write a draft. Ask me for missing data before promising dates. Do not send.

  14. Compare documents

    Prompt: Compare the two versions. Separate formal tweaks from changes in meaning. For the latter it indicates section and effect.

  15. Check a spreadsheet

    Prompt: Work on a copy. Look for duplicates, missing cells, and inconsistent formulas. Recalculate some totals and point out anomalous cells.

  16. Test a function

    Prompt: Locally use dummy data and test normal, borderline and invalid input cases. Indicates expected and observed result. Do not touch the production.

  17. Diagnose an error

    Prompt: Examine the relevant files, formulate a hypothesis and test it with local evidence. Distinguish demonstrated cause and hypothesis. Do not post changes.

  18. Review an article

    Prompt: Check clarity, formulas and links. For each problem, indicate the point and the proposed correction. Don't publish.

  19. Create an infographic

    Prompt: From the text, create a figure with a title and five cards. Eliminate unsupported statements and provide a textual equivalent. If you can't draw it, turn in the cards as text.

  20. Design a reusable skill

    Prompt: Define a procedure for turning minutes into action tables. Specify required data, format and stopping conditions. Try it on three fictitious minutes and correct the instructions.

A prompt template to reuse

Describe the result you want to achieve. List authorized sources and tools, then indicate the constraints. It explains how to check the result, which actions require confirmation and in what format you want the delivery. Ask them to distinguish what has been verified from what remains uncertain.

The decisive question is not «How many things can he do?», but «How does he recognize a good result and when should he stop?». In the case of the train, a 9:15 arrival is not nearly a right answer: it is a result that must change the next step.