location_tagger

location_tagger is an agent for coding agents from Open-Source-Legal/OpenContracts. It costs 0 tokens per session (1,406 once invoked), scanned A, original, MIT.

A built-in document agent that finds place names and adds geographic annotations with coordinates and administrative codes. These annotations can appear as pins on map views.

In plain words
What is it for?
Use it on a document collection to identify countries, states, and cities, geocode them, and show them on the Discover and Corpus Home maps.
Why use it?
It turns ordinary place mentions into map-ready location data without requiring each place to be tagged manually.

Agent

About the project

OpenContracts is an open-source document intelligence platform that turns document collections into searchable citation graphs with annotations, structured extraction, and AI agents. Builders and teams use it to work with unstructured documents through APIs, an MCP server, or a web interface. The catalogue entries extend the platform with agent, instruction, and rule workflows.

Open-Source-Legal/OpenContracts · 1,462 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/open-source-legal/opencontracts/location_tagger
Clone the repo
git clone --depth 1 https://github.com/Open-Source-Legal/OpenContracts

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for location_tagger

README.md
[![agentmods](https://agentmods.dev/badge/agents/open-source-legal/opencontracts/location_tagger.svg)](https://agentmods.dev/agents/open-source-legal/opencontracts/location_tagger)
Your own site
<a href="https://agentmods.dev/agents/open-source-legal/opencontracts/location_tagger"><img src="https://agentmods.dev/badge/agents/open-source-legal/opencontracts/location_tagger.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,406 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01406
Opus 5 $0.00000 $0.00703
Sonnet 5 $0.00000 $0.00281
Haiku 4.5 $0.00000 $0.00141

Measured 5d ago against content hash 0595b631e99c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

location_tagger scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/location_tagger.md · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Location Tagger Agent

The Location Tagger is a built-in, global default agent that automatically finds place names in a document and turns them into geocoded annotations: OC_COUNTRY, OC_STATE, and OC_CITY. Each annotation it creates carries the resolved coordinates and administrative codes in its data payload, so the places show up as pins on the Discover and Corpus Home maps.

It is wired to run through the ordinary corpus-actions framework — the same execution path used by the built-in Document Assistant and Corpus Assistant — so you configure it once on a corpus and it runs automatically.

What it does

For every place mention it recognises, the agent calls the add_annotations_from_exact_strings tool with the appropriate label and a set of hints. When the label is one of the geographic labels (OC_COUNTRY / OC_STATE / OC_CITY), the tool routes the string through the offline geocoding service (#1819) and stores the result on the annotation:

{
  "canonical_name": "Austin",
  "lat": 30.2672,
  "lng": -97.7431,
  "admin_codes": { "iso_alpha2": "US", "admin1": "TX" },
  "geocoded": true
}

Non-geographic labels are unaffected — the hints field is simply ignored for them, so existing callers of the tool keep working unchanged.

Configuration walkthrough

  1. Migrate. After deploying, run migrations. The Location Tagger appears as a global, public agent in the agent picker:

    docker compose -f production.yml --profile migrate up migrate
    

    Note — the migration is a one-time snapshot. It copies DEFAULT_LOCATION_TAGGER_INSTRUCTIONS from settings into the agent's system_instructions column at creation time. If you later improve the prompt in config/settings/base.py, existing databases keep the old prompt — update the Location Tagger agent record via the Django admin (or a follow-up data migration) to pick up the revision.

Read the full file on GitHub · 115 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 115 lines · 0 tokens per session scan A 0595b631e99c

Subscribe to this mod's changes

location_tagger is an agent published in the GitHub repository Open-Source-Legal/OpenContracts (1,462 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,406 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.