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 needs gkb: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

get(artifact_id)

GET /v1/gkb/artifacts/{artifact_id}

query(query)

POST /v1/gkb/query

structured_search_page(request)

POST /v1/gkb/search-page

list_projects()

GET /v1/gkb/projects

Publish an artifact#

  1. 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. The artifact_id and created_at are 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.
    
  2. 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/artifacts with the Markdown and an Idempotency-Key header. POST /v1/gkb/artifacts/validate checks 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.