Skip to content
/

What's next

Production patternsChapter 14 of 141 min read

Review key architectural principles demonstrated by the contract review crew and explore advanced production extensions.

Architectural takeaways#

Each pattern introduced in this course directly remediates a common failure mode in LLM applications:

  • Grounding over parametric guessing: Equipping agents with file reading tools prevents ungrounded assumptions about document contents.
  • Specialized review loops: Distributing extraction, analysis, and verification across distinct agents eliminates self-confirmation bias.
  • Schema enforcement: Constraining outputs with Pydantic models eliminates markdown parsing failures and delivers typed data objects.
  • Deterministic arithmetic: Offloading date, financial, and numerical calculations to unit-tested Python functions prevents hallucinated math.

Core architectural rule: Use language models for semantic comprehension, extraction, and synthesis; use deterministic Python code for mathematics, dates, and schema validation.

Next challenges#

Extend your agentic system with these production patterns:

  1. Adversarial role testing: Update the risk analyst persona to represent vendor counsel and contrast the identified terms against buyer priorities.
  1. Hierarchical orchestration: Replace Process.sequential with Process.hierarchical and introduce a manager agent to delegate tasks dynamically.
  1. Custom task guardrails: Implement validation callbacks that reject draft memos omitting specific contract section citations.
  1. Financial arithmetic tools: Build a service level credit calculator that computes contractual penalties based on uptime logs.
  1. Batch contract processing: Use kickoff_for_each to parallelize evaluations across an entire directory of agreements.