Metadata-Version: 2.4
Name: envbert-agent
Version: 0.1.1
Summary: Agentic environmental due-diligence text classification using EnvBert and LangGraph
Author: Afreen Aman, Deepak John Reji
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: EnvBert>=1.0.8
Requires-Dist: langgraph
Requires-Dist: langdetect
Requires-Dist: transformers<4.40,>=4.30
Requires-Dist: torch
Provides-Extra: ollama
Requires-Dist: langchain-community; extra == "ollama"
Provides-Extra: openai
Requires-Dist: langchain-openai; extra == "openai"
Provides-Extra: azure
Requires-Dist: langchain-openai; extra == "azure"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# -*- coding: utf-8 -*-
"""

# EnvBert-Agent

[![PyPI version](https://img.shields.io/pypi/v/envbert-agent.svg)](https://pypi.org/project/envbert-agent/)
[![Python Version](https://img.shields.io/pypi/pyversions/envbert-agent.svg)](https://pypi.org/project/envbert-agent/)
[![License](https://img.shields.io/pypi/l/envbert-agent.svg)](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:

```bash
pip install envbert-agent
```

## ⚙️ Requirements

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


## 🖥️ CLI Usage

After installation:

```bash
envbert-agent "BEHP was detected in groundwater"
```
Example output:

```bash
Label: Contaminated Media
Confidence: 0.87
Route: envbert
```

## 🧪 Python Usage
Basic Usage

```bash
from envbert_agent import run

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

print(result)
```

## Direct CLI Invocation from Python

```bash
from envbert_agent.cli import main

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

## Graph Edges & Flow

```text
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.
