Skip to content
Courses/Production agents with LangGraph and n8n/State, memory, and controlled loops

State, memory, and controlled loops

A reliable agent doesn't "remember" by intuition—it stores state. It knows what task it's solving, what it has tried, what's missing, and when it should stop.

  • Separate context, memory, and execution state.
  • Design loops with limits, exit criteria, and recovery.
  • Avoid agents that repeat actions or lose track of the thread.

Recommended minimum state

Terminal
{
  "task_id": "inbox-2026-07-02-001",
  "intent": "crear_borrador_respuesta",
  "risk": "medium",
  "customer": "cliente@example.com",
  "attempts": 1,
  "approved": false,
  "next_action": "draft_email",
  "evidence": ["email original", "politica devoluciones"]
}

Healthy loops

  • Attempt limit: never retry forever.
  • Exit criterion: know when a response is sufficient.
  • Escalation: request human help when there's no confidence.
  • Idempotency: don't repeat external actions if the step has already been executed.
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue