Modular Python tool library for AI agents in Brazilian government applications
Project description
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)
import asyncio
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",
))
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agents4gov_apps-0.1.1.tar.gz.
File metadata
- Download URL: agents4gov_apps-0.1.1.tar.gz
- Upload date:
- Size: 64.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b79d1e6536bc11285153cc52592c39a44d9c1ae7955b8c10d212d2bd63574bf
|
|
| MD5 |
0b34f67b9175678f62731f1971e9b03e
|
|
| BLAKE2b-256 |
830e843b65fca721aa9b6f80e89dae128149a10e07a22e5a8d890bcef339207b
|
Provenance
The following attestation bundles were made for agents4gov_apps-0.1.1.tar.gz:
Publisher:
publish.yml on Labic-ICMC-USP/Agents4GovApps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agents4gov_apps-0.1.1.tar.gz -
Subject digest:
5b79d1e6536bc11285153cc52592c39a44d9c1ae7955b8c10d212d2bd63574bf - Sigstore transparency entry: 1564140063
- Sigstore integration time:
-
Permalink:
Labic-ICMC-USP/Agents4GovApps@ff57ae7615393c966d01f8bc2c220a9e3968a2f0 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Labic-ICMC-USP
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff57ae7615393c966d01f8bc2c220a9e3968a2f0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agents4gov_apps-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agents4gov_apps-0.1.1-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5ca1a9926d70f08d82fa485a8c46a5e3985c71811a7c1c37e0b421e9a52b225
|
|
| MD5 |
44caa92db9fcd7983ac7fe3d0b0eb03a
|
|
| BLAKE2b-256 |
f5ca684992f43fe63455be381675bc3a5d75fc6838c92c6b9d63e4beeaddf3d2
|
Provenance
The following attestation bundles were made for agents4gov_apps-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Labic-ICMC-USP/Agents4GovApps
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agents4gov_apps-0.1.1-py3-none-any.whl -
Subject digest:
b5ca1a9926d70f08d82fa485a8c46a5e3985c71811a7c1c37e0b421e9a52b225 - Sigstore transparency entry: 1564140073
- Sigstore integration time:
-
Permalink:
Labic-ICMC-USP/Agents4GovApps@ff57ae7615393c966d01f8bc2c220a9e3968a2f0 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Labic-ICMC-USP
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff57ae7615393c966d01f8bc2c220a9e3968a2f0 -
Trigger Event:
push
-
Statement type: