Free lesson · Module: Agent Foundations

Hello, API

Every call starts from scratch

A program talks to a model through an API: it sends text over the network and gets an answer back. One such exchange is a call. The server remembers nothing between calls. In a chat the model seems to remember. In fact the app resends the whole conversation every time. In your agent, the tool loop will do that.

Who says what: roles

A call carries a list of messages, each with a role. The user role is the human’s words. The assistant role is the model’s earlier replies; you send them back so it sees the whole conversation. The system prompt goes separately: a standing instruction in the system parameter. For example: “You help a travel agency. Keep answers short.”

More on Way of the Agent

Still in this lesson: 3 more cards, a quiz of 5 questions, XP and stars - in the course.

Continue the lesson on the Path