feat: add source-grounded evolution and Ollama assistant
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-15 06:45:56 +02:00
parent 0baa9b069c
commit beacdf2560
37 changed files with 2246 additions and 58 deletions
+42 -1
View File
@@ -1585,7 +1585,8 @@ source/layer identity, first and last observations and ordered datasets.
{
"earlier_dataset_id": "uuid",
"later_dataset_id": "uuid",
"bbox": {"west": 5.0, "south": 51.0, "east": 5.2, "north": 51.2},
"bbox": {"min_x": 5.0, "min_y": 51.0, "max_x": 5.2, "max_y": 51.2, "crs": "EPSG:4326"},
"area_id": "optional persisted Area uuid",
"preview_limit": 500
}
```
@@ -1594,6 +1595,46 @@ Both datasets must belong to the project and the same temporal series, with
the earlier observation preceding the later one. The response contains source
snapshot references, selection bbox, earlier/later metric values,
absolute/percentage change, estimate status, warnings and GeoJSON evidence.
`metric` remains the backwards-compatible primary measurement. `metrics`
contains every aggregation that is compatible between both snapshots and
`timeline` contains the same persisted metric for every dated snapshot in the
series. When `area_id` is supplied it must belong to the project and the exact
persisted Area geometry is used; the bbox remains only the bounded map extent.
Added/removed/modified object changes are calculated only when source
provenance declares stable feature identities; otherwise
`object_changes.available=false` and no object history is inferred.
## Local GeoIntel assistant
The assistant is an optional read-only language interface over persisted
GeoIntel measurements. The browser never connects to Ollama directly and does
not choose an arbitrary provider URL.
### GET `/api/v1/assistant/status`
Returns `configured`, `not_configured` or `unavailable`, the configured default
model and the number of locally installed models. It never downloads a model.
### GET `/api/v1/assistant/models`
Returns the models reported by Ollama `GET /api/tags` in the canonical
envelope. A chat request can only select a model from this list.
### POST `/api/v1/projects/{project_id}/assistant/query`
```json
{
"question": "Hoe evolueerde de bosoppervlakte?",
"model": "qwen3.5:9b",
"bbox": {"min_x": 5.0, "min_y": 51.0, "max_x": 5.2, "max_y": 51.2, "crs": "EPSG:4326"},
"area_id": "optional persisted Area uuid",
"history": []
}
```
The backend validates project/Area ownership, calculates current semantic
metrics from PostGIS and includes dated observations only for persisted
temporal series. Geometry is not sent to Ollama. The response contains the
answer, used model, scope label, context metrics, discovered temporal series,
source dataset ids and warnings. Missing measurements remain unavailable;
specifically, no water volume is inferred from 2D water geometry.