Core#

Core components Core components

core/ is the serving code shared by knowledge, tools and skills.

Component

Code

What it does

REST app

core/api/app.py

The /v1 FastAPI app: correlation IDs, body limits, authentication, forwarding to other API roles, and the routers that knowledge, tools and parts register. Runs as services-api

Access + identity

core/access/

OIDC sign-in, API tokens, consent, workload credentials and scopes. Every API role authenticates against the same access records in PostgreSQL

MCP server

core/mcp/src/geonemo/mcp/

Scoped MCP tools and skill resources over stdio and streamable HTTP. It calls the REST API like any client. Runs as services-mcp; the scope comes from a file

Part registry

core/parts.py

Where parts add routers, settings, runtime services, CLI groups and checks. See Parts

Event feeds

core/events/

Read-only, cursor-based feeds of catalog and GKB changes, kept for seven days. Nothing is claimed or acknowledged

Health + status

core/api/health.py

Liveness, readiness, per-service status, incidents and history. Runs as health-monitor

Idempotency + spans

core/idempotency.py

Durable receipts for retried writes; OpenTelemetry spans to any OTLP collector

Admin CLI

core/cli.py

geonemo-services: host-local administration of the database, access, GKB and retrieval. Runs as database-admin. Destructive operations are never remote APIs

Access and scopes#

A caller sees only what its scope grants. Reads need services:read; a change needs the scope its route names (for example gkb:publish, gpu:manage, collections:manage), and parts name their own. A write that may be retried carries an Idempotency-Key.

API roles#

One process serves one role, chosen with geonemo-services api --role or GEONEMO_API_ROLE.

Role

Serves

all

Every role in one process (default)

toolkit

The toolkit /v1 routers

agent-service

The agent service routers

monitoring

The monitoring routers

The toolkit role forwards the agent service’s and monitoring’s paths to their own processes, so clients keep one address.

A request#

A request inside the server A request inside the server

Step

What happens

1

The request carries Authorization, X-GeoNemo-Project-ID and, for a write, Idempotency-Key

2

Middleware sets a correlation ID, checks the project ID, limits the body and applies CORS

3-4

Access authenticates a bearer token for the API audience, or a console session, and returns the principal and its scopes

5

A workload credential is admitted by the issuing orchestration and checked against its tool grants

6-7

The route’s scope is required; the request goes to the matching router, or to another role’s process

8-9

The handler validates the body and calls the service. A repeated Idempotency-Key returns the recorded result

10

Operation spans leave through OpenTelemetry

11

The response carries X-Correlation-ID and Cache-Control: no-store