# neerajk/geoagents architecture

> Architecture diagram of the GitHub repository neerajk/geoagents, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/neerajk/geoagents
- Repository: https://github.com/neerajk/geoagents

## Overview

geoagents is a personal GeoAI project whose implemented product is a ReAct baseline for querying OGC Features, Tiles, and Maps services through MCP. A user submits a query via the CLI; configuration and keyword routing determine which tools are exposed, the LLM requests tool calls, and the agent dispatches them through the MCP hub. Tool results are saved in full and summarized for the next model turn; the run trace supports later deterministic evaluation. The README also describes a planned step-two agent framework, but its directories contain no implementation yet, so those capabilities are shown as documented, unimplemented subsystems.

Main entry points: [`src/geoagents/baseline_react/agent.py`](https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/agent.py) (ReAct agent), [`src/geoagents/baseline_react/cli.py`](https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/cli.py) (Run CLI), [`src/geoagents/mcp_hub.py`](https://github.com/neerajk/geoagents/blob/main/src/geoagents/mcp_hub.py) (MCP hub), [`src/geoagents/llm.py`](https://github.com/neerajk/geoagents/blob/main/src/geoagents/llm.py) (Chat client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Query entry"]
  node_cli["Run CLI<br/>[cli.py]"]
end

subgraph group_runtime["Baseline runtime"]
  node_settings["Settings loader<br/>[config.py]"]
  node_agent["ReAct agent<br/>[agent.py]"]
  node_routing["Server selection<br/>[server_select.py]"]
  node_summaries["Tool summaries<br/>[summarise.py]"]
  node_hub["MCP hub<br/>[mcp_hub.py]"]
end

subgraph group_integrations["Model and OGC tools"]
  node_llm_client["Chat client<br/>[llm.py]"]
  node_model["OpenAI-compatible model"]
  node_ogc_servers["OGC MCP servers"]
  node_ogc_endpoints["OGC endpoints"]
end

subgraph group_records["Run records and evaluation"]
  node_trace["Run trace<br/>[trace.py]"]
  node_run_files["Run output files"]
  node_eval_queries["Evaluation queries<br/>[queries.yaml]"]
  node_metrics["Deterministic metrics<br/>[metrics.py]"]
end

subgraph group_framework["Planned framework"]
  node_directing["Directing agent"]
  node_data_agent["Data agent"]
  node_codegen["Code-generation agent"]
  node_data_loader["Data loader"]
  node_check_runner["Check runner"]
  node_sandbox["Code sandbox"]
  node_state[("State and handoffs")]
end

node_user(("GeoAI user"))

node_user -->|"submits query"| node_cli
node_cli -->|"loads settings"| node_settings
node_cli -->|"runs query"| node_agent
node_cli -->|"constructs client"| node_llm_client
node_cli -->|"opens hub"| node_hub
node_cli -->|"creates trace"| node_trace
node_agent -->|"selects servers"| node_routing
node_agent -->|"gets tools"| node_hub
node_agent -->|"requests turn"| node_llm_client
node_agent -->|"dispatches calls"| node_hub
node_agent -->|"summarizes results"| node_summaries
node_agent -->|"records run"| node_trace
node_llm_client -->|"sends chat"| node_model
node_hub -->|"calls MCP tools"| node_ogc_servers
node_ogc_servers -.->|"queries APIs"| node_ogc_endpoints
node_trace -->|"writes outputs"| node_run_files
node_metrics -->|"reads traces"| node_run_files
node_metrics -->|"scores against"| node_eval_queries
node_directing -.->|"uses handoffs"| node_state
node_data_agent -.->|"uses handoffs"| node_state
node_codegen -.->|"uses handoffs"| node_state
node_data_agent -.->|"calls services"| node_data_loader
node_codegen -.->|"uses service"| node_sandbox
node_directing -.->|"uses service"| node_check_runner

click node_cli "https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/cli.py"
click node_settings "https://github.com/neerajk/geoagents/blob/main/src/geoagents/config.py"
click node_agent "https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/agent.py"
click node_routing "https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/server_select.py"
click node_summaries "https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/summarise.py"
click node_hub "https://github.com/neerajk/geoagents/blob/main/src/geoagents/mcp_hub.py"
click node_llm_client "https://github.com/neerajk/geoagents/blob/main/src/geoagents/llm.py"
click node_ogc_servers "https://github.com/neerajk/geoagents/tree/main/third_party/mcp-ogc"
click node_trace "https://github.com/neerajk/geoagents/blob/main/src/geoagents/trace.py"
click node_eval_queries "https://github.com/neerajk/geoagents/blob/main/evals/pdok_mini/queries.yaml"
click node_metrics "https://github.com/neerajk/geoagents/blob/main/evals/metrics.py"
click node_directing "https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/agents"
click node_data_agent "https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/agents"
click node_codegen "https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/agents"
click node_data_loader "https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/services"
click node_check_runner "https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/services"
click node_sandbox "https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/services"
click node_state "https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/state"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_user toneBlue
class node_settings,node_agent,node_routing,node_summaries,node_hub toneAmber
class node_llm_client,node_model,node_ogc_servers,node_ogc_endpoints toneMint
class node_trace,node_run_files,node_eval_queries,node_metrics toneRose
class node_directing,node_data_agent,node_codegen,node_data_loader,node_check_runner,node_sandbox,node_state toneIndigo
```

## Components

### Query entry

- [Run CLI](https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/cli.py): `src/geoagents/baseline_react/cli.py`

### Baseline runtime

- [Settings loader](https://github.com/neerajk/geoagents/blob/main/src/geoagents/config.py): `src/geoagents/config.py`
- [ReAct agent](https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/agent.py): `src/geoagents/baseline_react/agent.py`
- [Server selection](https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/server_select.py): `src/geoagents/baseline_react/server_select.py`
- [Tool summaries](https://github.com/neerajk/geoagents/blob/main/src/geoagents/baseline_react/summarise.py): `src/geoagents/baseline_react/summarise.py`
- [MCP hub](https://github.com/neerajk/geoagents/blob/main/src/geoagents/mcp_hub.py): `src/geoagents/mcp_hub.py`

### Model and OGC tools

- [Chat client](https://github.com/neerajk/geoagents/blob/main/src/geoagents/llm.py): `src/geoagents/llm.py`
- **OpenAI-compatible model**
- [OGC MCP servers](https://github.com/neerajk/geoagents/tree/main/third_party/mcp-ogc): `third_party/mcp-ogc`
- **OGC endpoints**

### Run records and evaluation

- [Run trace](https://github.com/neerajk/geoagents/blob/main/src/geoagents/trace.py): `src/geoagents/trace.py`
- **Run output files**
- [Evaluation queries](https://github.com/neerajk/geoagents/blob/main/evals/pdok_mini/queries.yaml): `evals/pdok_mini/queries.yaml`
- [Deterministic metrics](https://github.com/neerajk/geoagents/blob/main/evals/metrics.py): `evals/metrics.py`

### Planned framework

- [Directing agent](https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/agents): `src/geoagents/framework/agents`
- [Data agent](https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/agents): `src/geoagents/framework/agents`
- [Code-generation agent](https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/agents): `src/geoagents/framework/agents`
- [Data loader](https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/services): `src/geoagents/framework/services`
- [Check runner](https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/services): `src/geoagents/framework/services`
- [Code sandbox](https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/services): `src/geoagents/framework/services`
- [State and handoffs](https://github.com/neerajk/geoagents/tree/main/src/geoagents/framework/state): `src/geoagents/framework/state`

### Other components

- **GeoAI user**

## Connections

- GeoAI user → Run CLI: submits query (evidence: `README.md`)
- Run CLI → Settings loader: loads settings (evidence: `src/geoagents/baseline_react/cli.py`)
- Run CLI → ReAct agent: runs query (evidence: `src/geoagents/baseline_react/cli.py`)
- Run CLI → Chat client: constructs client (evidence: `src/geoagents/baseline_react/cli.py`)
- Run CLI → MCP hub: opens hub (evidence: `src/geoagents/baseline_react/cli.py`)
- Run CLI → Run trace: creates trace (evidence: `src/geoagents/baseline_react/cli.py`)
- ReAct agent → Server selection: selects servers (evidence: `src/geoagents/baseline_react/agent.py`)
- ReAct agent → MCP hub: gets tools (evidence: `src/geoagents/baseline_react/agent.py`)
- ReAct agent → Chat client: requests turn (evidence: `src/geoagents/baseline_react/agent.py`)
- ReAct agent → MCP hub: dispatches calls (evidence: `src/geoagents/baseline_react/agent.py`)
- ReAct agent → Tool summaries: summarizes results (evidence: `src/geoagents/baseline_react/agent.py`)
- ReAct agent → Run trace: records run (evidence: `src/geoagents/baseline_react/agent.py`)
- Chat client → OpenAI-compatible model: sends chat (evidence: `src/geoagents/llm.py`)
- MCP hub → OGC MCP servers: calls MCP tools (evidence: `src/geoagents/mcp_hub.py`)
- OGC MCP servers → OGC endpoints: queries APIs (evidence: `README.md`)
- Run trace → Run output files: writes outputs (evidence: `src/geoagents/trace.py`)
- Deterministic metrics → Run output files: reads traces (evidence: `evals/metrics.py`)
- Deterministic metrics → Evaluation queries: scores against (evidence: `evals/metrics.py`)
- Directing agent → State and handoffs: uses handoffs (evidence: `README.md`)
- Data agent → State and handoffs: uses handoffs (evidence: `README.md`)
- Code-generation agent → State and handoffs: uses handoffs (evidence: `README.md`)
- Data agent → Data loader: calls services (evidence: `README.md`)
- Code-generation agent → Code sandbox: uses service (evidence: `README.md`)
- Directing agent → Check runner: uses service (evidence: `README.md`)
