geocontext
An experimental API providing spatial context for LLM.
Motivation
REST/GeoJSON API can be invoked by LLMs for RAG purpose. Meanwhile, trying to integrate the use apicarto.ign.fr from IGNF in ChatGPT leads to consider the following points (see apicarto - issue #109 (french)) :
- Some input params are not relevant (too many options, GeoJSON input geom instead vs lon,lat,...)
- Some default values are not adapted (there is no reason to define defaults limits to 5000 features)
-
Large GeoJSON polygons in API responses are not relevant and leads to ResponseTooLargeError with ChatGPT.
- There is no need to produce GeoJSON Feature with id, properties and a geometry put on a pedestal.
- ...
This is an attempt to create a "facade" over existing spatial services to ease usage with LLM.
Principles
-
No geocoding (as ChatGPT already use multiple sources to find lon,lat for a given location) (bad quality)
- Use external service for geocoding
- No large geometries in responses.
- JSON responses as flat as possible (no GeoJSON Feature or FeatureCollection)
- Integration of geoservices from Géoplateforme first.
Features
See OpenAPI specifications.
Credits
License
MIT