---
title: "Claude Haiku 5.5 on Pydantic AI Geo Analyst"
description: "Spatial questions and SVG maps from raw earthquake, fire and place data in DuckDB. Tool calling 70%, code mode 80%; rank 17 of 20."
canonical: https://models.pydantic.dev/models/claude-haiku-5.5/geo_analyst/
---

# Claude Haiku 5.5 on Pydantic AI Geo Analyst

> Spatial questions and SVG maps from raw earthquake, fire and place data in DuckDB. Tool calling 70%, code mode 80%; rank 17 of 20.
>
> Markdown copy of https://models.pydantic.dev/models/claude-haiku-5.5/geo_analyst/. Index for agents: https://models.pydantic.dev/llms.txt

**Agents: use the API for model information.** It answers a question in one request, where the pages need several.

- Choose a model for an agent: `POST https://models.pydantic.dev/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://models.pydantic.dev/select.md
- Search models by name: `GET https://models.pydantic.dev/api/search?query=<text>`
- List, filter and sort models: `GET https://models.pydantic.dev/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://models.pydantic.dev/api/models/<slug>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of the first three. An `OPTIONS` request to any endpoint returns its schema. The same four are tools of the MCP server at `https://models.pydantic.dev/mcp`. More: https://models.pydantic.dev/usage.md

About the benchmark: https://models.pydantic.dev/benchmarks/geo_analyst.md. The model on every Pydantic AI benchmark: https://models.pydantic.dev/models/claude-haiku-5.5.md

| Mode         | Score | Tasks passed | Cost   | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ------ | -------- | ---------- | ------- |
| Tool calling | 70%   | 7 of 10      | $0.048 | 89       | 96         | 5.5 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed **15 of 20** runs: 7/10 with tool calling and 8/10 in code mode. Across both modes it used 157 requests and cost about $0.082. The only case it failed in both modes was `exposed`, where it returned 33 ids against 23 expected. The other three failures each happened in one mode only.

#### Where it does well

- **Data conventions:** It nearly always read DATA.md before querying. It applied the encodings correctly:
  - magnitudes stored as hundredths
  - `z` as negative metres
  - VIIRS = VJ1/VJ2
  - settlement kinds S/H/Q excluded
- **Disambiguation:** It chose Anchorage, AK over Kentucky, and Mato Grosso (BRA-602) over Mato Grosso do Sul.
- **Geometry and time:**
  - 3D hypocentral chord distances (`b_only_hypo`, `pair_map_hypo`)
  - antimeridian handling
  - exact two-pass nearest-neighbour search (`brazil_nn`)
  - civil-time conversion with `timezone(tz, t)` (`local_night`, 787 in both modes)
- **Heavy workloads:** `world_clusters` (680,723 detections, 45 clusters) passed in both modes. When the model hit a timeout or the nested-call limit, it recovered with grid joins and pointer jumping.
- **Self-checks:** It often checked uniqueness, for example 93,791 distinct fids.

#### Mistakes it makes

- **Unverified filters (main failure pattern):** In `exposed` (both modes) and `b_gof` (code mode), DATA.md output was truncated and the model never read the rest. It then guessed what `mk`, `k` and `rv` mean.
- **Accepting implausible results:**
  - In `b_gof` (code mode) it accepted a degenerate fit with N=1 and b=8.686 (expected 1.152).
  - In `exposed` it accepted false positives up to 39 km inside the distance limit.
- **Arithmetic slips:** In `cross_section` (tools) it used `asin` where `acos` was needed. That gave a section length of 8,938 km instead of about 1,070 km, and the output had 30 circles instead of 25. The query output showed the implausible length, but the model did not question it.
- **Precision loss:** In `pair_map_hypo` (tools) the feature set was right, but the model hand-typed the SVG with coordinates rounded to 0.1 px. Its earlier SQL had already produced 2-decimal values.
- **Wasted calls:**
  - In code mode it repeatedly tried `import duckdb` (`brazil_nn`, `mato_grosso`, `world_clusters`) or `subprocess`.
  - It made repeated BinderExceptions in `deep_moment` and left no-op queries in tool mode.

#### Tool calling compared with code mode

|          | Tools  | Code mode |
| -------- | ------ | --------- |
| Passed   | 7/10   | 8/10      |
| Requests | 89     | 68        |
| Cost     | $0.048 | $0.034    |

Code mode was more accurate, used fewer requests and cost less. Most of the gap comes from two cases:

- **`world_clusters`:** 27 requests ($0.0125) with tools vs 9 requests ($0.0053) in code mode, because code mode could loop the label-propagation passes.
- **`pair_map_hypo`:** with tools it failed after 14 requests ($0.0131); in code mode it passed in 11 requests ($0.006).

