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

Chapter Study Guide

Data Analysis & Reasoning Agents

Information is the oil of the 21st century, and analytics is the combustion engine.

— Peter Sondergaard

A higher tier of cognition — digital analysts that don't just execute, but question assumptions and synthesize knowledge. Three agent types: the Data Analysis agent (raw data → insight), the Verification & Validation agent (the internal auditor), and the General Problem Solver (meta-reasoning across domains).

3 agent types3 statistical functionsNLI fact-checking15 quiz questions
01The Data Analysis agent

From question to reproducible workflow

It turns a linguistic prompt into a reproducible computational workflow within a single conversational turn — closing the gap between asking and answering. Its cognitive loop:

1

Intent analysis & planning

The LLM reasoning core extracts analytical intent and temporal scope, then formulates an explicit analytical plan.

2

Code formulation & execution

The plan becomes Python/SQL (Pandas); a Code Interpreter runs it against the dataset.

3

Visualization & analysis

A visualization engine picks the chart from linguistic cues (bar/line/scatter) and highlights trends and outliers.

4

Presentation & refinement

Delivers a visual + natural-language summary; follow-up queries reactivate the loop.

Key concept · Three statistical-reasoning functions

  • Descriptive statistics & summarization — mean, median, variance, correlation as the quantitative foundation
  • Inferential & diagnostic analysis — hypothesis testing (t-tests, chi-squared) and regression, reported in plain language
  • Anomaly detection & uncertainty quantification — z-scores, IQR, confidence intervals; proposes mitigation (interpolation, scaling)

It runs as a hybrid of symbolic (LLM) and numerical (Pandas/NumPy/Statsmodels) computation — the LLM interprets intent and forms hypotheses; libraries do the precise math.

02Verification & Validation agent

The system's internal auditor

Generating insight is half the challenge; trusting it is the other half. This agent adds a meta-reasoning layer that examines how a solution was produced, on two fronts:

Key concept · Fact-checking with NLI

Decompose a statement into discrete verifiable claims (each a hypothesis), retrieve evidence from trusted sources, then apply Natural Language Inference (NLI) models to classify the evidence–claim relationship as Supports (entailment), Refutes (contradiction), or Neutral. Conflicting sources are weighted by credibility into a confidence score.

Logical coherence catches recurring reasoning errors: premise–conclusion mismatch (answer contradicts a stated assumption), circular reasoning (a step reuses the claim it's proving), and scope violations (a segment finding generalized to the whole). Technique: decompose the reasoning chain into a directed graph of claims, check each edge for valid inference, and use a symbolic solver like SymPy to independently recompute numeric results.

03The General Problem Solver

Meta-reasoning across domains

The most ambitious design: not optimal in one domain, but a foundation for generalized reasoning — transferring knowledge between contexts and inventing strategies for unseen problems. It runs on meta-reasoning: reasoning about its own reasoning, spotting gaps, and refining its approach. Three modules form its core: planning (objectives & constraints), reasoning (evaluate actions on logical/statistical evidence), and learning (update strategies from experience).

Key concept · The cognitive cycle

1 · Problem formulation (define objective & constraints) → 2 · Strategy generation (analogical reasoning / search over solution paths) → 3 · Evaluation & adaptation (test against success criteria, adjust). The central tension is generality vs. precision — resolved with meta-learning and self-evaluation loops that build a reusable library of cognitive strategies over time.

Test yourself

Chapter 8 quiz

Fifteen questions on data analysis, verification, and general problem solving. Answer first, then expand Show answer.

Part A · Multiple choice

Q1

In a Data Analysis agent, which component executes the generated Python/SQL against the dataset?

  • A The visualization engine
  • B The Code Interpreter
  • C The NLI model
  • D The reasoning core
Show answer

B — the Code Interpreter. It runs the plan (often Pandas) against a CSV, database, or warehouse.

Q2

Which statistical-reasoning function covers hypothesis testing (t-tests, chi-squared) and regression?

  • A Descriptive statistics & summarization
  • B Inferential & diagnostic analysis
  • C Anomaly detection
  • D Visualization recommendation
Show answer

B — inferential & diagnostic analysis. It assesses whether observed patterns are statistically meaningful and quantifies relationships between variables.

Q3

An NLI model classifies the relationship between evidence and a claim into which three categories?

  • A True / False / Unknown
  • B Supports / Refutes / Neutral
  • C High / Medium / Low
  • D Valid / Invalid / Circular
Show answer

B — Supports (entailment) / Refutes (contradiction) / Neutral. Conflicting sources are then weighted by credibility into a confidence score.

Q4

Concluding revenue increased right after noting a decline in unit sales with stable pricing is an example of which logical error?

  • A Circular reasoning
  • B Scope violation
  • C Premise–conclusion mismatch
  • D Anomaly
Show answer

C — premise–conclusion mismatch. The final answer contradicts a stated assumption.

Q5

The General Problem Solver operates primarily on which principle?

  • A Stimulus–response mapping
  • B Meta-reasoning (reasoning about its own reasoning)
  • C Keyword matching
  • D Fixed rule execution
Show answer

B — meta-reasoning. It evaluates its approach dynamically, identifies gaps, and refines strategy rather than following fixed rules.

Part B · True or false

Q6

A Data Analysis agent's statistical layer is purely numerical, with no symbolic reasoning.

Show answer

False. It's a hybrid — symbolic reasoning (the LLM) interprets intent and forms hypotheses; numerical libraries (Pandas/NumPy/Statsmodels) do the precise computation.

Q7

The Verification & Validation agent adds a meta-reasoning layer that examines how a solution was produced.

Show answer

True. A two-level design: the primary agent solves; the validation layer reviews intermediate steps, data dependencies, and consistency.

Q8

A symbolic solver such as SymPy can independently recompute derived quantities to check the agent's numbers.

Show answer

True. For numerically intensive analyses, SymPy recomputes results and compares them against the agent's stated output.

Q9

The General Problem Solver aims for optimal performance in a single narrow domain.

Show answer

False. Its purpose is generalized, flexible reasoning that transfers across domains — not optimality in one area.

Q10

Excessive flexibility in a General Problem Solver can reduce consistency, so it uses meta-learning and self-evaluation to balance generality with precision.

Show answer

True. Self-evaluation loops identify which strategies perform best per context, building a reusable library over time.

Part C · Short answer

Q11

Name the four stages of the Data Analysis agent's cognitive loop.

Show answer

Intent analysis & planning → code formulation & execution → visualization & analysis → presentation & refinement (a closed feedback loop).

Q12

Name the three statistical-reasoning functions.

Show answer

Descriptive statistics & summarization; inferential & diagnostic analysis; anomaly detection & uncertainty quantification.

Q13

Name three recurring logical errors the validation agent checks for.

Show answer

Premise–conclusion mismatch, circular reasoning, and scope violations — detected by decomposing the reasoning chain into a directed graph and checking each edge.

Q14

What are the three modules of the General Problem Solver core?

Show answer

Planning (objectives & constraints), reasoning (evaluate actions on evidence), and learning (update strategies from past experience).

Q15

Outline the General Problem Solver's three-stage cognitive cycle.

Show answer

Problem formulation (define objective & constraints) → strategy generation (analogical reasoning / search over paths) → evaluation & adaptation (test against success criteria and refine).