How tejaswini4119/ndra-pii works
NDRA-PII accepts documents through its API or interactive CLI, then extracts text, detects PII, fuses overlapping detections, applies governance policy, and redacts according to the resulting action. The API is the packaged server entrypoint; the CLI also has a direct-agent workflow. Audit and shared schemas support the processing stages. The tree also contains a v2 orchestration shell and RFC email parser, shown as internal components; available excerpts do not establish their runtime wiring to the primary flow. Relationships for the main pipeline follow README documentation, supplemented by shown CLI calls.
Main entry points: ndrapiicli.py Interactive CLI · extractor.py Document Extraction · classifier.py PII Classification · fusion_agent.py Entity Fusion
Components 15
User Entry
- Packaged API
ndra_stack/api.py - API Server
main.py - Interactive CLI
ndrapiicli.py
PII Processing
- Document Extraction
agents/extractor.py - PII Classification
agents/classifier.py - Entity Fusion
agents/fusion_agent.py
Governance & Output
- Policy Evaluation
agents/policy_agent.py - PII Redaction
agents/redaction_agent.py - Audit Trail
agents/audit.py - Sanitized Document
Runtime Support
- Shared Data Models
schemas/core_models.py - Runtime Settings
config/settings.py - V2 Orchestrator
core/v2/pipeline.py - RFC Email Parser
core/v2/parsers/rfc_email_parser.py
Other components
- Document User
Connections 19
- Document User → Packaged API: uploads document
README.md - Document User → Interactive CLI: selects document
README.md - Packaged API → API Server: delegates to
ndra_stack/api.py - API Server → Document Extraction: starts processing
README.md - Document Extraction → PII Classification: passes chunks
README.md - PII Classification → Entity Fusion: passes detections
README.md - Entity Fusion → Policy Evaluation: passes entities
README.md - Policy Evaluation → PII Redaction: passes actions
README.md - PII Redaction → Sanitized Document: produces sanitized output
README.md - Interactive CLI → Document Extraction: calls extraction
ndrapiicli.py - Interactive CLI → PII Classification: calls classification
ndrapiicli.py - Interactive CLI → Entity Fusion: calls fusion
ndrapiicli.py - Interactive CLI → Policy Evaluation: calls evaluation
ndrapiicli.py - Interactive CLI → PII Redaction: calls redaction
ndrapiicli.py - Document Extraction → Runtime Settings: reads controls
agents/extractor.py - PII Classification → Shared Data Models: creates typed results
agents/classifier.py - Entity Fusion → Shared Data Models: uses entity schemas
agents/fusion_agent.py - Policy Evaluation → Shared Data Models: uses decision schemas
agents/policy_agent.py - PII Redaction → Shared Data Models: uses governed chunks
agents/redaction_agent.py