Skip to content

Web UI

GeoAgent includes a Solara-based browser workspace for map-bound chat. The UI creates a persistent live map for the current browser session, binds it to a GeoAgent, and lets you control the provider, model, fast mode, and confirmation policy from the page.

Quick Start

Install the UI dependency plus at least one web map backend:

1
pip install "GeoAgent[ui,anymap,openai]"

anymap is preferred. If it is not installed, the UI tries leafmap:

1
pip install "GeoAgent[ui,leafmap,openai]"

Launch the UI:

1
geoagent ui

Or run Solara directly. The UI's pages directory is shipped inside the installed geoagent package, so resolve it dynamically rather than relying on a relative path that only exists in a source checkout:

1
solara run "$(python -c 'from geoagent.ui import PAGES_DIR; print(PAGES_DIR)')"

If you are working from a source checkout you can also run solara run geoagent/ui/pages directly from the repository root.

Workspace

The first screen is the chat-and-map workspace. It includes:

  • a persistent interactive map where layers accumulate across prompts;
  • provider and model controls for OpenAI, ChatGPT/Codex OAuth, Anthropic, Google Gemini, Bedrock, LiteLLM, vLLM, and Ollama;
  • a fast-mode toggle for lower-latency map-control prompts;
  • an auto-approve toggle for confirmation-required tools;
  • chat history for the current browser session;
  • executed tool names, cancelled tool names, and compact tool-call results.

The MVP uses non-streaming agent.chat(...) calls. Provider credentials are still configured through the same environment variables used by the Python API, such as OPENAI_API_KEY, OPENAI_CODEX_ACCESS_TOKEN, ANTHROPIC_API_KEY, GEMINI_API_KEY, LITELLM_API_KEY, VLLM_BASE_URL, VLLM_MODEL_ID, OLLAMA_HOST, or AWS credentials for Bedrock.

Safety

The web UI denies confirmation-required tools by default. This means requests that remove layers, clear layers, save maps, or run other gated actions will be cancelled unless you enable Auto-approve confirmation tools.

Use auto-approve only for trusted sessions. It applies to the current UI session and allows GeoAgent to execute tools marked as confirmation-required, destructive, or long-running.

Python API

You can also launch the UI programmatically:

1
2
3
from geoagent.ui import launch_ui

launch_ui()

Module Reference

geoagent.ui.launch_ui(extra_args=None)

Launch the Solara UI for GeoAgent.

Parameters:

Name Type Description Default
extra_args Optional[List[str]]

Additional args passed to solara run.

None

Returns:

Type Description
int

Process return code.

Source code in geoagent/ui/__init__.py
def launch_ui(extra_args: Optional[List[str]] = None) -> int:
    """Launch the Solara UI for GeoAgent.

    Args:
        extra_args: Additional args passed to `solara run`.

    Returns:
        Process return code.
    """
    cmd = [sys.executable, "-m", "solara", "run", PAGES_DIR]
    if extra_args:
        cmd.extend(extra_args)
    try:
        return subprocess.call(cmd)
    except FileNotFoundError:
        raise RuntimeError(
            "Solara is not installed. Install with `pip install solara`."
        )