Skip to main content

Agentic environmental due-diligence text classification using EnvBert and LangGraph

Project description

-- coding: utf-8 --

"""

EnvBert-Agent

PyPI version Python Version License

EnvBert-Agent is an agentic AI pipeline for environmental due diligence text classification.

It combines:

  • ๐Ÿง  EnvBert (domain-specific transformer backbone)
  • ๐Ÿค– Optional LLM fallback
  • ๐Ÿ” Agentic routing & confidence arbitration
  • ๐Ÿ“Š Quality control & explainability
  • ๐Ÿงฉ Modular LangGraph orchestration

๐Ÿ‘ฉโ€๐Ÿ’ป Authors

  • Afreen Aman
  • Deepak John Reji

๐Ÿš€ Features

  • Environmental domain classification using EnvBert
  • Confidence-based fallback to LLM
  • Agentic workflow orchestration via LangGraph
  • CLI interface for quick usage
  • Python SDK interface for integration
  • Designed for due diligence, remediation, and compliance workflows

๐Ÿ“ฆ Installation

Install from PyPI:

pip install envbert-agent

โš™๏ธ Requirements

  • Python 3.9+
  • Transformers (version constrained for TensorFlow compatibility)
  • TensorFlow (required by EnvBert backbone)

๐Ÿ–ฅ๏ธ CLI Usage

After installation:

envbert-agent "BEHP was detected in groundwater"

Example output:

Label: Contaminated Media
Confidence: 0.87
Route: envbert

๐Ÿงช Python Usage

Basic Usage

from envbert_agent import run

text = "BEHP was detected in groundwater"
result = run(text)

print(result)

Direct CLI Invocation from Python

from envbert_agent.cli import main

main(["BEHP was detected in groundwater"])

Graph Edges & Flow

START
  โ†“
[preprocess] โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ†“                           โ”‚
[envbert] โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ†“                           โ”‚
[arbitrate]                   โ”‚  Conditional Router:
  โ”œโ”€ (quality < 0.4)          โ”‚      route = "review"
  โ”œโ”€ (confidence โ‰ฅ 0.75) โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ†’ route = "accept"
  โ””โ”€ (confidence < 0.75) โ”€โ”€โ”€โ”€โ”€โ”˜      route = "llm"
       โ†“
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ†“          โ†“          โ†“
  (review)   (accept)   (llm)
    โ†“          โ†“          โ†“
    โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ†’[llm]โ†โ”€โ”€โ”€โ”€โ”€
            โ†“
        [evaluate]
            โ†“
        [explain]
            โ†“
        [monitor]
            โ†“
           END

๐Ÿ“œ License

MIT License

See the LICENSE file for details.

โš ๏ธ Notes

  • This package depends on the EnvBert backbone.

  • Transformers version is constrained for TensorFlow compatibility.

  • Future versions may migrate to a PyTorch backend for improved compatibility and lighter installation footprint.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envbert_agent-0.1.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envbert_agent-0.1.1-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file envbert_agent-0.1.1.tar.gz.

File metadata

  • Download URL: envbert_agent-0.1.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for envbert_agent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 24848b833be7dabe26b46e4e57ce5fef96e569561bd6239f76e1956fe02400f5
MD5 8ba23f12a90a944b7fe4ba73a2df4a08
BLAKE2b-256 233dc642045ce8caa7127ac1a95953d5ce71225318e9ef14af74569ac1e5fbbc

See more details on using hashes here.

File details

Details for the file envbert_agent-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: envbert_agent-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for envbert_agent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6889abd02e269bbf746e35a0d31d7b44ffee4b7e129833d3919a9b2bb8efda7e
MD5 521e590bd91318b2ea3d2b323f127972
BLAKE2b-256 b9be4896aeb6058a2c7842b3cfd9768eadd14ecfb016d0a9e0839bafb1f071f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page