---
name: undominated-graph-rag-extraction-tax-audit
description: "Calculates entity-relationship extraction token overhead and graph construction costs compared to vector retrieval. Recomputed fields must match the other inputs. A pass is not a compliance, safety, or price verdict."
license: MIT
metadata:
  author: Undominated.ai
  version: "1.1.0"
---

# Graph RAG Extraction Tax Audit

## Description
Calculates entity-relationship extraction token overhead and graph construction costs compared to vector retrieval.

## Category
`agentic`

## Tags
`graph-rag`, `knowledge-graph`, `extraction-tax`, `token-cost`

## When to Use
Audit knowledge graph construction pipelines to ensure extraction token spend remains within budget.

## Operational Limitations
Evaluates prompt token inflation for entity and relationship triples extraction.

## Verification Script
Run the deterministic verification checker:
```bash
python3 scripts/check.py examples/synthetic.json
```
Exit codes:
- `0`: Check passed and thresholds satisfied.
- `1`: Threshold breach or operational violation detected.
- `2`: Schema error or invalid usage.

## What the checker recomputes

- `ratio` = 1 * extraction_prompt_tokens / raw_text_tokens, then the original `>` check against `max_allowed_token_expansion_ratio`. `extraction_prompt_tokens` cannot exceed `raw_text_tokens`.

Every other declared field is type-checked. A negative value is rejected except for deltas, drifts, and gains. A type check does not, by itself, prove the measurement.

`population` and `observedAt` are required. The bundled examples are synthetic fixtures, not market measurements.

```bash
python3 scripts/check.py examples/synthetic.json
python3 scripts/check.py examples/contradiction.json
python3 scripts/check.py examples/broken.json
```

Exit 0 is a pass, exit 1 is a review, and exit 2 is invalid input. A pass does not certify a provider, a regulation, a release, or a price.
