OpenAI API and Agent Application Development
Lesson 3: Building Agents with Tools and State
Lesson Objectives
By the end of this lesson, students should be able to:
- Define agent goals, state, tools, and handoffs
- Keep deterministic business rules outside the model
- Limit loops, tool calls, time, and cost
- Escalate uncertainty and consequential decisions to humans
Lesson Content
An application agent combines a model with tools and state. State might include the current task, completed steps, retrieved evidence, tool results, and pending approval. Tools should be narrow, typed, authenticated, and observable.
Keep deterministic rules in code: eligibility, pricing, authorization, transaction limits, and record ownership should not depend solely on model judgment. Limit maximum turns, tool calls, runtime, and spend. Detect repeated actions and stalled loops.
Handoffs can route work to a specialized agent or human. A handoff should carry a concise, auditable state summary rather than the entire uncontrolled conversation. Escalate when evidence conflicts, confidence is insufficient, policy applies, or an external commitment is required.
Enroll to continue this lesson.
The preview above shows the lesson objectives and opening lesson content. Enroll to view the full lesson, complete the practice work, and take the lesson quiz.
