Skip to main content

limen-agents

The AI module of Limen, an open early-warning system for landslides, floods and wildfires in Italy. It contains:

  • the language model providers behind one interface, with a spending cap;
  • the checks that keep a model's numbers honest;
  • the one MCP server of the project;
  • Limen as an A2A agent.
pip install "limen-agents[mcp]"        # the MCP server over the open-data libraries
pip install "limen-agents[a2a]"        # the A2A agent
pip install "limen-agents[providers]"  # the Anthropic and OpenAI SDKs

Python 3.12+. Apache-2.0.

Where it sits

The project is split by job:

  • The open-data libraries handle data and nothing else, and none of them has a server of its own. They are dpc-radar, rainfall-thresholds, ispra-idrogeo, ingv-shakemap, glofas-ewds, fwi-chain, effis-client, firms-client, copernicus-ems, egms-client and imageserver-export.
  • limen-core joins the libraries: scoring, verification, the evidence of a cell. It is the only package that reaches them.
  • limen-ml trains and serves the models.
  • limen-agents (this package) is where a language model enters: providers, budget, checks, and the servers for assistants and agents.
  • Limen is the application: the database, the scheduler, the API, the alerts and the page. It uses limen-core and limen-agents.

The MCP server

limen-agents-mcp                 # standard input and output
limen-agents-mcp --http          # Streamable HTTP on 127.0.0.1:8790
claude mcp add limen -- uvx --from "limen-agents[mcp]" limen-agents-mcp

Each tool reads a library through limen_core.evidence:

  • rain_at and storms_now: radar rain and storms in progress (DPC);
  • landslides_near: landslides of the IFFI inventory (ISPRA);
  • earthquakes_near: earthquakes and the ground shaking they caused (INGV ShakeMap);
  • fire_danger: fire danger (EFFIS);
  • fires_in_area: fires seen from space (NASA FIRMS);
  • evidence: every reading a Limen analyst gets for a hazard on some places;
  • check_numbers: the numbers of a text that are not in the results.

The instructions the model receives are the ANSWER_RULES of each library, joined. Every number must come from a result; null means not measured, never zero; nothing here is an alert.

An application adds its own tools. Limen adds its assessments and alerts this way:

from limen_agents.mcp_server import create_server


async def assessment(aoi: str) -> dict:
    """The latest assessment of an area."""
    ...


server = create_server(extra_tools=[assessment])

The A2A agent

limen-agents-a2a                 # http://127.0.0.1:8791, card at /.well-known/agent-card.json

Other agents find Limen through its card and send it messages over JSON-RPC (SendMessage, A2A protocol 1.0).

By default the agent needs no model. It takes a JSON request and answers with what the sources say, as data:

{"hazard": "landslide", "cells": [{"id": "a", "lon": 16.05, "lat": 38.91}]}

An application plugs in its own answer, one with a model behind it, as a function from text to text: create_app(answer).

Language models

from limen_agents.llm import ChatMessage, LlmConfig, resolve

factory = resolve(LlmConfig(anthropic_api_key="..."))
client = factory.create("Briefing")
text = await client.chat([ChatMessage("user", "...")])

resolve follows Limen's order:

  1. an Anthropic key, if the SDK is installed;
  2. an OpenAI key;
  3. Microsoft Foundry;
  4. llama.cpp, the self-hosted fallback.

Ollama is chosen only explicitly. A MonthlyBudget over a store you provide caps the paid models; when the spend cannot be read, it lets no call through.

Checks

unknown_numbers(text, source) gives the numbers of a text that are not in the message the model received. evaluate_briefing adds the rules of a public briefing: length, no lists, no alarm terms, no orders to the reader. These are pure functions, with no model.

Limits

  • Some library tools are not here yet. The MCP server covers the readings of limen_core.evidence. River discharge (glofas-ewds), the EMS flood maps (copernicus-ems) and ground motion (egms-client) will follow.
  • No model is called by this package unless you configure one. The default A2A answer is deterministic.
  • The faithfulness check finds invented numbers, not misplaced ones. A true number said of the wrong thing passes it.
  • The servers have no authentication. They listen on 127.0.0.1; see SECURITY.md.
  • Not an alert service. The official alert is the criticality bulletin of the Civil Protection Department and of the Region.

Licence

Apache-2.0. The data read by the tools keep their own licences: DPC and IFFI CC BY-SA 4.0, INGV, EFFIS and NASA FIRMS as stated in each answer.

Metadata

Release files for limen-agents 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for limen-agents 0.1.0
File Size Uploaded Provenance Actions
limen_agents-0.1.0.tar.gz 26.3 kB With provenance Details for limen_agents-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for limen-agents 0.1.0
File Interpreter ABI Platform Actions
limen_agents-0.1.0-py3-none-any.whl Python 3 none any Details for limen_agents-0.1.0-py3-none-any.whl

Total release size: 58.6 kB

Release files / limen_agents-0.1.0.tar.gz

Download URL limen_agents-0.1.0.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
826bf8bd1a484f079c55efe40d26562b007218f3d2b95b9e5c4313d7387af7cc
BLAKE2b-256 checksum
How to use checksums
ed2ac0cc4299d5c7b3396a601f160a4c870aa5c94cbc902c11dc5b844cef6505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / limen_agents-0.1.0-py3-none-any.whl

Download URL limen_agents-0.1.0-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e50b5b7ca9127f83015c496b37e770ef926a4dc41d1a14a6d42eea97d04a944
BLAKE2b-256 checksum
How to use checksums
70f6f0010d8748c58182187b7c03f3a4555518e6df76bb46d05b1f6d78e14581
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for limen-agents 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for limen_agents-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page