Open·Parlamento
query the law · real sources · living graph
Open·ParlamentoHow Open·Parlamento works
method · objective · roadmap

How Open·Parlamento works

Open·Parlamento is not a «fixed» legal chatbot: it is an agent that answers by uniting law and public data, always citing the source. Here I explain the objective, how the graph is built, how the agent retrieves and evaluates information, and where the project is heading.

The objective

To make the State queryable by anyone — not just lawyers and insiders — with answers traceable back to the official source.

There is a gap no one bridges today: those who hold public data don’t have the law (they can’t tell you whether something is lawful or constitutional); legal bots have the law but no data, and often hallucinate without real citations. Open·Parlamento unites the two worlds — «law ↔ data» — in a single navigable graph.

§

Real, citable sources

Every legal statement resolves to an article with a stable identifier: ELI for Italy, CELEX for the EU. Never paraphrased.

Honest refusal

If there is no source, the agent says so and does not make things up («refuse-on-no-source»).

Transparent provenance

Authoritative relations (from Normattiva) are clearly distinct from AI-inferred ones, with visible confidence.

The three-layer knowledge graph

To avoid the risk of «an AI rewriting the law», knowledge is layered. Three layers, with clear-cut roles.

Layer 0

Authoritative source (immutable)

Verbatim text of the statute + stable ID (ELI / CELEX). This is what every citation resolves to. Never paraphrased by the LLM.

Layer 1

Relations graph

Article-level typed relations between statutes, with provenance and confidence. It is «knowledge compiled ahead of time», not invented on the fly.

Layer 2

Explanatory wiki

Plain-language pages and thematic maps built on top of the law — commentary, not source. Also great as indexable content.

The typed relations

The heart of Layer 1 is not guessed by an LLM: it is extracted deterministically from Normattiva in Akoma Ntoso format (the activeModifications / passiveModifications blocks). Each edge is article-level, with the evidence text attached, «created_by: normattiva» and confidence 1.0.

RelationMeaningSource
amendsOne statute amends articles of anothernormattiva
repealsFull or partial repealnormattiva
replacesReplaces the text of a provisionnormattiva
insertsInserts a new provisionnormattiva
extendsExtends a deadlinenormattiva
convertsConverts a decree-law into statutenormattiva
implements_delegationImplements a legislative delegationnormattiva
transposesTransposes an EU directivenormattiva
E.g. DL 19/2024 (PNRR) → converted into L. 56/2024; hundreds of authoritative relations toward other statutes (amends, replaces, inserts, repeals…), including the codes already in the graph.

On top of this deterministic base, AI-inferred edges are added (impacts on rights and sectors), always labeled as such («created_by: ai», with visible confidence). Honesty about the source comes first.

How the agent answers

At the center is a function-calling agent: it reads the question, picks the right tools, queries them, evaluates the results and synthesizes an answer that cites the sources.

QuestionAgentTool selectionSource retrievalEvaluationCited answer + graph
01

Question

The user asks in Italian or English. The system loads the prompt and the definitions of all available tools.

02

Tool selection

The agent classifies intent and invokes one or more tools: cerca_legge (Constitution & codes), cosa_modifica / chi_modifica (Normattiva relations), cerca_ddl_senato / cerca_atti_camera (legislative process), cerca_legge_ue and cerca_sentenze_ue (EU), cerca_sentenze_cost / cassazione (case law), cerca_dati and cerca_statistiche (public data), novita_normative (Official Gazette).

03

Retrieval

Each tool queries the real source (Chamber/Senate SPARQL, LightRAG, Normattiva JSONL edges, EUR-Lex, Eurostat, CKAN) and returns structured results.

04

Evaluation

The agent assesses each result — present, empty or in error; how many and how rich — and prioritizes the sources that actually answer. If it finds no legal source, it says so openly and does not invent.

05

Presentation

It synthesizes an answer that integrates statute and data, with clickable verbatim citations that deep-link to the node in the graph. A «Process» panel shows which tools and sources answered, transparently.

The development plan

Principle: every milestone ships something working and visible. Incremental, anti «boil-the-ocean».

MilestonePhaseWhatStatus
M0Proof of conceptGraphRAG engine + first block of legal corpus (Constitution + codes) with ELI identifiers. Chat with real citations and refusal on source-less questions.done
M1The productFrontend with a navigable graph and chat; clickable citations that deep-link to the node.done
M2Agent & usersAgentic orchestrator, gateway with disclaimer, refuse-on-no-source, rate-limit and cache.done
M3First connector (CKAN)A single tool opens dati.gov.it, data.europa.eu and hundreds of portals; reuse of RepublicMCP for Chamber/Senate.done
M4More connectors & «law ↔ data»Case law (Constitutional Court, Cassation, EU, administrative), Eurostat statistics, Official Gazette, PNRR, reception data; norm ↔ dataset cross-links; wiki layer.in progress
M5Launch & sustainabilityPublic deploy, freemium (free graph; paid advanced chat/API), B2B/API, grant applications.next

FAQ

How does the agent avoid making answers up?

It always retrieves the source before answering: verbatim statute text with a stable ID (ELI/CELEX) and data from official portals. If it finds no source, it says so and does not improvise (refuse-on-no-source).

Where do the relations between statutes come from?

Authoritative relations (amends, repeals, replaces, converts…) are extracted deterministically from Normattiva in Akoma Ntoso format, at article level and with confidence 1.0. AI-inferred edges are kept separate and labeled as such.

What is the project’s objective?

To make the State queryable by anyone, uniting law and public data into a single navigable graph, with answers traceable back to the official source.

See also

The knowledge graph (docs) · MCP server · Open data · Projects · Versione italiana

Informational tool — not legal advice. Sources are public and citable (ELI/CELEX).