Agents4GovApps
Laboratory of Computational Intelligence (LABIC – ICMC/USP)
Overview
Agents4Gov is a research and development project from LABIC – Institute of Mathematics and Computer Sciences (ICMC/USP) focused on building LLM-based tools to support and modernize public sector services. The project emphasizes local Large Language Models (LLMs) for privacy, data anonymization, and the development and evaluation of tools for use in government and institutional environments.
Installation
# Base package
pip install agents4gov-apps
# With OpenML tools
pip install agents4gov-apps[openml]
# With browser-based tools (Lattes)
pip install agents4gov-apps[browser]
# With GNews collector
pip install agents4gov-apps[gnews]
Quick start
from agents4gov_apps import load_tool_instance
import json
# OpenAlex
tool = load_tool_instance("openalex_doi")
result = json.loads(tool.get_openalex_metadata_by_doi(doi="10.1038/s41586-021-03819-2"))
# GNews (async, with per-window progress log)
import asyncio, logging
from agents4gov_apps.gnews_collector import console_emitter
logging.basicConfig(level=logging.INFO)
tool = load_tool_instance("gnews_collector")
result = asyncio.run(tool.collect_general_news(
query='"ICMC USP"',
start_year_month="2023-01",
end_year_month="2024-12",
__event_emitter__=console_emitter(),
))
Research pipelines
End-to-end scripts that drive the bundled tools for concrete research tasks.
They use only the public API (load_tool_instance + the tool's documented
methods) so they keep working with any pip install agents4gov-apps version.
Gender-violence news monitoring (10-year window)
Crawls Brazilian Portuguese news for a curated list of gender-violence queries
(read from an Excel file with query + categoria da query columns), then
produces initial indicators: frequency by category over time, top publishers,
spike detection.
Pipeline files (under scripts/):
collect_violencia_genero.py— drivesgnews_collector.collect_general_newsone query at a time across monthly windows. Idempotent (skips parquets already on disk via the library's built-in checkpoint), supports SerpAPI primary + gnews fallback, and exports an Excel workbook with one sheet per category.analyze_violencia_genero.py— reads the parquets, joins the category from the queries Excel, and writes a report workbook withfreq_yearly,freq_monthly,top_publishers,top_publishers_por_cat, andspikessheets, plus optional PNG/SVG plots.
Usage:
pip install agents4gov-apps[gnews] openpyxl python-dotenv matplotlib
# 1) Smoke test (one query, one month)
SERPAPI_KEY=... python3 scripts/collect_violencia_genero.py \
--auto-fallback --limit-queries 1 --start 2024-01 --end 2024-01
# 2) Full collection (81 queries × 121 months, ~10-14h on SerpAPI)
SERPAPI_KEY=... python3 scripts/collect_violencia_genero.py --auto-fallback \
2>&1 | tee collect.log
# 3) Indicators
python3 scripts/analyze_violencia_genero.py \
--output-dir ./gnews_output_violencia_genero \
--queries-xlsx ./gnews_queries_violencia_genero.xlsx
The collector is resumable — interrupt with Ctrl+C and re-run; it skips every window whose parquet is already on disk.
Adapt the same shape to other query sets by replacing the Excel file (any
two-column query + categoria da query workbook works).
Documentation
- Developer Guide — architecture, standard interface, how to create and use tools across Open WebUI, LangChain, OpenAI, and other frameworks
- Tool Protocol — quick-reference packaging contract
- Available Tools — full list of tools with source links
Metadata
Release files for agents4gov-apps 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agents4gov_apps-0.2.0.tar.gz | 65.5 kB | With provenance | Details for agents4gov_apps-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agents4gov_apps-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for agents4gov_apps-0.2.0-py3-none-any.whl |
Total release size: 111.3 kB
Release files / agents4gov_apps-0.2.0.tar.gz
| Download URL | agents4gov_apps-0.2.0.tar.gz |
|---|---|
| Size | 65.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66686d7e0467cb4c9e21faf62355d32676bd6b69f0d1a224866ea0f7010a6aaf
|
|
BLAKE2b-256 checksum How to use checksums |
7c488ad79df867518268d0c86d5c4f23dd88f2229ba536f2cf2fddd9abb2c52f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 17, 2026.
Transparency logRelease files / agents4gov_apps-0.2.0-py3-none-any.whl
| Download URL | agents4gov_apps-0.2.0-py3-none-any.whl |
|---|---|
| Size | 45.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f61a9eed8481e12cac25ae1e747006c4c2e5e6d3e38e2dc4b1383f706ad03afd
|
|
BLAKE2b-256 checksum How to use checksums |
feec7680fd6207776c1a9dd21a9e968f4ec4710ae258990481588c4221977cd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 17, 2026.
Transparency logSecurity for agents4gov-apps 0.2.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.
Attestation for agents4gov_apps-0.2.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 May 17, 2026.
Transparency logA 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.