# Section 2 summary: Understand How AI Agents Work (Models, Tools and Memory)

## The model and the app

The model is the part that interprets your request and works out a response. Sonnet and Opus are models inside Claude. Claude, ChatGPT, Gemini, Claude Code and Codex are apps, and the app decides which files and actions the model can use. That is why an AI can explain how to change a spreadsheet and still leave the file untouched: the app also needs a way to open and save the file, and you need to allow the change. Choosing a different model does not add that access.

## Tools, connectors and permissions

A connection to a service such as Google Calendar offers separate tools for separate actions. In the lecture, get_event reads an event, create_event creates one and update_event changes one. Claude calls these connections connectors, and Codex offers them through its plugin catalog. Before asking an agent to book something, check that the conversation can use the tool and that the connected account allows changes. Afterwards, open the calendar and check that the event is there at the right date and time.

## APIs

An API, short for application programming interface, is the agreed way programs request information or actions from a service. For the supplier call, software sends the date, start and end time, title and calendar to Google Calendar. If the details and permissions are valid, Google Calendar creates the event and sends back its details, which is what lets you check the result. If the request is rejected, the software should report an error, not a booking.

## Look, Think, Do and Check

These 4 moves describe a run you watched. Look is the information the agent used, such as returned search results. Think is the choice it made, such as which plans to investigate. Do is the action, such as sending searches and producing a table. Check is comparing the result with its source, such as opening the provider's pricing page. A source link makes the check possible but does not show it was done. When a result leads the agent to choose another action, that repetition is often called an agent loop.

Daniel's invoice reminders show the same moves in ordinary work: read the payment records and client messages, apply the firm's rules, write the drafts, then compare each amount with the payment record and each message with the rule before anything is sent.

## Context, the context window and memory

Context is the information supplied to the model for the reply it is writing now, such as the client's message and the company's instruction. The context window is how much the model can work with at once, measured in tokens, which are whole words or parts of words. When space runs low, Claude Code can shorten earlier conversation into a summary. That is compaction, and it can drop a detail such as an approval rule. The original files stay where they are, so the agent can read them again. A rule you want for future work can go in CLAUDE.md, the project instruction file Claude Code reads when it starts. Keeping information for later use is commonly called memory.

## LLMs and hallucinations

A large language model, or LLM, learned patterns from large amounts of text and writes its response a token at a time using those patterns and the current context. A fluent answer can still contain a made-up fact, often called a hallucination. For a fact you will act on, such as a software price, compare the answer with the page it should come from.

## Inputs, outputs and choosing a model

Start with the information the job needs (the input) and the result you want (the output). A receipt total needs the picture. A meeting summary can use a transcript, but a question about someone's tone needs the audio. The model must support the input and output, and the app must pass them through.

To choose between models, look at how well they handle the work, what using them costs and how long you wait. Benchmarks such as those on Artificial Analysis help you pick candidates. API prices are quoted per million input and output tokens, while a subscription has its own usage limits shown in your plan's usage information. Time to the first answer token and output speed describe the wait, and the whole job also includes reasoning tokens, tool waits and the time you spend correcting the answer.

## Comparing models on your own job

Give both models the same folder, the same request and the same checks. In the invoice comparison, a correct answer sends Harbor & Pine a courteous reminder for the remaining 1,800 dollars, sends Northline a firmer request for a payment update, sends no reminder for the paid Willow Ledger invoice and leaves the disputed Seaglass invoice with a person. If both models pass, compare waiting, corrections and the usage the app reports for each conversation, and try a few more examples before relying on your choice.

## Switching models and switching apps

Inside the same app, your files, saved preferences and connections may stay available when you change models, because the app manages them. Test the new model on the same job anyway. Moving to another app is a separate check: you may need to reconnect services and supply your instruction files again.