Code mode also fixed `cross_section`, where the model cross-checked the arc length against haversine (1,069 km). However, it lost `b_gof`, which tool mode got right.

On simple counting tasks (`deep_moment`, `mato_grosso`, `local_night`), tools were equal or slightly cheaper, at 3–7 requests each.

## Runs

### deep_moment

**Tool calling: passed.** The agent read DATA.md, then ran one filtered count query on quakes_a.jsonl: event kind T, magnitude type code 3, m>=500, z< -70000, and UTC time from 1 to 15 November inclusive. The query returned 7 events with 7 distinct ids, and the agent answered {"count": 7}, which matched the expected answer. ($0.0010, 3 requests, 9 s)
- Right: Read DATA.md before querying and applied its encodings: earthquake kind 'T', mk=3 for moment magnitude, magnitude stored ×100 (m>=500), and z as elevation in metres (z< -70000 for deeper than 70 km).
- Right: Used a half-open UTC window \[2026-11-01, 2026-11-16) on TIMESTAMPTZ values, so the whole of 15 November was included.
- Right: Compared count(\*) with count(DISTINCT id) to check for duplicate events.
- Right: Ran a GROUP BY on k and mk to confirm column types and the code distribution.
- Mistake: The check query ran alongside the main query rather than before it, so its results were not used to inform the filter. It did show data-quality quirks (1 row with mk NULL, 2 rows with mk=9) that the agent never looked into, though none would have matched mk=3.
- Mistake: The transcript shows no check that the question's dates should be read in UTC rather than local time. DATA.md was truncated in the result, so it is unclear whether the agent confirmed that convention.

### mato_grosso

**Tool calling: passed.** The agent read DATA.md, found Mato Grosso (BRA-602) in regions.tsv, and ran one spatial query counting fires with cls='H' and a UTC 21 November timestamp inside the state polygon. It got 5, which matches the expected answer. ($0.0010, 4 requests, 10 s)
- Right: It read DATA.md before querying and used its field names (cls, t, lon/lat) without separate schema probing.
- Right: Its name search returned both 'Mato Grosso' and 'Mato Grosso do Sul', and it correctly chose BRA-602 rather than the similarly named state.
- Right: It answered in very few calls by doing a single point-in-polygon query (ST_Intersects with ST_Point(lon, lat)) that combined the confidence filter and the date window.
- Mistake: The date filter compared to_timestamp(t), a timestamptz, against plain TIMESTAMP literals. This only works if the DuckDB session timezone is UTC, and the agent never set or checked it. The run did not show it confirming that the question's day convention is UTC rather than local time, so the result is somewhat implicitly dependent on defaults.
- Mistake: It did not check whether fires.parquet holds duplicate detections across the four satellites, or whether DATA.md requires a dedup convention. The answer still matched.

### b_only_hypo

**Tool calling: passed.** The agent read DATA.md, loaded both catalogues in DuckDB and parsed catalogue B's year-day dates and N/S/E/W coordinates. It then matched B events of M4.5 or more to A events within 30 s and within 50 km in 3D (straight-line distance from depth and radius), limited the count to the overlap window and answered 36, which is correct. ($0.0027, 5 requests, 16 s)
- Right: Read DATA.md before writing any queries.
- Right: Parsed catalogue B's '%Y-%j' date plus seconds-of-day, and its hemisphere-suffixed coordinates, correctly.
- Right: Computed hypocentral distance as a 3D chord using each event's depth (A's z in metres converted to km, B's depth in km), not plain surface distance.
- Right: Included A events of every class (no filter on k), as the question asks.
- Right: Limited the count to the period both catalogues cover, using A's actual min and max times (442 B events in that window), and reported 36, not the all-time 268.
- Mistake: The second run_sql call was a leftover query that built a CTE and returned only SELECT 1, so it did nothing useful.
- Mistake: The overlap window was set by hand to rounded bounds (16:00 to 15:36) instead of A's exact min and max times; it happened not to change the result.

### local_night

**Tool calling: passed.** The agent read DATA.md and loaded catalogue A and places. It filtered to type 'T' events with m>=250 (magnitude apparently stored in hundredths), excluded certain place kinds (S, H, Q), and found each quake's nearest settlement by haversine distance. Counting local hours >=20 or \<6 in that settlement's tz gave 787, which matches the expected answer. ($0.0018, 7 requests, 20 s)
- Right: Read DATA.md first and used its conventions (magnitude scaling, event type k='T', settlement kinds).
- Right: Used DuckDB timezone(tz, t) on the exact instant, so the misleading 15-degree offset in `t` was ignored in favour of civil time.
- Right: Ran a nearest-neighbour haversine join with QUALIFY row_number() to get one settlement per quake.
- Right: Sanity-checked that every quake got a tz and a distance (1804/1804, no nulls).
- Mistake: The first multi-statement run_sql returned only the last result, so two queries had to be re-run separately. This wasted calls but did no harm.
- Mistake: The brute-force cross join of 1804 quakes against about 150k places was heavy but worked.
- Mistake: The filters k='T', m>=250 and the excluded place kinds were applied without showing the documentation justification in the transcript. They were correct but not verified explicitly.

