IngestDocument icon
MistralAI icon
KestraKVStore icon
ChatCompletion icon
TavilyWebSearch icon
Script icon
CreateSpreadsheet icon
Load icon
SlackIncomingWebhook icon

Conduct a GDPR Data Protection Impact Assessment (DPIA) with RAG on Official Legal Texts

Run a GDPR DPIA with Kestra AI and RAG on official regulation text. Generate structured impact assessments citing real GDPR articles and EDPB guidelines.

Categories
AI

Run a GDPR Data Protection Impact Assessment (DPIA) that is grounded in the actual law. This blueprint builds an AI DPIA assistant that uses Retrieval-Augmented Generation (RAG) over the official GDPR regulation text from EUR-Lex and EDPB fining guidelines, so the generated assessment cites real GDPR articles (Article 35, Article 36, Chapter V) instead of hallucinated legal references. It solves the core problem with generic LLM legal advice: outputs you cannot trust because they invent citations and miss the supervisory-authority obligations a Data Protection Officer is required to document.

How it works

  1. ingest_gdpr_text (io.kestra.plugin.ai.rag.IngestDocument) downloads the official GDPR text and the EDPB administrative-fines guidelines, splits them with a RECURSIVE document splitter (1000-char segments, 200-char overlap), embeds them with mistral-embed, and stores the vectors in a io.kestra.plugin.ai.embeddings.KestraKVStore.
  2. dpia_assessment (io.kestra.plugin.ai.rag.ChatCompletion) takes the processing_activity and data_categories inputs, retrieves the relevant articles from the vector store, augments them with live io.kestra.plugin.ai.retriever.TavilyWebSearch results for recent enforcement decisions, and generates a structured DPIA with mistral-large-2512 at temperature: 0.1.
  3. format_report (io.kestra.plugin.scripts.python.Script) parses the Markdown report into a sectioned dpia_report.csv.
  4. create_sheet and load_report (io.kestra.plugin.googleworkspace.sheets.CreateSpreadsheet and Load) create one Google Sheet per assessment and load the CSV for the legal register.
  5. notify_slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) posts a link to the finished report for the privacy-legal channel.

What you get

  • A DPIA covering every Article 35(7) requirement: necessity, proportionality, risk assessment, and technical plus organisational mitigation measures.
  • Citations to the real GDPR text and EDPB guidance, not invented references.
  • An explicit flag for when Article 36 prior consultation is required.
  • An archived Google Sheet per assessment plus a Slack notification with the link.

Who it's for

  • Data Protection Officers running mandatory DPIAs before launching a system.
  • Legal and compliance teams reviewing high-risk processing activities.
  • Privacy consultants auditing client data processing operations.

Why orchestrate this with Kestra

A standalone AI chat call cannot rebuild a vector store, chain a retrieval step into web search, export to a register, and notify a team on a schedule or on an event. Kestra wires these as declarative YAML tasks with retries on flaky API calls, full execution lineage over every prompt and document ingested, and event triggers (a new processing activity submitted, a webhook, a flow trigger) that an LLM provider's own runtime has no concept of. You also keep model choice in your hands: the flow uses EU-hosted Mistral Large for data sovereignty and documents an Ollama local-model swap for air-gapped runs.

Prerequisites

A running Kestra instance and the AI, Google Workspace, and Slack plugins.

Secrets

  • MISTRAL_API_KEY: Mistral AI key used for chat and embeddings.
  • TAVILY_API_KEY: Tavily key for the web-search content retriever.
  • GCP_SERVICE_ACCOUNT_JSON: Google Cloud service account JSON with Sheets API access.
  • SLACK_WEBHOOK: Slack incoming webhook URL for the privacy-legal channel.

Quick start

  1. Add the four secrets above to your Kestra instance.
  2. Import this blueprint into a namespace such as company.legal.
  3. Execute the flow, describing your processing_activity and selecting the data_categories.
  4. Open the generated Google Sheet from the Slack message and review the DPIA.

How to extend

  • Swap mistral-large-2512 for an Ollama local model to run fully air-gapped.
  • Add national DPA guidance or your internal policies to fromExternalURLs.
  • Replace the Slack step with an email or ticketing task to route reports.
  • Add a schedule or webhook trigger to run DPIAs as part of an intake process.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.