← 30 Agents Every AI Engineer … Latent Shelf · Ch.14

Chapter Study Guide

Financial & Legal Domain Agents

The measure of intelligence is the ability to change.

— Albert Einstein

A different game: a single compliance failure can trigger fines, sanctions, or criminal liability. Every recommendation must trace to its sources and withstand audit. Two production-grade agents — the Financial Advisory agent and the Legal Intelligence agent — where compliance is architecture, not a feature added later.

2 domain agents4 risk typescitation verification15 quiz questions
01Financial Advisory agent

A supervised multi-agent system

Market data lives or dies by sensing what's happening now. The reference architecture is a supervised multi-agent system: a supervisor routes queries to specialists — a Market Data agent, a Financial Analysis agent (portfolio beta, Sharpe ratios, sector correlation), and a News agent — coordinated through an explicit control layer (LangGraph) that locks the topology, enforces tool permissions, requires human checkpoints, and attaches an audit trail. This separation of concerns simplifies testing and regulatory audit.

Key concept · Risk assessment (three stages)

Risk is where trust is earned or lost. A framework weaves together four risk types — market, credit, liquidity, and operational — each evaluated against the client's portfolio and tolerance, in three progressive stages: 1) specialist agents monitor real-time price, volume, and sentiment; 2) statistical models translate signals into calibrated risk scores; 3) scored risks map onto each client's profile for personalized, suitable recommendations — with a feedback loop back into market analysis.

The cautionary tale: Knight Capital (2012) lost ~$440M in 45 minutes when a config error unleashed unintended trades — “speed without safeguards is not an advantage, it is a liability.” Every compliance gate, risk threshold, and human checkpoint exists to prevent exactly that.

02Legal Intelligence agent · precedent

Citation verification is survival

In 2023, attorney Steven Schwartz filed a ChatGPT-written brief citing cases that never existed and was sanctioned — after which courts required attorneys to personally verify AI citations. So citation verification is not a nice-to-have; it's a professional survival requirement. The precedent-finding pipeline runs in three stages:

RETRIEVE

Hybrid retrieval

Combine semantic search with citation-graph search to surface analogous cases across jurisdictional hierarchies.

VERIFY

Citation verification

Cross-reference each cited authority against the knowledge base — checking jurisdiction, precedential status, and whether it's still good law — guarding against hallucinated precedents.

SYNTHESIZE

Rank & analyze

Score precedents by a composite of 0.5 semantic similarity + 0.3 authority level + 0.2 recency — conceptual relevance is primary; authority and recency are tie-breakers.

03Legal Intelligence agent · contracts

Compliance as a gate, not a post-step

Contract analysis combines structured document processing with clause-level legal reasoning, as a sequential pipeline with parallel validation: document ingestion → clause extraction & classification → risk flagging → compliance validation → structured summary for attorney review.

Key concept · Validation that runs in parallel

The decisive architectural point: compliance validation runs in parallel at every stage as a gate, not a post-processing step. This lets the system reject unsafe outputs early and confirm required clauses are present before any summary reaches counsel — the same compliance-by-architecture discipline as the financial agent's risk gates.

Across both domains, the winning patterns are refinements of earlier chapters — multi-agent coordination, memory, RAG, compliance reasoning. The difference is rigor: in regulated industries, compliance is designed in from the start, not bolted on once the agent “works.”

Test yourself

Chapter 14 quiz

Fifteen questions on financial advisory and legal intelligence agents. Answer first, then expand Show answer.

Part A · Multiple choice

Q1

The Financial Advisory agent is structured as which kind of architecture?

  • A A single monolithic LLM call
  • B A supervised multi-agent system with specialized sub-agents
  • C A rule-based expert system
  • D A static BI dashboard
Show answer

B. A supervisor routes queries to a Market Data agent, a Financial Analysis agent, and a News agent through an explicit control layer with an audit trail.

Q2

Which four risk types must a comprehensive financial risk framework weave together?

  • A Market, credit, liquidity, operational
  • B Legal, ethical, technical, reputational
  • C Systematic, unsystematic, currency, political
  • D High, medium, low, none
Show answer

A — market, credit, liquidity, and operational risk, each evaluated against the client's portfolio and tolerance.

Q3

What does the Knight Capital 2012 incident illustrate?

  • A The value of faster trading
  • B That speed without safeguards is a liability, motivating compliance gates and checkpoints
  • C The benefits of monolithic architectures
  • D That audit trails are optional
Show answer

B. A config error caused ~$440M in losses in 45 minutes — the canonical warning that every risk threshold and human checkpoint exists to prevent cascading failure.

Q4

In the precedent-ranking function, which factor carries the highest weight (0.5)?

  • A Authority level
  • B Recency
  • C Semantic similarity
  • D Citation count
Show answer

C — semantic similarity (0.5). Conceptual relevance is primary; authority level (0.3) and recency (0.2) serve as tie-breakers.

Q5

In the contract-analysis pipeline, where does compliance validation run?

  • A Only at the very end, as post-processing
  • B In parallel at every stage, as a gate
  • C Only during clause extraction
  • D Never — attorneys handle it manually
Show answer

B — in parallel at every stage, as a gate. This rejects unsafe outputs early and ensures required clauses are present before a summary reaches counsel.

Part B · True or false

Q6

In regulated domains, compliance is best added as a feature after the agent works correctly.

Show answer

False. Compliance is designed in from the start — “compliance-by-architecture.” The difference between these domains and permissive ones is rigor.

Q7

Citation verification checks whether a cited case is still “good law.”

Show answer

True. Each authority is cross-referenced for jurisdiction, precedential status, and whether it remains good law — guarding against hallucinated or overturned precedents.

Q8

The Legal Intelligence agent uses hybrid retrieval combining semantic search with citation-graph search.

Show answer

True. Semantic search captures conceptual relevance while citation search captures structural authority — together reducing the risk of missing relevant precedent.

Q9

The financial risk pipeline is strictly one-directional, with no feedback from recommendations back to analysis.

Show answer

False. The recommendation stage feeds performance data back into market analysis, enabling continuous model refinement as conditions evolve.

Q10

The Steven Schwartz case demonstrated that AI-generated legal citations can be fabricated and must be personally verified.

Show answer

True. ChatGPT produced confident citations to non-existent cases; the attorney was sanctioned, and courts now require verification — making citation checking a survival requirement.

Part C · Short answer

Q11

Name the three specialist sub-agents coordinated by the financial supervisor.

Show answer

The Market Data agent, the Financial Analysis agent (beta, Sharpe ratios, sector correlation), and the News agent — coordinated by a supervisor through an explicit control layer with an audit trail.

Q12

Outline the three progressive stages of the risk-assessment architecture.

Show answer

1) Monitor real-time price/volume/sentiment signals; 2) translate signals into calibrated risk scores via statistical models; 3) map scored risks onto the client's investment profile for personalized recommendations (with feedback).

Q13

Name the three stages of the legal precedent-finding pipeline.

Show answer

Retrieval → verification → synthesis (hybrid retrieval, then citation verification for “good law,” then ranked analysis).

Q14

Give the composite precedent-ranking weights and what they favor.

Show answer

0.5 semantic similarity + 0.3 authority level + 0.2 recency — favoring conceptual relevance, with authority and recency as configurable tie-breakers.

Q15

List the stages of the contract-analysis pipeline.

Show answer

Document ingestion → clause extraction & classification → risk flagging → compliance validation → structured summary, with compliance validation running in parallel as a gate throughout.