### brazil_nn

**Tool calling: passed.** The agent read DATA.md and loaded the regions, places and fires. It kept the VIIRS satellites (VJ1, VJ2), assigned fires to the 27 Brazilian divisions with ST_Intersects, and computed nearest-settlement haversine distances in two passes. It then took per-region medians, and the output matches the expected answer. ($0.0032, 7 requests, 25 s)
- Right: Read DATA.md before querying and applied its conventions: VIIRS = VJ1/VJ2, and places of kind S, H and Q excluded as non-settlements.
- Right: Checked that each fire was assigned to only one region (93791 rows, 93791 distinct fids).
- Right: Used an exact two-pass nearest-neighbour search. A ±1° latitude band gave an upper bound d1, then a band of width d1 searched the whole globe, so the answer is exact and spans all countries.
- Right: Used DuckDB's median, which averages the two middle values for even counts, and rounded to one decimal.
- Mistake: No significant mistakes. A minor point: the first pass assumes every fire has a big settlement within 1° of latitude. That held here (count(d1)=93791), but a fire with no match would have been silently dropped, and the agent did not check this against the number of fires.

### exposed

**Tool calling: failed.** The agent computed 3D hypocentre-to-place distances for catalogue A events with k='T', against places of 500k+ population, in a single cross-join query. It returned 33 ids, 10 more than the 23 expected (Shihezi, Bogor, General Santos, Sakai, Osaka, Kyoto, Kobe, Villa Nueva, Guayaquil, Cuenca). ($0.0026, 5 requests, 13 s)
- Right: Read DATA.md and loaded quakes_a.jsonl and places.psv into DuckDB.
- Right: Used a true 3D hypocentre distance (chord from radius 6371 + z/1000 against the surface point) rather than epicentral distance.
- Right: Applied the 10^(0.5M-0.7) threshold per event, and the result covered all 23 expected ids.
- Mistake: In the distance query, the event filter was only `k='T' AND m IS NOT NULL` with magnitude `m/100.0`. Several false positives sit far inside the limit (Sakai -39 km, Osaka -35 km, Kyoto -28 km, Guayaquil -26 km), so this was not a rounding problem at the boundary. The event set or magnitudes were wrong: probably some data convention was ignored, such as magnitude-type (mk) handling or excluding certain events.
- Mistake: The agent never inspected the codes it filtered on: it listed distinct mk values (1-4, 9) and k values (I, Q, S, T, U, X) but did not check how mk or the other fields should change magnitude or event eligibility.
- Mistake: It did not verify any match, for example by looking at the specific events behind Osaka or Kobe, before answering. It finished in one pass without sanity checks.

### b_gof

**Tool calling: passed.** The agent filtered catalogue A to tectonic events with magnitude type 1 (presumably ML) within 300 km of Anchorage, AK. It rounded magnitudes as integer tenths using floor((m+5)/10) and ran the goodness-of-fit Mc search in SQL. It found the first R≥85 at Mc=2.0 with b=1.152, which matches the expected answer. ($0.0022, 5 requests, 16 s)
- Right: Read DATA.md first and spotted that magnitudes are stored as integer hundredths and that mk codes the magnitude type.
- Right: Picked the correct Anchorage (pid 5879400, pop 289600, AK) over the Kentucky one.
- Right: Used integer arithmetic for half-up rounding (floor((m+5)/10)), which avoids floating-point rounding problems.
- Right: Computed every candidate Mc in one SQL query with the specified formulas and identified Mc=2.0 (R=89.5) as the first with R≥85.
- Right: Answered efficiently in a few calls.
- Mistake: It added a k='T' filter (tectonic only) and assumed mk=1 means local magnitude without showing a check against DATA.md in the transcript. The result matched, so this was probably correct, but it went unverified.
- Mistake: The predicted-count grid ran from j=-15 to 44 using hard-coded bounds rather than bounds derived from the data. This was fine here but fragile.

### world_clusters

