Datons Apps #1 - Legal AI Agent for Spanish Official Gazette (BOE) | Skip 200 Pages

Live demo of an AI agent that analyzes Spanish Official Gazette (BOE) documents. Query decrees, regulations, and resolutions in natural language, without reading hundreds of pages.

February 3, 2026 16:00 CET 21:47 ES
ailegalboedocumentsai-agentmcp

Get weekly updates

Live coding sessions, Python libraries for energy data, and hands-on tutorials. One email per week, zero fluff.

Result

An AI agent connected to Spain’s Official Gazette (BOE) that navigates, searches, and compares Spanish legislation in natural language — including version comparison across different legislative periods.

The problem

  • Spain’s BOE publishes thousands of pages per year across decrees, resolutions, and regulations
  • Finding a specific article requires manually navigating lengthy PDFs
  • Laws change frequently and tracking what changed between versions is tedious
  • No simple way to query the content in natural language

The solution

Structured BOE repository

BOE legal document repository on datons.com

We start from a web repository on datons.com where BOE laws are structured by units: articles, rules, provisions. It’s not a flat PDF — each unit is navigable, searchable, and linked to the original BOE source.

Full-text search across all laws with direct BOE links

Search for “almacenamiento” (storage) and it shows exactly which articles mention it, with a direct link to verify on the official BOE.

Version comparison

Side-by-side diff showing exact changes in law text

The most interesting feature: change history. Select two versions of a law and see exactly which words were modified, which articles were added, and which terms were replaced — for example, “comercializadores” changed to “suministradores” in the electricity sector law.

Comparing law versions — tracking changes across years

AI agent with MCP

Claude Desktop chatting about energy legislation via MCP

We connected this tool to Claude Desktop using the MCP protocol. Ask “how has energy legislation on self-consumption changed?” and the agent automatically searches across all laws, refining its queries based on context.

AI ranking search results across multiple laws

The system ranks results by similarity and context — articles, rules, and provisions appear ordered by relevance, not by document order.

Connector setup

Setting up the MCP connector in claude.ai

Anyone can connect the tool from claude.ai: profile → settings → connectors → add the datons.com URL. Authenticate with a free account and you’re ready to query.

Live queries

AI searching for BESS storage legislation in the BOE

We tested with “how has legislation on BESS storage changed?” — the agent searches for storage, energy, batteries, hybridization, and curtailment, navigating between sections and indexes to avoid overloading the context with too much text.

Features

FeatureDescription
Web repositoryBOE laws structured by units (articles, rules, provisions)
Full-text searchSearch terms across all laws with direct BOE links
Version comparisonSide-by-side diff across legislative periods
AI agent (MCP)Natural language queries from Claude Desktop or claude.ai
Semantic rankingResults ordered by relevance, not by document order
TraceabilityEvery result links directly to the article on the official BOE

Resources

Table of Contents
Search sections

Subscribe to our newsletter

Get weekly insights on data, automation, and AI.

© 2026 Datons. All rights reserved.