1. Home
  2. Insights

RAG with EU data residency: an architecture that keeps personal data in the EU

Where personal data ends up in a RAG system, and a reference design that keeps documents, embeddings, prompts and logs in EU regions under the GDPR.

GDPR, RAG, Data residency, International transfers, Architecture

To keep a retrieval-augmented generation (RAG) system inside the EU, you have to pin every copy of the data to EU regions, not only the source documents: the chunk store, the embeddings, the prompts sent to the model, the model’s answers, the logs and the people who can reach them. Under the GDPR, a single component processed or accessed from outside the EEA is a transfer that needs a Chapter V basis, so the design work is mostly about finding those components before they find you.

Why RAG multiplies the places your data lives

A plain database holds personal data in one place. A RAG pipeline copies it, piece by piece, into several:

  • Source systems: the CRM, claims platform, ticketing tool or document store you index.
  • The chunk store: the text, split into passages, usually kept next to each vector so it can be returned to the model.
  • The vector index: the embeddings themselves, plus metadata such as customer IDs or document titles.
  • The prompt: retrieved passages are pasted into the request sent to the model, in clear text.
  • The answer: the model’s output often repeats names, policy numbers or claim details.
  • Logs, traces and evaluation sets: observability tools frequently store full prompts and responses.
  • Caches: semantic caches and prompt caches hold copies of recent requests.

Article 44 of the GDPR says personal data may be transferred to a third country only if the conditions of Chapter V are met. The EDPB adds an important point in its Recommendations 01/2020 on supplementary measures: remote access from a third country, for example in support situations, and storage in a cloud outside the EEA are also transfers. It also says that if you use an international cloud infrastructure, you must assess whether and where data goes to third countries, unless the provider is established in the EEA and its contract states that the data will not be processed in third countries at all.

So “we picked an EU region” is a start, not an answer. Every item in the list above needs its own location check.

Treat embeddings as personal data

A common shortcut is to argue that vectors are just numbers, so they fall outside the GDPR. That argument is weak.

Article 4(1) of the GDPR defines personal data as information relating to an identified or identifiable person, and Recital 26 says identifiability depends on all the means reasonably likely to be used. In most RAG systems the vector sits next to the original chunk text and a document ID, which settles the question on its own. Even without the text, an embedding is built to preserve the meaning of the passage it came from, so you would struggle to show the vectors are anonymous.

The EDPB took a similar line for AI models in Opinion 28/2024: it found that AI models trained with personal data cannot, in all cases, be considered anonymous, and that anonymity has to be shown case by case. We apply the same caution to embeddings: design as if the vector index holds personal data, because it almost certainly does.

A reference architecture (Illustrative)

Illustrative: a mid-sized insurer wants an assistant that answers claims handlers’ questions from policy documents, claim notes and correspondence. Here is a shape that keeps personal data in the EU.

1. Ingestion and minimisation in one EU region

Run ingestion, chunking and embedding jobs in a single EU region, in the same account or project as the source data. Before indexing, decide which fields the assistant actually needs. Article 5(1)(c) requires data minimisation, and Article 25 requires data protection by design, so leave out bank details, health data or identity numbers unless a question genuinely needs them. Redact or tokenise what you can at this stage, because everything downstream inherits it.

2. A vector store in the same region, linked back to the source

Host the vector database in the same EU region, whether it is a managed service or self-hosted. Store a stable source record ID with every chunk. That link is what makes Article 15 access requests and Article 17 erasure possible later: without it, you cannot find every chunk derived from one person’s data.

3. Access control at retrieval time

Retrieval must respect the same permissions as the source systems. Filter by user, team or case before passages reach the model, not after. Article 32 requires security appropriate to the risk, and a RAG assistant that lets any handler retrieve any claim note breaks that quickly.

4. Inference pinned to the EEA

This is where most designs leak. The prompt carries retrieved personal data in clear text, so the model endpoint is a processor that sees the data unencrypted.

The EDPB’s Recommendations 01/2020 cover this case directly as Use Case 6: a processor in a third country that needs the data in the clear. Where the third country’s law gives public authorities access beyond what is necessary and proportionate, the EDPB says it cannot envisage an effective technical measure to prevent that access. It adds that transport encryption and encryption at rest, even together, are not enough if the importer holds the keys.

In practice, that leaves three clean options:

  • run inference on a managed model endpoint deployed in an EU region, with any cross-region or global routing switched off and confirmed in the provider’s documentation and contract;
  • self-host an open-weight model in an EU region;
  • use a provider in a country covered by an adequacy decision under Article 45, such as a US organisation certified under the EU-US Data Privacy Framework, and still check where its sub-processors run.

Also check what the model provider stores. Abuse monitoring, debugging and prompt caching can keep copies of requests, sometimes in a different region from the inference itself.

5. Logs, traces and evaluations in the same region

Send traces to an observability tool hosted in the EU, or self-host it. Set retention periods: Article 5(1)(e) limits storage to what the purpose needs. Mask personal data in logs where you can, and keep evaluation datasets under the same controls as production data.

6. Support and admin access from inside the EEA

Remote access from a third country is a transfer, so restrict admin and support roles for the vector store, model endpoints and logs to staff in the EEA, or put a transfer tool and assessment in place for anyone outside it. The EDPB recommendations also suggest restricted rather than full access for support cases.

Erasure and updates

When a person asks for erasure under Article 17, or a source record changes, you need to:

  1. find every chunk and vector derived from the record, using the stored source ID;
  2. delete or re-embed them;
  3. clear any semantic or prompt cache that may hold the old text;
  4. remove the data from logs and evaluation sets, or rely on short retention.

Test this path before launch. It is far easier to design a reindex job than to explain to a regulator why deleted claim notes still appear in answers.

The contract side

Technical controls need contract backing. Article 28(3)(a) requires a processor to act only on documented instructions, including on transfers to third countries, so put region commitments in the data processing agreement. Article 28(2) requires your prior written authorisation before a processor engages another processor, so ask each vendor (cloud, vector database, model provider, observability tool) for its sub-processor list with locations. If your engineering partner works from outside the EU, the same transfer rules apply to their access (how to check an offshore AI engineering partner).

What this means for you

  1. Draw the data flow. List every store, service and log in your RAG pipeline, and write the region next to each. Include caches and observability tools.
  2. Pin regions in configuration and contracts. Turn off cross-region or global inference routing, and get the vendor to state in writing that data is not processed outside the EEA, or name the transfer tool used.
  3. Minimise before you embed. Remove fields the assistant does not need, and record why in your data protection impact assessment if one is required under Article 35.
  4. Keep source IDs on every chunk. Then build and test the erasure and reindex job.
  5. Enforce permissions at retrieval. Use the source system’s access rules as filters, before passages reach the model.
  6. Restrict admin access to the EEA. Or document the transfer basis for anyone outside it.
  7. Update your records. Add the pipeline to your Article 30 records of processing, with the sub-processors and their locations.

If you want this designed into the system from the start rather than retrofitted, see our compliance engineering work.

Sources

This article is general information, not legal advice.

Want this built for your team?

One workflow is enough to start. We reply within 24 hours on working days.

Email
hello@hasorix.com
Phone
+91 84840 96479
Try your own voice agent