Metadata-Version: 2.4
Name: goalroute
Version: 0.1.0
Summary: Deterministic DAG routing based on business goals with qualitative-to-quantitative KPI conversion from multiple PDF documents.
Author: goalroute contributors
License-Expression: MIT
Project-URL: Homepage, https://example.com/goalroute
Project-URL: Repository, https://example.com/goalroute
Keywords: dag,routing,kpi,business-goals,pdf,decision,qualitative,quantitative
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Office/Business
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: pdf
Requires-Dist: pypdf>=3.0.0; extra == "pdf"
Provides-Extra: full
Requires-Dist: pypdf>=3.0.0; extra == "full"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pypdf>=3.0.0; extra == "dev"
Dynamic: license-file

# goalroute

Deterministic DAG routing based on business goals, with qualitative-to-quantitative
KPI conversion (economic and impact) captured from multiple PDF documents.

## What it does

1. **Ingest** business intent (text or plain-text extracted from PDFs).
2. **Convert** qualitative language into quantitative KPIs using named,
   reproducible evaluation scales (economics + impact).
3. **Route** through a deterministic Directed Acyclic Graph (DAG) of decisions/
   actions, driven by the business goals and their quantified KPIs.

Everything is deterministic: the same inputs always yield the same route.

## Install

```bash
pip install goalroute          # core (stdlib only)
pip install goalroute[pdf]     # adds PDF extraction via pypdf
```

## Quick start

```python
from goalroute import GoalRouteEngine, Goal, DocumentSource

goals = [
    Goal(name="reduce_cost", weight=0.6),
    Goal(name="customer_delight", weight=0.4),
]

engine = GoalRouteEngine(goals)

# Capture intent from a PDF (needs pypdf), or pass text directly.
pdf_text = DocumentSource.from_pdf("proposal.pdf")   # str or None if no pypdf

docs = [pdf_text, "Reduce operational cost while improving satisfaction."]

report = engine.run(docs)
print(report.route)      # list of decision nodes
print(report.scores)     # quantified KPI scores per goal
```

## Core concepts

- `DocumentSource` — reads text from PDFs and/or raw text.
- `Goal` — a weighted business goal.
- `KpiConverter` — maps qualitative phrases to quantitative KPIs
  (economic value and impact) using built-in deterministic scales.
- `DecisionDag` — a DAG of decision nodes with deterministic path selection.
- `GoalRouteEngine` — orchestrates capture → convert → route.
- `RouteReport` — the deterministic result.

## Determinism

The routing is fully deterministic given the same inputs:

- KPI scales are closed-form lookup tables (no randomness).
- Ties are broken by node order in the DAG, never by RNG.
- No network calls or mutable global state.

## Development

```bash
pip install -e ".[dev]"
pytest
```

## License

MIT
