Client platform
Natural-Language Geospatial Query Platform
A product where users ask questions about geographic data in plain English and get answers, charts and maps back, generated by an LLM over PostGIS.
Client- and NDA-protected work; the product, client and datasets are intentionally not named.
Architecture
- Questionplain English, via web app or SDK
- LLMschema-aware SQL generation
- Validationallow-listed schemas · constrained query
- PostGISspatial execution
- Answertext · chart · map · analytics
Client work under NDA, so names and datasets stay out: a text-to-SQL query engine over multi-jurisdictional public data, the product platform around it (API, web app, SDKs, billing) and the infrastructure it runs on. I led its conception and engineering with the Territorial team.
At a glance
- Query engine: natural language → schema-aware SQL → validation → PostGIS → natural-language answer, in one call
- Two interchangeable LLM backends behind an identical REST interface; schema-block enforcement so a chat can only touch the data sources it was granted
- Analytics sandbox: a bounded tool loop for follow-on analysis (ratios, rankings, comparisons), charts, maps and an optional code interpreter
- Product platform with organisations, API keys, usage tracking, rate limits, webhooks, subscription billing, TypeScript and Python SDKs, and a docs site
The query engine
The engine is a FastAPI service over PostgreSQL/PostGIS holding public datasets at federal, state and city level: campaign finance, census demographics, business registries and licences, permits, crime, taxes. The hard part of text-to-SQL over data like this is not the model; it is giving the model a schema it can reason about. I designed the data layer: how jurisdictions at different levels relate, how geometries are exposed and simplified, which columns carry meaning, and how all of it is described so the generated SQL is right on the first attempt more often than not. Fuzzy matching on names uses trigram similarity in the database, so misspelled places and candidates still resolve.
A question becomes a SQL candidate, is validated and constrained (schemas are allow-listed per conversation, internal schemas can never be queried), executed, and summarised back into language. The LLM backend is pluggable: one implementation on OpenAI models through LangChain, another on Google's agent framework with Gemini, both behind the same REST contract with conversation history, so comparing providers was configuration rather than a rewrite. An analytics mode adds a bounded agent loop over freshly fetched data with per-query timeouts, retry caps and an end-to-end deadline, producing percentages, rankings, charts and maps.
The product around it
A query engine is not a product. I also led the platform that turns it into one: an Express and PostgreSQL/PostGIS API with a controllers/services/repositories layout, a React web app for chat and conversation management, TypeScript and Python SDKs for programmatic access, organisations and teams, API keys, usage tracking and rate limiting, a webhook system for event notifications, subscription billing through Stripe, and a documentation site.
Infrastructure
Everything runs as Docker Compose stacks behind Traefik, with separate development, beta and production environments, automated image updates, a metrics and BI layer, and Sentinel watching the whole thing. Secrets are scoped per service and loaded from a single environment file so configuration stays readable as the stack grows. Calls that carry customer data to external model endpoints resolve their targets fail-closed: production refuses to run without an explicit endpoint and never falls back to a public one.
More projects
All projects
Geo360 LADM
The first land administration system in Brazil built on the ISO 19152 LADM standard, led while I was at Topocart.
- PostgreSQL
- PostGIS
- GeoServer
- LADM (ISO 19152)
- +4

Dragonfly GeoAnalytics
A geointelligence platform that helps municipalities fight dengue, Zika and chikungunya with drone imagery and case mapping.
- React
- Mapbox
- Highcharts
- Express
- +6

GeoServer Mobile Client
An offline-capable mobile client for GeoServer layers: download, view, edit features and export, built in three weeks.
- Ionic
- React
- TypeScript
- OpenLayers
- +2