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.
Authoritative source (immutable)
Verbatim text of the statute + stable ID (ELI / CELEX). This is what every citation resolves to. Never paraphrased by the LLM.
Relations graph
Article-level typed relations between statutes, with provenance and confidence. It is «knowledge compiled ahead of time», not invented on the fly.
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.
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.
Question
The user asks in Italian or English. The system loads the prompt and the definitions of all available tools.
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).
Retrieval
Each tool queries the real source (Chamber/Senate SPARQL, LightRAG, Normattiva JSONL edges, EUR-Lex, Eurostat, CKAN) and returns structured results.
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.
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».
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).