**Tool calling: passed.** The agent filtered the fires to VIIRS (VJ1+VJ2, 680,723 detections). It built spatio-temporal edges with grid and time-bucket keys and a haversine distance of 1 km or less, then ran iterative min-label propagation in SQL until no edge crossed two labels. It reported all 45 clusters of 300 or more detections with counts and FRP in MW, and every value matched the expected answer. ($0.013, 27 requests, 2.0 min)
- Right: Read DATA.md and checked the satellite codes. It kept only VJ1/VJ2 as VIIRS (375 m pixels) and left out the MODIS MT/MA records.
- Right: Converted frp_kw to MW by dividing by 1000 and rounded to one decimal place.
- Right: When the first self-join timed out, it switched to a keyed equi-join on 0.05° cells plus 12 h time buckets with neighbour offsets. This produced 1.87M edges without missing any pairs. Longitude wrap was handled with mod 7200.
- Right: Used label propagation with pointer jumping (lab lj on lj.fid=l.l), which sped up convergence.
- Right: Checked convergence properly by counting edges whose endpoints had different labels and continued until that count was 0, rather than only watching the number of changed labels.
- Mistake: The label-propagation passes were issued as many separate repeated calls. A single recursive or looped approach would have used fewer requests, but the result was not affected.
- Mistake: One call (the 'having 1=0' / 'where 0=1' query) was a confused no-op check, which wasted a step.

### cross_section

**Tool calling: failed.** The agent computed a cross-track/along-track projection in DuckDB and wrote an SVG with 30 circles. It used asin instead of acos for the end-to-end angular distance, so the section length came out as 8,938 km instead of about 1,070 km. That wrong length shrank every x position about 8.4 times and let 5 out-of-range events through the 'between the end points' filter. ($0.0078, 12 requests, 38 s)
- Right: Read DATA.md first and filtered catalogue A to events with a non-null magnitude.
- Right: Set up the great-circle frame correctly: unit normal from the cross product, cross-track distance as asin(p·n), along-track angle as atan2(p·e2, p·a).
- Right: Converted depth correctly from the negative elevation z in metres (y = -z/1000 × 500/700); the y values match the expected ones (e.g. 398.39 vs 398.394).
- Right: Wrote a valid SVG with width/height 1000×500, circles of radius 3, and data-id only on circles.
- Mistake: When building table gc, it set D = asin(cx*ax+cy*ay+cz\*az). The dot product is the cosine of the angle, so it needed acos. asin gave 1.403 rad (8,938 km) where the true value is about 0.168 rad (about 1,070 km).
- Mistake: Because D was far too large, the 'along BETWEEN 0 AND D' filter let in 5 events beyond the 17°S 174°W end point (us7000ttnt, ttfc, twus, ty7h, twgs). It drew 30 features instead of 25.
- Mistake: All x values were scaled by the wrong D. For example, us7000tx0f was placed at x=6.65 instead of 55.611, and the drawn points spanned only about x=6–147 instead of 55–686.
- Mistake: It never sanity-checked D_km=8938.5, which the query output showed. That is implausible for two points only about 6° of latitude and 8° of longitude apart, and it would have exposed the bug.
- Mistake: It also filtered on k='T' without showing that the question required it. That made no difference to the result here.

### pair_map_hypo

**Tool calling: failed.** The agent filtered both catalogues to tectonic events in the overlap period and area, found 67 one-to-one pairs using 3-D hypocentre distance, and wrote an SVG with 158 circles. The visible ids and positions match the expected answer, but coordinates were rounded to 0.1 px and the run was marked failed. ($0.013, 14 requests, 66 s)
- Right: Read DATA.md first and parsed catalogue B's day-of-year date, seconds-of-day time and N/S/E/W hemisphere coordinates correctly.
- Right: Restricted both catalogues to class T and to the overlap window starting at catalogue A's first event (2026-10-26 16:02).
- Right: Handled the area crossing the 180° meridian with (lon >= 160 OR lon \<= -170), and shifted negative longitudes by +360 for projection.
- Right: Built candidates from 3-D hypocentre distance with depth, and checked that the 67 candidates had 67 distinct A ids and 67 distinct B ids, so greedy matching was trivially satisfied.
- Right: Computed great-circle midpoints by averaging unit vectors.
- Right: Used a projection with 30 px per degree that matches the expected coordinates.
- Right: The feature set (67 pair midpoints, 67 unmatched A, 24 unmatched B with magnitude >= 4.5, total 158) matches the expected ids in the visible part of the output.
- Mistake: In the final write_file call the agent wrote coordinates rounded to 1 decimal (e.g. cx="641.7" for expected 641.67, cx="252.8" for 252.75, cy="513.4" for 513.39). Its earlier SQL had already produced 2-decimal values, and it should have written full precision. This rounding is the most likely reason for the failure; everything checkable otherwise matches.
- Mistake: It typed the SVG by hand into write_file instead of writing the generated string directly, which risks transcription errors. Only part of the file is visible, so the rest cannot be verified.
- Mistake: It never checked whether catalogue A contains repeated ids with different revisions (the rv field). The result happened not to need this.
