Skip to course content
Free LangChain course

LangChain for LLM Applications and RAG

Module 07 Activity

Scenario

A tool or two, and the question of whether you needed an agent at all.

What you build

Tools with model-facing descriptions and real validation, an enforced registry, bounded stopping conditions, and argument-level logging.

Steps

  1. Write one tool and check what the model actually sees: name, description, argument schema. Rewrite the docstring for the model.
  2. Put the guarantees in validation rather than the docstring, and test every refusal branch directly.
  3. Enforce a tool registry and include the real names in every rejection. Measure your invention rate.
  4. Implement all four stopping conditions and show which fires first on a tight loop.
  5. Log tool arguments as well as names, and find one wasted call caused by near-duplicate arguments.
  6. For each task in your system, decide chain or agent using the run-time-sequence test.

Evidence to hand in

Review checklist