# GeoProof architecture Public architecture notes for GeoProof and its demo client, ProofSimple. Written for people who build geospatial software. Prepared for the CUGOS talk on November 18, 2026. Questions and corrections: adam@mapsimple.org. ## Overview GeoProof is an MCP server that answers GIS questions from its own local index. Every answer comes back in one fixed structure, the envelope, which carries the result plus five values: accuracy, completeness, freshness, provenance, and authority. What it is: - A server an AI client calls through the Model Context Protocol. The client sees 18 typed functions. - A read-only index, built ahead of time from source services and files, with every dataset reprojected once into one working coordinate system. - Deterministic. The same call against the same data returns the same answer. What it is not: - It is not an AI. There is no AI model anywhere in the answer path. The AI lives in the client app. It reads the question, picks a function, and writes the reply. Everything past the function call is ordinary code. - It is not a live proxy to the source services. Questions are answered from the index, and each answer says how old that data is. - It is not a map viewer or a general SQL endpoint. A client can only ask the named questions the functions offer. Three ideas run through the design: 1. **Builds are whole and read-only.** Data goes through a fixed set of checks into a new index file. Nothing ever writes to the file that is serving. 2. **One home for each kind of truth.** Exact spatial math lives in one geometry module over GEOS. The storage layer only ever returns candidates. Source declarations live in configuration. 3. **The caveat wins.** Where a shortcut would give a cleaner looking answer by dropping a caveat, the caveat stays. ## Design Two views of the same system. The logical design shows the parts and what flows between them. The physical design shows what each part runs on. ### Logical design ![Logical design: configuration, build, the index, and the answer path](design-logical.svg) One configuration file declares the sources, the rules, the hidden layers, and the accuracy and authority of each source. The build reads each source through a source reader, runs every check, and promotes the finished index as a whole file. The answer path reads only that index. Its rule engine resolves the location, applies jurisdiction gates, hidden layers and the overlap rule, uses GEOS for the exact math, and builds the envelope that goes out through the MCP endpoint's 18 functions. ### Physical design ![Physical design: the door, the console, build workers, storage, and pipelines](design-physical.svg) Everything runs in Azure, in West US 2. The AI models are reached through Azure in West US and West US 3. | Piece | Azure service and SKU | Size | List price a month | |---|---|---|---| | The door | Virtual Machine, `Standard_D2ads_v7`, Gen 2, Trusted Launch | 2 vCPU, 8 GB, Ubuntu 24.04 LTS from a baked image | $83 | | Door disk | Premium SSD, P4 | 30 GB | $4.80 | | Door load balancer | Load Balancer, Standard, regional | HTTPS only from allowed callers | not priced | | Door public address | Public IP, Standard, static | | $3.65 | | The console | App Service `B3`, Basic, Linux, Python 3.12 | 4 vCPU, 7 GB | $49 | | ProofSimple | App Service `P0v3`, Premium v3, Linux, Node 22, with a staging slot | 1 vCPU, 4 GB | $57 | | Build and audit workers | Container Apps jobs, dedicated `E4` profile, scale 0 to 1, queue-triggered, 6-hour limit | 4 vCPU, 28 GiB per job | about $0.54 an hour while running | | Shared file store | Azure Files Premium, SMB | 100 GiB | $16 | | Queue and tables | Storage, StorageV2, Standard LRS | | cents | | Secrets | Key Vault, standard | | cents | | Monitoring | Log Analytics and Application Insights, 30-day retention, 1 GB a day cap | | $2.30 per GB | | AI for ProofSimple | Azure OpenAI, `S0`, GlobalStandard, 1,000,000 tokens and 1,000 requests a minute | | about half a cent per answer | | AI for Tiro | Azure AI Services, `S0`, GlobalStandard, 25,000 tokens a minute. A small, fast model today; moving Tiro to the same model as ProofSimple is being tested. | | per token | | Pipelines | GitHub Actions, self-hosted runners, one Docker container per job. Packer 1.16.1 bakes the door's image and publishes it to Azure Compute Gallery, which keeps three versions for rollback. | capped at 3 vCPU, 4 GB per job | | Prices are Azure's list prices. The actual bill for the servers runs about $200 a month. The AI costs about half a cent per answer. ## Components | Component | What it is responsible for | |---|---| | Client app (ProofSimple) | The chat page. It runs the AI model (an Azure OpenAI model), checks the user's key before each answer, makes the function calls to the door, shows the result, and reports the cost afterward. Any MCP client can stand in its place. | | The door | The MCP server that takes function calls over HTTP. It runs on a virtual machine behind a load balancer, serves from its own local copy of the index, and never writes to it. It only accepts calls from client apps on its allow list. | | The console | The operator's web app: sources and their declarations, refresh schedules, builds, audits, warnings, and access keys. It decides when a build runs and promotes a finished build. | | Build workers | Short-lived containers started by a queue message. One kind pulls a source and builds the index. The other runs the heavier geometry audits. They do the expensive work so the answer path does not. | | The index | One SQLite file per build. Layers, geometry, spatial index, text search, and precomputed relationships are all inside it. | | The key service | Part of the console's API. It issues access keys, holds every limit, and keeps all usage. The client app asks it before each answer and reports to it after. | | Tiro | The console's assistant. It is the only place an AI model runs inside GeoProof. It can read the instance's state and stage a proposed change. A person reviews and approves every proposal. Tiro never changes anything on its own, and it is not in the answer path. | ## The question path ### Diagram: the question path ![The question path](question-path.svg) A person types a question into the client app. The AI model reads it and picks one of the 18 functions with its arguments. The client app sends that call to the door. Inside the door, code resolves the location to a full boundary, finds candidate features with the spatial index, runs exact geometry tests on the candidates, applies the layer's declared overlap rule, and builds the envelope. The envelope goes back to the client app. The client app builds the tables, caveats, and the record from the envelope with code, and the AI writes the sentences around them. The AI is involved in two places only: picking the function, and writing the reply. ### Step by step 1. **The call arrives.** A function call with typed arguments comes in over MCP (streamable HTTP). The door checks that the caller is an allowed client app. 2. **The location becomes a boundary.** A parcel number or an address resolves to the parcel's full boundary polygon, never to a center point. A center point misses a wetland that covers the back third of a lot, and on an L-shaped lot it can fall outside the parcel entirely. - A parcel number looks the parcel up directly. - An address is matched against the address layer with text search and scored. A clear match is used. A near tie is flagged on the answer. A weak match returns scored suggestions instead of a pick. - The matched address point is tied to its parcel by a precomputed relationship, and the parcel's boundary becomes the question's geometry. - A dropped map pin is the one true point case. If an address point sits on no parcel, the point is used and the answer says so. 3. **Is this already calculated?** If the question is covered by a declared GeoStamp (a precomputed relationship between two layers, for example which city each parcel is in), the answer is a table read. No geometry runs. 4. **If not, two passes.** First a rough match: the R*Tree returns every feature whose bounding box touches the question's bounding box. This is a superset on purpose. It may contain false candidates and it never drops a true one. Then exact tests: GEOS computes the true intersection for each candidate and the share of the parcel each one covers. 5. **The overlap rule decides.** The layer's declared rule turns shares into a result (see Overlap rules). 6. **The envelope is built.** The result, the five values, the caveats, and the step-by-step record with timings. Distance questions (within 500 feet, nearest, how many within a mile) follow the same path with a buffer or a distance test in the exact pass. Distances are straight-line, and the answer states that basis. ### One call at the door ![One call at the door, as a sequence](one-call-at-the-door.svg) ## The index The index is one SQLite file. A build produces a whole new file. The serving copy is opened read-only. How it is laid out: - **Layers.** Each layer is its own table, one row per feature. A row has a stable feature id, the source's own key where it has one, the attributes, and a content hash used to detect changes between builds. - **Attributes.** Stored as a JSON document per feature. Fields the configuration declares as searchable or summarizable get expression indexes, so filters and aggregates do not scan. - **Geometry.** Stored as WKB, already in the working coordinate system. Reprojection happens once, at build time, and never at question time. - **Spatial index.** One SQLite R*Tree per layer holding each feature's bounding box. It answers one question only: which boxes touch this box. - **Text search.** SQLite FTS5 over names and addresses, used for place search and address matching. - **GeoStamps.** A side table per declared relationship between two layers, with one row per related pair and its share, indexed in both directions. Where a layer always needs one winner (the city a parcel is in), that winner is also written as a real typed column on the row, so a filter on it is a plain indexed lookup. - **Tables with no geometry.** A CSV source loads as rows with no geometry and no spatial index. It reaches places only through a declared key link to a layer that has geometry. A direct spatial question to such a table is refused by name. - **A companion file.** Beside the index sits a second SQLite file with the build history: every sync, each source's recorded schema, and the audit findings. Why plain SQLite and no SpatiaLite: - Exact spatial math has exactly one home, a geometry module over Shapely and GEOS. If the database could also do spatial math there would be two implementations to keep in agreement. - The storage layer's contract is narrow: give me candidates by bounding box, by key, or by filter. Callers speak layer ids, geometries, and plain filters. No SQL leaks out. That keeps the storage engine replaceable. - No native extension to load, so the same file opens anywhere SQLite does. ## The answer envelope Every function returns the same structure. | Part | What it carries | Where it comes from | |---|---|---| | Answer | The function's own result: features, counts, shares, statistics. | Computed | | Accuracy | Positional accuracy of the source, the smallest thing it can resolve, the distance basis, and the thresholds used (split share, sliver buffer, adjacency tolerance). | The source's accuracy is declared by a person. The thresholds are read from configuration and stated. | | Completeness | Which kind of result this is, whether the layer claims to be exhaustive, and every layer that was checked. | The result kind and checked layers are computed. Whether a layer is exhaustive is declared. | | Freshness | When this copy of the data was built, how it is refreshed, and when the source was last edited upstream where the source reports it. | Computed | | Provenance | For each source used: its id, how it was read, the owner's service address, and a reference a reader can use to check the same features at the owner. Also the rule that was applied, and whether the source is live, a snapshot, derived, or synthetic. | Computed from the build record | | Authority | Whether this answer is enough to act on, and if not, who to ask. | Declared by a person, per source | | Confidence | One of definitive, high, qualified, low. | Computed | | Location resolution | How the location was resolved: method, matched address, match score, and whether it was ambiguous. | Computed | | Trace | The step-by-step record: each operation, its inputs and outputs, the rule applied, the data build it read, and how long it took. | Computed | It also carries related layers worth asking about, a map link, and an envelope version. The envelope is additive only. Fields are added and never removed, renamed, or given a new meaning, so a client written against an old version keeps working. **Default fields and asking for more.** A feature comes back as a short card of the fields the layer's steward chose. The AI can ask for every field with `attribute_detail="full"`, or name the exact fields it wants with `fields`. The boundary geometry is left out unless the call passes `include_geometry`. When something is trimmed, the answer says what was withheld and which call brings it back. **Caveats.** Caveats are structured fields, not prose a client can drop: the result kind, a tie or boundary ambiguity flag, the data's dates, the not-enough-to-act-on flag with a contact, a row limit with the true total, and the synthetic data disclosure. ## Three kinds of "no" A "no" from a GIS system can mean three different things. GeoProof keeps them apart and never merges them. | Kind | What it means | |---|---| | Nothing there | The layer covers this place, it was checked, and nothing was found. A real negative. | | Coverage gap | The layer does not cover this place, or could not be consulted. The result is unknown. It is never reported as a negative. | | Out of scope | The question is outside what this server answers: an unknown layer or field, a jurisdiction the data does not speak for, or a question a layer cannot answer. | Every answer lists the layers it checked, including on a hit. When a question spans a group of layers and one of them cannot be consulted, that layer is named as not consulted, the rest still answer, and a negative overall becomes a coverage gap. ## The functions The live door shows an AI client 18 functions. Each is listed below with its name and the description the AI reads, taken from the code the door runs. Task references were removed and one example address was replaced. Nothing else was changed. How the functions are designed so the model guesses less: - **Each description says what the function answers, what it is not for, and which function to use instead.** The place search says plainly that it is not for addresses and names the function that is. - **A refusal teaches.** An unknown layer, field, or value is refused by name, and the refusal lists what does exist. The model's next call can be right. - **The AI can ask what exists.** `list_layers` returns the layers. `describe_layer` returns one layer's fields, types, what can be searched or summarized, and the owner's own vocabulary where the source publishes it. - **A fuzzy name returns scored candidates.** The server never silently picks between near matches. - **Arguments are typed and named for the question.** There is no free SQL and no free-text filter. Filters are structured predicates checked against the layer's recorded schema. ### audit_partition_integrity ```text The stored partition integrity audit for one layer. Layers whose configuration declares majority_area have stated "a parcel belongs to exactly one of these"; every build enumerates the parcels where the geometry disagrees. The answer carries the split count (parcels materially in two or more features), the gap count (parcels in none, only for layers declared exhaustive; null with a stated reason otherwise), the near-even ambiguity-band subset, the ranked worst offenders, the splits_by_feature rollup (every partition feature involved in any split, ranked by how many split parcels touch it, with the feature's card when the layer declares card_fields), and the trend across generations. The thresholds that define "invalid" are DECLARED in accuracy (split_threshold_share, sliver_buffer), so a tolerance count is never mistaken for a raw intersects-two count. Results reference parcel identifiers and data-quality observations: internal-tier data. Findings are observations, not grades, and never speak to any specific parcel's legal determination. ``` ### count_features_near_location ```text How many features lie within a distance of a location. The full recipe (resolve the location, buffer, intersect, count) runs in deterministic code: the location resolves to a parcel's FULL BOUNDARY POLYGON or a genuine pin point, the distance converts from your unit exactly once, and the answer declares distance_basis: euclidean with the searched distance stated. The optional where is the same structured filter vocabulary as summarize_layer ("how many parcels sold since January within a mile" is this call plus one predicate). A count of zero is a confirmed negative for that distance, never an error. Returns the HonestAnswer envelope. include_geometry: pass true to receive the resolved boundary's full WKT in location_resolution. The default answer carries the boundary's identity plus display aids (a label point guaranteed inside the shape, and bounds for map framing); the spatial computation always runs on the full boundary either way. ``` ### describe_layer ```text What is askable about ONE layer: the discovery affordance. The layer's recorded contract as a capability statement: every askable attribute field with its logical type, the summarize measure kinds that type supports, the filter ops it accepts, which fields are name-searchable through find_place, and whether group_by can use it RIGHT NOW (the per-field groupable flag plus the layer-level groupable_fields and groupable_stamp_targets lists, read from the serving generation: supporting measures and supporting group_by are different capabilities). Orient with list_layers, then zoom here on the one layer a question needs. The field names returned are the ONLY names the layer answers to: read them, never guess them. source_metadata says where this layer's aliases, descriptions, and code lists came from, or why it has none. When it has none, that block ALSO carries sources_with_vocabulary: the sources in this instance that DID record one, with their field counts, so a question about what a code means is one call from an answer instead of stopping here. identity_note appears only when the build recorded one: a table layer that landed declaring no feature_identity at all, so its rows carry no stable id and no parcel link and cannot be joined to parcels. No note means the build recorded no such fact, not that a link exists; capabilities.relates is where a declared link is described. A plain catalog dict like list_layers and describe_service, not an answer envelope: this is capability, not data. ``` ### describe_location ```text Tell me everything about this location: the full report. The instance's configured battery runs every section (layers and groupings, each in its authored render mode) against one resolved subject: {"parcel_pin"}, {"address"}, or {"layer_feature"} with POLYGON geometry (a report needs a boundary, so a bare point, a street corner, a point feature, or a line feature is refused by name). EVERY SECTION CARRIES ITS OWN FULL HonestAnswer ENVELOPE with its own result class, freshness, and caveats; the bundle NEVER flattens them into one optimistic summary. The bundle's top-level freshness is the weakest link across sections. Where a jurisdiction gate is configured, gated sections refuse naming the jurisdiction (mode refuse) or answer with authority downgraded (mode advisory), same as the direct tools. Includes a map_view deep link when a viewer is configured: see it yourself. include_geometry: pass true to receive the resolved boundary's full WKT in location_resolution. The default answer carries the boundary's identity plus display aids (a label point guaranteed inside the shape, and bounds for map framing); the spatial computation always runs on the full boundary either way. ``` ### describe_service ```text What this service is and why to trust (or not trust) it: the first-contact identity card. Two halves, honestly split. DECLARED is the operator's own attestation (who runs it, relationship to the data owner: owner / licensed_mirror / unaffiliated_mirror, endorsement or disclaimer, audience, freshness policy, terms, where the methodology is published); a server cannot prove its identity, so these are labeled assertions. COMPUTED is derived from the serving index at call time and cannot drift: coverage (jurisdiction, working CRS, extent from the spatial indexes), the catalog summary broken down by source class with DERIVED and SYNTHETIC layers named (our computations are never mistaken for the data owner's publications), generation stamps, the envelope contract version, whether the serving index file gives freed space back to the disk (space_reclaim), and one live provenance URL so the verify-against-the-owner check can start right here. An instance with no identity block gets an honest 'not declared', never an invented one. Trust basis, stated plainly: identity is asserted; what is checkable is every answer's provenance resolving to the data owner's own services, and the published procedures for how every answer is computed. ``` ### find_adjacent_parcels ```text Which parcels are adjacent to this one, with the definition of "adjacent" DECLARED in the answer. basis "touching" is strict shared boundary; "within_tolerance" buffers the subject parcel's FULL BOUNDARY POLYGON by the stated tolerance (the notice-radius form; tolerance required, in the given unit). The two give different honest answers to the same question, and the envelope's adjacency_basis says which one this is: a 500 ft notice list must never pass as a strict-abutter list. The subject is never its own neighbor. A parcel whose interior OVERLAPS the subject (real cadastral fabric contains them) is returned under either basis, flagged overlaps_subject. location takes {"parcel_pin"}, {"address"}, or {"layer_feature"} with POLYGON geometry (a bare point, street corner, point feature, or line feature has no boundary to be adjacent to; those refuse by name). Returns the HonestAnswer envelope. include_geometry: pass true to receive the resolved boundary's full WKT in location_resolution. The default answer carries the boundary's identity plus display aids (a label point guaranteed inside the shape, and bounds for map framing); the spatial computation always runs on the full boundary either way. ``` ### find_features_at_location ```text Find what one layer says is at a location. Two very different location kinds, honestly distinguished: {"x": ..., "y": ...} is a genuine point (a dropped map pin or GPS reading) and runs point-in-polygon. Coordinates without an "srid" are taken as the instance working CRS. Declaring "srid" (e.g. 4326 for lat/lon, with x=longitude, y=latitude) converts the input to the working CRS, stated on the resolution record. A pin sitting exactly on a shared boundary returns every covering feature with boundary_ambiguity flagged. {"parcel_pin": ...} or {"address": ...} is a PROPERTY question: it resolves to the parcel's full boundary polygon and overlays it against the layer. {"cross_street": {"street_a", "street_b", "locality"?}} resolves the derived corner (a genuine point; candidates on ambiguity, "these streets do not intersect" as an honest confirmed negative). {"layer_feature": {"layer_id", "feature_id"}} asks the same question of a NAMED FEATURE (e.g. which district holds most of this city): a polygon feature runs under the layer's policy overlay; a POINT feature (a POI reached via find_place) takes the point-in-polygon path; a LINE feature (a street segment) is refused by name, since a boundary lookup needs a point or polygon subject. Where the layer's configured policy is majority_area (e.g. districts), a parcel straddling two features collapses to the one holding the most area, and the response keeps the straddle on the record: every candidate's share is in the payload and near-even straddles set boundary_ambiguity. Addresses go through the same scored matching and answer-invariance safeguard as resolve_grouping. Returns the HonestAnswer envelope. include_geometry: pass true to receive the resolved boundary's full WKT in location_resolution. The default answer carries the boundary's identity plus display aids (a label point guaranteed inside the shape, and bounds for map framing); the spatial computation always runs on the full boundary either way. fields (optional per-call projection): return only these attribute names per feature, UNION the guaranteed set (the layer's stable id + PIN) and always feature_id; narrows even under attribute_detail="full"; an unknown name is out_of_scope naming it. limit (optional caller top-N): cap rows on a multi-hit overlay (policy: all), with total_matched and a row_narrowing block. A no-op where the answer is one feature (a majority collapse or covering). order_by / order_direction (optional): re-rank the multi-hit overlay by an attribute before the cut (ties on feature_id); the sort field always surfaces in each row. Unknown order_by is out_of_scope naming it. ``` ### find_features_by_attribute ```text Find features by attribute predicates (no location involved). where uses the same structured filter vocabulary as summarize_layer: {"all": [...], "any": [...]} of {"field", "op", "value"} predicates, validated against the layer's recorded field-type contract. An unknown field or type-mismatched operation returns out_of_scope naming the field. Text compares ignoring case exactly as summarize_layer describes (A to Z; the note says when a match was stored in a different case than typed, or when an accented letter was typed), and a number sent as text for a number field is read as the number, disclosed. Results carry feature_id and attributes. A result cut off at the limit SAYS SO (truncated_at_limit plus a completeness note); nothing is silently truncated. Zero matches is a confirmed negative, not an error. Returns the HonestAnswer envelope. word_matches (op): WHOLE-WORD match on a field the layer declares searchable (describe_layer lists word_matches in that field's ops). Prefer it for name questions: it rides the build's text index, so "buyer Cabrera, sale after 2000" answers in milliseconds where the substring operator parses every record. Semantics, stated: tokens are case-folded and diacritic-folded (CABRERA matches Cabrera and the accented spelling); ALL query tokens must appear as whole words on THE NAMED FIELD; punctuation separates, so "O'BRIEN" is two tokens (o, brien) and a punctuation-only value matches nothing and returns an empty answer, not an error. It is NOT substring: "cabrer" finds nothing, and contains stays the substring operator with its own cost. Valid in the "all" group; an undeclared field or an "any"-group use is out_of_scope naming the declared searchable set. Answers that ran it carry match_semantics naming the kind, and total_matched stays exact over the whole matched set. fields (optional per-call projection): return only these attribute names per feature, UNION the guaranteed set (the layer's stable id + PIN) and always feature_id; narrows even under attribute_detail="full"; an unknown name is out_of_scope naming it, case-sensitive. The attribute_detail signpost names the withheld shape when a projection trims. order_by / order_direction (optional): sort the match set on one attribute before the limit cut, so order_by + limit is a deterministic top-N by that field (ties on feature_id); the sort field always surfaces in each row. When the limit truncates, the answer also carries total_matched, the EXACT count of the whole match set ("top N of total_matched"). Unknown order_by is out_of_scope naming it. count_state says what happened to that total, on every answer: "exact" (total_matched and truncated_at_limit present and true) or "not_counted_within_budget" (the count outran its budget, so BOTH those keys are ABSENT and the note says more matching features may exist). The page of features is the same either way. ``` ### find_features_in_buffer ```text Features within a distance of a location, nearest first. location is {"x", "y"} (a genuine map pin), {"parcel_pin"}, {"address"}, {"layer_feature": {"layer_id", "feature_id"}}, or {"cross_street": {"street_a", "street_b", "locality"?}} (a named feature's own polygon, e.g. a city boundary). A parcel or address resolves to its FULL BOUNDARY POLYGON and distance is measured from the boundary, never a centroid; a feature that intersects the location is at distance 0 and marked on_location. distance 0 means INTERSECTING the resolved geometry, so "features inside this region" is this same call. unit is "working" (working-CRS units), "feet", "meters", "miles", or "kilometers"; conversion happens here, once. Every distance is declared with its units, SRID, and distance_basis: euclidean (straight line, never a walkshed or drive time). The optional where is the same structured filter as summarize_layer, applied inside the circle. Nothing within the distance is a confirmed negative with the searched distance stated; a result cut off at the configured feature limit says so. A distance beyond limits.max_query_distance refuses, naming the limit. Returns the HonestAnswer envelope. include_geometry: pass true to receive the resolved boundary's full WKT in location_resolution. The default answer carries the boundary's identity plus display aids (a label point guaranteed inside the shape, and bounds for map framing); the spatial computation always runs on the full boundary either way. fields (optional per-call projection): return only these attribute names per feature, UNION the guaranteed set (the layer's stable id + PIN) and always feature_id, distance, on_location; narrows even under attribute_detail="full"; an unknown name is out_of_scope naming it, case-sensitive. limit (optional caller top-N): cap the returned rows to the N nearest. The response then carries total_matched (the exact count before the cut) and a row_narrowing block declaring the caller cut, the widen-back call, and, kept DISTINCT, whether the server cap also engaged. Request-narrowing, never a coverage_gap. order_by / order_direction (optional): re-rank the within-distance set by an attribute before the limit cut, so the top-N is by that attribute rather than by distance (ties on feature_id); the sort field always surfaces in each row. Unknown order_by is out_of_scope naming it. ``` ### find_nearest_feature ```text The k nearest features to a location, and how far. The location resolves like every location tool (pin point, or parcel/address to the FULL BOUNDARY POLYGON; distance from the boundary, never a centroid). The nearest feature at distance 0 is ON the location and the answer says so. An exact distance tie at the k cut returns every tied feature with boundary_ambiguity flagged, never an arbitrary pick. The search is bounded by the configured limits.max_query_distance, stated in the answer as search_ceiling; an empty result is a confirmed negative within that ceiling, not proof nothing exists beyond it. Distances carry units, SRID, distance_basis: euclidean, and the layer's positional accuracy: a distance with no error context is overstated. The optional where (same filter vocabulary as summarize_layer) makes this "the nearest MATCHING feature": the filter applies before ranking, and when a nearer NON-matching feature exists its distance is named in the answer, never silently dropped (the closest market sale never hides the closer family transfer). Returns the HonestAnswer envelope. include_geometry: pass true to receive the resolved boundary's full WKT in location_resolution. The default answer carries the boundary's identity plus display aids (a label point guaranteed inside the shape, and bounds for map framing); the spatial computation always runs on the full boundary either way. fields (optional per-call projection): return only these attribute names per feature, UNION the guaranteed set (the layer's stable id + PIN) and always feature_id, distance, on_location; narrows even under attribute_detail="full"; an unknown name is out_of_scope naming it, case-sensitive. k already bounds the row count, so nearest takes no separate limit. order_by / order_direction (optional): the k are SELECTED by distance, then PRESENTED in this attribute order (ties on feature_id); the sort field always surfaces in each row. Unknown order_by is out_of_scope naming it. ``` ### find_place ```text Find places by name: streets, landmarks, any layer that declares searchable fields. NOT FOR ADDRESSES: a street address ("123 Example Ave SE") is a LOCATION, not a name. Pass it as location {"address": ...} on describe_location or any location-taking tool and it resolves through the situs resolver to the parcel's full boundary. An address-shaped query here still runs, but its answer carries a query_hint block naming that recovery call. Returns scored CANDIDATES, never a silent pick. Each candidate carries the layer_id and feature_id (directly usable as a layer_feature location in every other tool), the matched display name, a 0-1 score from component-match depth (an exact full name outranks a name without its type, which outranks a bare base name), and a band from the instance's locate thresholds: "resolve" (act-on-able) or "suggest" (offer to the person). Near-tied top candidates are flagged ambiguous; disambiguate with the person. Args: query: the name as a person says it, e.g. "NE 4th St" or "Renton Library". Matching is normalized (case, punctuation, street-type abbreviations). layer_id: search one layer only. Omit to search every layer that declares searchable_fields. A layer that declares none refuses honestly (out_of_scope). limit: maximum candidates returned (default 25); a cut-off list says so in the note. Zero matches return an honest confirmed_negative with checked_layers listing exactly what was searched. Layers masked at this tier or missing their text index are named not-consulted, never silently skipped. ``` ### get_feature_by_id ```text One feature by its identifier: attributes, geometry, and the source's provenance and freshness. An unknown id is an honest out_of_scope naming it, never an error. Returns the HonestAnswer envelope. ``` ### get_source_health ```text Operational health of this instance's sources: the operator's view of the pipeline. Per source: the serving generation (id, built_at, feature count and its delta from the previous build), the last build attempt's outcome (built, or halted with the drift kind; promotion is the build-level ledger record), CRS-gate and validity-repair counts, contract state, and the upstream source's own last-edit date. A consumer asking "how fresh is this answer" never needs this tool: every answer already carries its freshness. This is the steward asking "did last night's build halt, and why." Returns the HonestAnswer envelope. ``` ### list_layers ```text Catalog of the layers and defined-term groupings this instance carries. Each grouping entry carries its definitional description (the legal or institutional basis of the term), so a consumer discovers what the term authoritatively means here rather than guessing from layer names. ``` ### resolve_grouping ```text Resolve a defined-term grouping at a location. The grouping (for example "wetlands") is the jurisdiction's defined set of authoritative layers for that term. Every member layer is checked and reported, so a negative answer means the whole set was consulted, never that one layer happened to be empty. location carries {"parcel_pin": ""} or {"address": ""}. Either resolves to the parcel's FULL BOUNDARY POLYGON and the overlay runs polygon-on-polygon against that boundary. An address matches the parcels layer's situs values (scored; the response's location_resolution.match_confidence reports the score). An address matching several parcels near-evenly is analyzed against every candidate: if the answers agree, the shared answer returns flagged; if they differ, the candidates return with their differing results so the caller can disambiguate by parcel_pin. Returns the HonestAnswer envelope: the hits with coverage shares, plus completeness (result_class distinguishes a confirmed negative from a coverage gap from out-of-scope), accuracy, authority with any escalation, freshness, provenance per layer checked, related layers, and the derivation trace. include_geometry: pass true to receive the resolved boundary's full WKT in location_resolution. The default answer carries the boundary's identity plus display aids (a label point guaranteed inside the shape, and bounds for map framing); the spatial computation always runs on the full boundary either way. ``` ### stamp_statistics ```text Aggregate statistics over one declared geostamp relationship: the recorded build-time memberships between a subject layer's features and a target layer's features (e.g. subject_layer "address_point" onto target_layer "parcels"; layer ids exactly as list_layers reports them), served from the stamp table in one indexed read, never query-time spatial math. statistic is one of: - "distribution": the subjects-per-target histogram plus targets_total, targets_with_multiple, subjects_min/avg/max, and the void count beside total_subjects. Answers questions like "how many parcels have multiple addresses on them?" in one call. - "targets_with": the count of targets holding at least min_subjects subjects (min_subjects required, an integer >= 1). Set list_ids true to also get up to `limit` target ids with their counts, ordered most-subjects first; the id listing is served only when the relationship keys durable ids (a relationship keyed internally serves the count and refuses the listing by name). - "void_count": subjects stamped to no target, always beside total_subjects as a count and fraction. An unknown relationship refuses by name and lists the declared relationships. A relationship that is declared but not yet built on the serving generation refuses naming the missing build; that is an operator condition (a rebuild restores it), not something the caller can fix by changing the call. Zero qualifying rows is a confirmed negative from the consulted stamp table. Counts follow membership semantics: a subject on the boundary of two targets counts once per covering target. Returns the HonestAnswer envelope; freshness and provenance name the subject layer's serving generation. ``` ### summarize_layer ```text Field statistics over a layer, filtered, with the honesty attached. With group_by, PER-GROUP statistics: "sales per city", "which parcel has the most transfers", "parcels per jurisdiction" are all this one call. Never invent synthetic fields like __count; the grammar below covers ordering by a computed count. measures is a list like [{"kind": "avg", "field": "SalePrice"}, {"kind": "max", "field": "SalePrice"}, {"kind": "count"}]. Kinds: count, sum, avg, min, max (field statistics), length_sum and area_sum (geometry measures). All measures compute against ONE generation and share one freshness stamp. group_by names a field to group the statistics by; you get back per-group rows (key, row_count, the requested measures) plus total_groups. What is groupable: the layer's indexed summarizable fields, the layer's declared parcel-link field (rows group under the parcel each row resolved to, with each group labeled parcel PIN vs condo complex, orphans in a counted null group), or the name of a layer this layer is geostamped onto (features per target, counts only). Anything else refuses by name AND lists the layer's actual groupable fields, so read the refusal and re-ask. NULL group keys are a named, counted group, never dropped. Group keys that differ only by case ("ESTATE" vs "Estate") are ONE group on every field, shown under one spelling (a mixed-case one when stored, the same in every ask), with every stored spelling listed on the group row (key_spellings) and in the note. order (only with group_by) sorts the group rows: {"by": "key", "direction": "asc"|"desc"} or {"by": "measure", "kind": ..., "field": ..., "direction": ...} where kind/field reference a measure THIS ask computed ("top cities by count" = measures [{"kind":"count"}] + order {"by":"measure","kind":"count", "direction":"desc"}). In an order reference, "field" is required for sum/avg/min/max and omitted for count, exactly as in the measure itself. A measure the ask did not compute refuses by name. limit (only with group_by) caps the group rows, default 25; total_groups and the truncated flag always tell you when the list was cut, so never treat a cut list as complete. Geometry measures (length_sum, area_sum) do not group in v1; the refusal names the working alternative (a scoped single-anchor ask, e.g. length within one named city). where is an optional structured filter: {"all": [...], "any": [...]} of predicates {"field", "op", "value"}. Ops: eq, ne, gt, gte, lt, lte, between (INCLUSIVE both ends, value [low, high]), in, contains (case-insensitive substring), is_null, not_null. Dates are ISO 8601 strings and compare lexicographically. Text compares IGNORING CASE on every field and every op: "Auburn", "AUBURN" and "auburn" are one value, in filters, sorts and groups. The note says so when a match was stored in a different case than typed. Case is ignored for the letters A to Z only; an accented letter matches only as typed, and the note says so when one is typed. A number sent as text for a number field ("2" for baths) is read as the number and the note says so; a number sent for a text field still refuses (PINs and ZIPs keep their leading zeros). scope is an optional SPATIAL pre-filter: {"location": {...}, "distance": N, "unit": "..."} using the same location kinds as the proximity tools ({"x","y"} pin, {"parcel_pin"}, {"address"}, or {"layer_feature": {"layer_id", "feature_id"}} or {"cross_street": {"street_a", "street_b", "locality"?}}). Distance 0 (the default) means INTERSECTING the resolved geometry, so "average sale price within a mile of this parcel" and "count of parcels inside this city boundary" are both one call. where and scope compose, with each other and with group_by ("sales per neighborhood within this city" is one call). The one exception: group_by naming a geostamped target layer composes with neither in v1 and says so. Every field statistic reports value_count and null_count: nulls are counted and declared, never silently dropped into an average. Geometry measures declare their units and SRID (a converted acres convenience rides alongside, labeled). A filter matching nothing is a confirmed negative with count 0. A question naming a field the layer's recorded contract does not carry, or an operation the field's type cannot honestly answer (avg over text), returns out_of_scope NAMING the field: never coerced, never silently empty. Returns the HonestAnswer envelope. ``` ### transform_coordinates ```text Transform a batch of coordinates FROM one spatial reference TO another, and disclose the operation that did it. ONE call converts N points ("show these N places on a map" gets coordinates for all of them at once, never N round-trips). Common cases: from_srid=4326 to_srid="working" takes consumer lat/lon into the working CRS every spatial tool expects; from_srid="working" to_srid=4326 takes a working-CRS feature coordinate back out to lat/lon for display or mapping; any EPSG to any other falls out of the same call. AXIS ORDER, pinned hard: every point is {"x", "y"} and the convention is ALWAYS (x, y) = (easting, northing). For EPSG:4326 that means x=LONGITUDE, y=LATITUDE (the transform-layer standard, matching Esri Project / PostGIS ST_Transform / GeoJSON). This tool is pure (x, y); a consumer that displays or speaks lat/lon inverts at its OWN boundary. It never does lat-first. Args: points: a non-empty list of {"x": float, "y": float}. 2D only: a z or m value is refused by name (a 3D transform would perturb x, y). Output pairs 1:1 with input order, each item echoing its input beside its output. from_srid: the source spatial reference: an integer EPSG code, or the literal "working" for this instance's working CRS (so the caller never hardcodes the working SRID). Any other value is refused. to_srid: the target spatial reference, same shape as from_srid. Returns {"points", "from_srid", "to_srid", "operation", "accuracy_m", "exact", "ballpark", "grid_missing", "exactness_basis", "note"}. from_srid / to_srid are echoed as the resolved concrete EPSG numbers. operation is the pyproj operation actually used; accuracy_m is its stated accuracy in metres (None when unknown); exact is True for a mathematically exact same-datum change; ballpark / grid_missing flag a degraded fallback. exactness_basis names who decided the exactness: "projection_library" when PROJ stated the accuracy, "geoproof:same-datum conversion" when PROJ stated none and GeoProof classified the operation itself (a shared datum and every step a Conversion). A DATUM CROSSING (NAD83-family <-> WGS84, i.e. the live 2926<->4326) is not a null relabel: it carries its own stated uncertainty, and this tool discloses it rather than pretending the transform is free. Refusals, all by name: an unknown EPSG names the offending end (from_srid vs to_srid); a swapped or out-of-range degree pair is caught on the 4326 end; a non-finite coordinate is caught by index; a z/m value is refused. These are raw transformed coordinates, not authoritative locations, and they carry no caveat from any source answer. ``` ## How data is handled How GeoProof treats each kind of data, who can see what, and what it refuses. ### By geometry type - **Polygons:** parcels, districts, zones, wetlands. Overlaid with each feature's share, with the layer's overlap rule and sliver buffer applied. A full property report needs a polygon. - **Points:** address points, places such as a library, a dropped map pin. Point-in-polygon. An address becomes its parcel's full boundary through a GeoStamp. A dropped pin is the one true point. - **Lines:** streets. Used for name search and cross-street corners. Refused by name for boundary lookups and reports. - **Tables with no geometry:** CSV sources such as sales records. They reach places only through a declared key link to a layer that has geometry. A direct spatial question to one is refused by name. ### GeoStamps - Relationships worked out at build time: membership for points, area shares for polygons. Where a layer needs one winner, such as the city a parcel is in, that winner is stored as a column, so the answer is a table read. ### Who can see what - **Two tiers, public and internal:** The demo runs in internal mode, which says more. - **Public eligibility:** A public instance refuses to load any source not marked eligible for public use. - **Masked layers:** In public mode a source's answer can be cut to a yes or no, or replaced with a set sentence such as “check with the jurisdiction,” and then the layer is not consulted at all. The answer always says a mask applied. - **Jurisdiction gate:** Inside a city, a county layer either refuses, naming the jurisdiction, or answers as advisory with its authority lowered. - **Screening layers:** Some layers are too sensitive to serve, but a steward still wants people warned. A screening layer is built into the index but never listed or served. The check is yes or no, a hit adds the steward's sentence and a contact to the answer, and nothing about the check is written into the answer's record. It is built for internal use. - **Synthetic data:** Anything made up for the demo is labeled “Synthetic” in the answer. In the demo that is the ownership information and the eagle's nest layer. A synthetic source is marked as synthetic in the answer's provenance and must carry a disclosure sentence. The disclosure cannot be empty, and the client app shows it. - **The reason is authority, not secrecy:** The data steward cannot speak for another jurisdiction's data, so the answer says who can. ### Restrictions on sources - **Shapefiles:** Refused on purpose, because DBF cuts field names short. - **Uploads:** GeoJSON, Esri JSON, or CSV with coordinates (points only), up to 100 MB and 300,000 features. - **Schema changes:** A removed or changed field halts the build until a person decides what it means. - **Bad geometry:** Repaired at build time, and every repair is counted and kept on the record. ## Overlap rules When a parcel touches more than one feature of a layer, something has to decide what the answer is. Each layer declares its rule in configuration, and the rule and its thresholds are stated on the answer. | Rule | What it does | |---|---| | All (the default) | Returns every feature the parcel overlaps, each with its share of the parcel. Right for layers where overlap is real, such as wetlands or flood zones. | | Majority area | Returns one winner, for layers where a parcel belongs to exactly one feature, such as a school district. Every candidate and its share stays on the answer. | Options that go with them: - **Ambiguity band.** If the winner's share minus the runner-up's share is inside the band, the answer is a near tie. The layer declares what happens then: flag (answer and name the tie) or refuse (return the candidates and pick no side). - **Coverage guard.** If most of the parcel is not covered by the layer at all, a small covered sliver does not win. - **Sliver buffer.** The parcel is shrunk inward by a declared distance before the test, so a boundary drawn a foot off does not create a false overlap. There is no first-match rule. It was removed on purpose: an arbitrary winner has no honest basis to state on the answer. A layer either resolves properly or returns everything. What is switched on in the live configuration: 28 layers declare a rule. 15 use majority area and 13 use all. Every other layer uses the default, all. The ambiguity band is 10 percentage points and every layer is set to flag. Refuse exists and is not switched on for any layer. The coverage guard is on everywhere. An inward sliver buffer is in use. Of the 28 layers with a declared rule, 24 set it to zero, three set it to one foot, and one sets it to two feet. The 37 layers with no rule of their own take the instance default of five feet, which only matters where the layer is polygons. Every build also audits the majority-area layers: it counts the parcels that sit materially in two features (splits) and, for layers that claim to cover everything, the parcels in none (gaps). The findings are stored, trended across builds, and can be asked for through a function. ## The data update path ### Diagram: the data update path ![The data update path](data-update-path.svg) A schedule in the console says a source is due. A build worker pulls the whole source. The schema is compared with the recorded one. Each feature goes through the gate: reproject once, repair bad geometry and count the repairs. GeoStamps are worked out. The new file is sealed and checked. If every check agrees the build is promoted, and promotion starts a door swap. If any step fails, the build is thrown away and the previous data keeps serving. ### Step by step 1. **Pull the source in full.** A connector reads every feature, page by page for a feature service. Every refresh is a full pull, because the sources carry no reliable update dates. 2. **Check the schema.** The source's fields and types are compared with the schema recorded at the last good build. A removed or changed field halts the build. A person decides what the change means before any data moves. 3. **Gate each feature.** Geometry is reprojected once into the working coordinate system. This is the only reprojection point for data in the whole system. Invalid geometry is repaired, and every repair is counted and kept on the record. 4. **Work out GeoStamps.** Each declared relationship between two layers is computed here: membership for points, area shares for polygons. 5. **Seal and check.** The new file is closed and verified. Feature counts must agree between the source, the layer tables, and the indexes. Every geometry must parse. Every layer must have its spatial index. Every feature must have its content hash. No stray tables. If anything disagrees, the build is thrown away. 6. **Promote.** The verified file replaces the current one in a single atomic rename. The build records what was added, changed, and removed, matched by the source's own key. Scheduled refreshes run one source per build, so each source moves on its own schedule and one source's trouble stays with that source. A one-source build starts from a copy of the current index and replaces only that source's layers. ### The life of a build ![The life of a build, from queued to pruned](life-of-a-build.svg) ## Swaps A data update and a code update reach the door the same way: the whole virtual machine is replaced. A running door is never changed in place. Nothing is patched on it, no new release is installed on it, and no new data is loaded into it. The steps: 1. **Build a new door** from a prepared machine image. The image already holds the operating system with its patches and the GeoProof release. 2. **Load and verify the data.** The new door copies the index to its own local disk and verifies the copy before it will serve from it. 3. **Check it before it takes traffic.** The new door is warmed up and tested with real function calls while the old door is still serving. 4. **Switch.** The load balancer moves traffic to the new door. 5. **Check again**, now that it is serving. 6. **Retire the old door.** It is drained, shut down, and deleted. If the new door fails a check, it never takes traffic and the old one keeps serving. Code releases reach the door through a pipeline in GitHub: a release is gated by the test suite, baked into a new machine image, the image is proven by booting a machine from it, and a swap puts it in service. The release that should be running is a single recorded setting, and every swap reads it. No swap ever takes "latest". **Builds that finish close together share a swap.** Each finished build asks for a swap. Only one swap runs at a time and at most one waits. A newer request replaces the waiting one, and the waiting swap picks up the newest data when it starts. A swap that finds the serving door already has the newest data ends without building anything. Swaps are the newest piece. Since the stable release, not one has failed. ## Failure handling - **A failed source only holds back that source.** Its build is thrown away, its previous data keeps serving, and every other source carries on. - **It backs off and is retried.** Each failure in a row lengthens the wait before the next try. The count is read from the build history, so a restart does not reset it. A success ends it. - **The operator sees why.** The console shows the failed build, its reason, and when the retry is due. - **A missing layer never brings an answer down.** A layer that is configured but not built answers as a coverage gap. In a grouped question it is named as not consulted and the rest still answers. - **Data age is visible, not hidden.** Each source updates on its own schedule. The console warns the operator when one falls behind, and every answer carries the data's dates. ## Access keys GeoProof issues and controls the keys. It creates them, stores them, holds every limit, keeps all usage, and is the only place a key can change. - A key carries a hard spending limit in dollars. The limit does not reset. - Before each answer, the client app asks GeoProof whether the key is valid and how much it has left. - After the answer, the client app reports the tokens the AI used. GeoProof turns tokens into dollars at the per-model prices saved in the console and adds that to the key's usage. - Self-serve keys are sent by email. Each has its own limit, and all self-serve keys together draw from one total budget. - Only a one-way hash of a key is stored. The key itself exists once, when it is issued. - The answer path does not know keys exist. The door answers function calls for allowed client apps. Limits are enforced in the client app, against GeoProof's records. ## Built on open source - SQLite: R*Tree for the spatial index, FTS5 for text search, geometry stored as WKB. No SpatiaLite. - Shapely over GEOS for every exact spatial operation. - pyproj over PROJ for reprojection and coordinate conversion. - Python 3.12. - The MCP Python SDK. - pydantic for the envelope, the configuration, and every typed boundary. - FastAPI for the console's API. - httpx for reading source services. - Served by gunicorn and uvicorn behind Caddy. ## Numbers Each number says what it measures. | Number | Value | What it measures | |---|---|---| | Sources configured | 65 | 65 sources configured in the live configuration on November 16, 2026: 60 ArcGIS feature services, 4 CSV tables, and 1 layer derived from another. | | Functions shown to an AI | 18 | The functions on the live door's list. | | A typical GeoProof call | 67 ms | The median of 610 function calls recorded by the live door on November 15 and 16, 2026, mostly from load tests. This is time inside GeoProof for one call. It does not include the network or the AI. | | A full property overview | 632 ms | The median of 122 of those calls. This one function runs a whole set of checks in a single call, so it is the slow one. | | One full answer | 7.4 s | One real two-call question in the client app on November 16, 2026, from the request arriving to the last word. One reading, not an average. The AI took 6.1 s of it. GeoProof's two calls took 0.12 s including the network. | | Servers | about $200 a month | The servers as set up today. | | AI per answer | about half a cent | The AI model's cost for one answer in the client app. | One door runs today and the design allows several. So far the limit has been the AI model's capacity, not the door. ## What's not done yet 1. **No history.** You can't ask what was true at an earlier date. 2. **Every refresh pulls the whole source**, because the sources carry no update dates. 3. **One door runs today.** The design allows several. 4. **Source formats.** It reads ArcGIS feature services, CSV tables, and GeoJSON. There are no readers yet for file geodatabase, GeoPackage, GeoParquet, KML, OGC services, or rasters. Shapefiles are refused on purpose, because DBF cuts field names short. 5. **The deployment code targets Azure.** 6. **Distances are as the crow flies.** 7. **No email alerts yet.** Warnings are in the console.