EPA is a composable, auditable meta-layer for integrating language models, designed to ensure ethical, context-rich, and traceable operations.
It embodies the Universal Flourishing Objective (ϕ₁) and supports modular extension for future ethical, technical, or operational requirements.
- Contextualization Module: Injects roles, time, user input, constraints, memory state, and custom context into all prompts.
- Ethical Gating Module: Prunes or allows actions based on ethical score (F) relative to threshold (θ₀).
- Audit & Trace Module: Generates GoldenDAG, Trace ID, and Codex ID for every EPA invocation.
- Qualia & PII Redaction Module: (Stub) Redacts or flags qualia-sensitive and PII content (extend as needed).
- Memory & State Management: Allows dynamic updates to memory/context.
- Extensibility Hooks: Supports adding constraints and custom context.
from epa.core import EPA
epa = EPA(system_role="Code Ethics Advisor")
prompt, ids = epa.build_epa("Refactor the code for efficiency.", {"project": "EPA Scaffold"})
print(prompt)
print(ids)
# Ethical gating example
F = 1.0 # Calculated ethical score
if not epa.ethical_gate(F, θ₀=0.5):
raise PermissionError("Action pruned: does not meet Universal Flourishing Objective (ϕ₁).")- Implement custom logic in
redact_qualia_piifor advanced redaction. - Override/add modules for domain-specific constraints, memory, or ethics.
from setuptools import setup, find_packages
setup(
name="epa",
version="0.1.0",
description="Ethical Prompt Architecture (EPA) Scaffold",
author="NeuralBlitz",
packages=find_packages(),
install_requires=[],
python_requires=">=3.7",
)
MIT License (or as specified by project owner)