Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

122 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TERE4AI v2

Evidence-gated compliance support for the EU AI Act. TERE4AI turns the Act and the AI HLEG Trustworthy AI guidelines into a provenance-carrying knowledge graph, exposes it through versioned MCP tools, and gates every generated requirement and evidence evaluation behind build-time and runtime judges.

TERE4AI provides engineering and documentation support. It does not certify EU AI Act compliance and does not replace legal review, conformity assessment, or competent-authority interpretation.

Documents

File Role
docs/architecture.md Authoritative spec (layers, judges, milestones, traceability matrix)
docs/references.md Reference register; all @grounded_by tags resolve here
docs/traceability.md Generated by scripts/check_traceability.py, never hand-edited
AGENTS.md Working rules for coding agents
USER.md Human context
docs/DESIGN.md Visual design system for the demo web UI

Layout

See docs/architecture.md Section 18. Key paths: src/tere4ai/ (core), schema/json_schemas/ (machine-readable node and edge shapes), data/snapshots/ (frozen, checksummed legal sources), data/graph_dumps/ (versioned build artifacts), web/ (thin read-only demo UI).

Quick start (M1, structural mirror)

python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"

# build the Layer 0+1 graph dump from the frozen snapshot
.venv/bin/python -m tere4ai.parse_legal_structure

# run tests (acceptance: 113 articles, 180 recitals, 13 annexes)
.venv/bin/python -m pytest

# traceability gate (also generates docs/traceability.md)
.venv/bin/python scripts/check_traceability.py

# optional: load into Neo4j (set NEO4J_PASSWORD in .env first)
docker compose up -d

Note on graph dumps: data/graph_dumps/ holds published build artifacts and is gitignored. layer1.json rebuilds deterministically with the parse_legal_structure command above (no cost). norms_core.json and alignments_core.json come from the judged Layer 2/3 pipeline, which makes paid model calls; obtain them from a published release or rebuild via the pipeline (architecture.md Section 6). On a clone without these dumps the dump-dependent facade tests skip cleanly instead of failing.

# demo web UI (thin, read-only; docs/DESIGN.md)
.venv/bin/python scripts/export_ui_data.py
cd web && npm install && npm run build && npx next start

Demo flow (M3)

The full demo flow (classify, requirements, evidence evaluation, backlog) runs against the thin HTTP facade, which calls the same pure functions the MCP server exposes. The UI never touches the database or model APIs directly.

# 1. facade on port 8008 (loopback; CORS only for localhost:3111)
.venv/bin/uvicorn tere4ai.http_facade.app:app --port 8008

# 2. demo UI on port 3111, then open http://localhost:3111/assess
cd web && npm run build && npx next start -p 3111

/api/classify and /api/requirements are deterministic and free. /api/evidence and /api/backlog perform PAID model calls (OpenAI generator plus Anthropic runtime grounding judge; keys in .env, see .env.example) and mark their responses with the X-TERE4AI-Paid-Call header.

Status

M1 to M3 implemented, M4 harness ready (see docs/architecture.md Section 14 and docs/traceability.md, which is generated from code tags):

  • M1: deterministic Layer 1 mirror of the full Act (113 articles, 180 recitals, 13 annexes, 467 points, 217 annex items), version pin (base Act in force, Digital Omnibus as an amending source), crossrefs, coverage and trace tools, traceability gate.
  • M2: judged Layer 2/3 over the high-risk core. 434 extracted norms (339 judge-accepted), 620 reified HLEG alignment assertions (475 accepted), independent judge family (OpenAI generator, Anthropic judges), all in Neo4j with per-edge provenance and full audit logs.
  • M3: runtime tools. Deterministic classify_ai_system (rules over real Article 5 and Annex III nodes, never an LLM) and get_applicable_requirements; judged evaluate_project_evidence and generate_control_backlog gated by the runtime grounding judge; all six tools on the MCP server; HTTP facade plus the /assess demo flow.
  • M4: evaluation harness with the five-condition ablation ladder, Section 12 metrics, a 10-item seed gold set, and the located REF-15 benchmark. Live ablation runs and the full 60-80 item gold set are pending research work (cost-gated; see eval/README.md).

License

Decided 2026-07-23 (OPEN-LICENSE resolved):

  • Code (server, pipeline, web UI): AGPL-3.0-or-later, full text in LICENSE.
  • Graph metadata (the published dumps' structure, normative-statement metadata, alignments, provenance): CC BY 4.0, full text in data/graph_dumps/LICENSE. Attribution: Jose Antonio Siqueira de Cerqueira, TERE4AI.
  • EU legal texts quoted inside the graph and dumps remain (c) European Union, reused under the EU legal-reuse framework (Commission Decision 2011/833/EU); no ownership is claimed over them and quotes are served byte-exact.
  • ALTAI content is not redistributed pending its license check (task C2).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages