Read and publish knowledge#
The Geospatial Knowledge Base (GKB) stores findings as canonical Markdown with front matter. Read and query it, or publish a new artifact.
Prerequisites#
A connected client (Use the Python client). Reading needs
services:read; publishing needsgkb:publish.MCP tools:
gkb_get_artifact,gkb_publish.
Read and query#
from geonemo.client import ArtifactQuery
artifact = client.gkb.get("gkb_01M7VXND790PFN917PP25ZZYZB")
response = client.gkb.query(
ArtifactQuery(text="harbor", project_id="coastal", limit=10)
)
for hit in response.hits:
print(hit.artifact_id, hit.score)
Call |
REST |
|---|---|
|
|
|
|
|
|
|
|
Publish an artifact#
Build a draft.
render()produces the Markdown and validates it:from geonemo.client import ArtifactDraft, EvidenceRef, Source draft = ArtifactDraft( kind="observation", title="Harbor traffic", summary="Three vessels at anchor.", source=Source(name="my-agent", version="1.0"), confidence=0.8, finding="Three vessels at anchor in the outer harbor.", evidence=[EvidenceRef(uri="catalog://preview-imagery/preview-coast-001")], limitations=["Single acquisition."], project_id="coastal", )
draft.render()returns the canonical Markdown that the server stores. Theartifact_idandcreated_atare generated unless you set them:--- gkb_schema: '1.0' artifact_id: gkb_01M7XWJF1R7KDAW8DSKNDXR4BS document_type: finding kind: observation project_id: coastal visibility: private title: Harbor traffic summary: Three vessels at anchor. source: name: my-agent version: '1.0' created_at: '2026-11-21T01:47:11.800468Z' confidence: 0.8 evidence: - uri: catalog://preview-imagery/preview-coast-001 --- # Harbor traffic ## Finding Three vessels at anchor in the outer harbor. ## Evidence - `catalog://preview-imagery/preview-coast-001` ## Limitations - Single acquisition.
Publish it with an idempotency key:
receipt = client.gkb.contribute(draft, idempotency_key="harbor-001") print(receipt.artifact_id, receipt.duplicate)
REST:
POST /v1/gkb/artifactswith the Markdown and anIdempotency-Keyheader.POST /v1/gkb/artifacts/validatechecks Markdown without storing it.
Result#
Repeating the same key and content returns the first receipt with duplicate true; a
different artifact under the same key raises ServicesConflictError. Projections in the
database are rebuilt from the canonical Markdown. See Gkb API.