Background

What Would RAG Look Like If Miranda Priestly Were the User?

September 24, 2026 by Alex Leung

Share

Key takeaways

Multimodal retrieval starts with representing the information that users actually need, which may be visual rather than textual.

For some workloads, simple matrix operations can deliver fast retrieval without additional vector database infrastructure.

Large language models (LLMs) add the most value when they are assigned work that actually requires language reasoning.

Somewhere at the intersection of cloud computing, open source software, and fashion, there’s an Akamai T-shirt.

Akamai teamed up with UNIQLO for its PEACE FOR ALL charity T-shirt project, bringing the company’s digital roots into the physical world. The design features a heart on the front and real computer code on the back, a reference to Linux, and the open source foundations of the internet. 

Seeing computer code translated into a T-shirt made me wonder whether the process could work in reverse: If technology can become fashion, can fashion become something that AI can understand and search? More specifically, what kind of retrieval-augmented generation (RAG) system would an international team of fashion designers actually want?

Then, Miranda Priestly entered the architecture.

I was watching The Devil Wears Prada 2 during a long flight when the idea became more concrete. Somewhere between the fashion, the impossible deadlines, and Miranda Priestly’s famously exacting expectations (she is the formidable, cold, and razor-sharp Editor-in-Chief of Runway, a fictional high-fashion magazine in the film), I started thinking about what an enterprise AI assistant for a fashion organization would actually need to do.

Imagine a designer asking, “Show me previous women’s jackets with a silhouette like this, but with a shorter collar.” Or a Japanese designer searching for a warm winter coat in Japanese, followed by an Italian designer refining the same search in Italian.

A conventional text-based RAG system can search descriptions, documents, and metadata. But what the designer is looking for may not exist in the words at all. It may be in the pixels: the silhouette, pattern, color, cut, or visual relationship between one design and another.

That led to an engineering question: Could I build a RAG system that would let fashion teams search visual archives in the way designers actually think, in a way that might even earn a small nod of approval from Miranda Priestly?

I called it Miranda.

The problem with text-only RAG

Before building the visual system, I tried a deliberately ridiculous experiment with conventional text retrieval (Figure 1).

Before building the visual system, I tried a deliberately ridiculous experiment with conventional text retrieval (Figure 1).
Fig. 1: Conventional text RAG relying on metadata or OCR often misses core visual nuances — like silhouette, cut, and pattern — that fashion designers actually search for
Before building the visual system, I tried a deliberately ridiculous experiment with conventional text retrieval (Figure 1).

The result illustrates the problem nicely. Text retrieval can be excellent when the information that we need is represented in text, and optical character recognition (OCR) can help when words are embedded inside images or documents.

Neither, however, necessarily represents the design itself.

A fashion archive is fundamentally multimodal, so instead of asking an LLM to somehow infer the visual content of hundreds of thousands of images, I tried something simpler: I turned the images into vectors.

The architecture

The basic pipeline ended up being surprisingly simple (Figure 2).

Fashion archive
      │
      ▼
   OpenCLIP
      │
      ▼
Normalized image embeddings
      │
      ▼
PyTorch tensor
      │
      │
User query
Japanese / Italian / English
      │
      ▼
Language routing
      │
      ├── simple English fashion query ──────┐
      │                                      │
      └── multilingual / ambiguous ──► Local LLM
                                             │
                                             ▼
                                    English search intent
                                             │
                                             ▼
                                          CLIP
                                             │
                                             ▼
                                      Query vector
                                             │
                                             ▼
                                  PyTorch GEMM
                                             │
                                             ▼
                                     Top-K images
Fig. 2: System architecture for Miranda: Simple English queries bypass the local LLM entirely, routing directly to CLIP to minimize search latency

There’s no vector database in this experiment, and there isn't even Facebook AI Similarity Search (FAISS).

The retrieval operation is essentially:

Retrieval operation
Retrieval operation

In this operation, q is the normalized query embedding, E is the matrix containing the normalized image embeddings, and S is the score of similarity. Once those scores are calculated, the retrieval step selects the highest-scoring images (K).

In other words, one matrix multiplication compares the query against all the image vectors, and the highest scores become the results. The source code and reproducibility instructions for the Miranda experiment are available.

5 key lessons learned

Designing and scaling this system was an exercise in stripping away unnecessary complexity. Over the course of scaling this experiment from a few hundred images to nearly 300,000, the real-world behavior of the stack frequently challenged my initial assumptions. The following five lessons reflect the core engineering principles, architectural adjustments, and security trade-offs that emerged from testing the limits of local AI models. 

  1. Measure before adding infrastructure

  2. Don't ask an LLM to do work you already know how to do

  3. Intermediate representations are part of observability

  4. Security starts while the prototype is still fun

  5. Local AI can go surprisingly far

Lesson one: Measure before adding infrastructure

I started small, with 500 images. Then I moved to 5,000, 50,000, and then 200,000.

Eventually, the experiment reached 289,222 images, represented by 512-dimensional vectors, with a complete FP32 embedding matrix of roughly 565 MiB. On my Mac, using Apple's MPS back end, searching the entire matrix with PyTorch GEMM remained remarkably fast. In one run, generating the CLIP text embedding took 162.3 milliseconds, while comparing it against all 289,222 image vectors took just 10.8 milliseconds. 

The exact numbers vary from run to run, but the pattern was consistent enough to get my attention.

What this showed me was that retrieval itself wasn’t necessarily the expensive part. Often, more time was spent on everything surrounding it.

That leads to an engineering principle that I keep returning to: Measure the system that you actually have before adding infrastructure for the system you imagine you will eventually have.

A vector database may absolutely become the right architecture as the scale or requirements change, especially when you need distributed storage, filtering, frequent updates, billions of vectors, durability, multi-tenancy, or other capabilities. But I don't think “RAG” should automatically imply “vector database.”

Sometimes a matrix is enough.

Lesson two: Don't ask an LLM to do work you already know how to do

My first multilingual implementation sent essentially every query through a local LLM. It worked, but it also meant using the LLM for queries that didn’t really need it.

For example, if somebody types “black winter coat,” the intent is already clear.

Why spend seconds asking an LLM to transform a perfectly usable English fashion query into another English fashion query?

To that end, I added routing. Straightforward English fashion searches bypass the LLM and go directly to CLIP, while Japanese, Italian, and other multilingual requests can use the local LLM to normalize the user's intent into concise English before CLIP embedding.

That gives each component a clear job: The LLM interprets language, CLIP represents the search intent in the same embedding space as the images, and GEMM retrieves the nearest vectors.

That separation turned out to be one of the most important architectural lessons I learned from the experiment. An LLM makes sense where language reasoning adds value. Elsewhere, however, a simpler component may already do the job well.

Lesson three: Intermediate representations are part of observability

During development, Miranda occasionally misunderstood a follow-up request. Rather than hide everything behind a polished chatbot response, I exposed the intermediate representation so I could see what was happening between the user’s request and the search (Figure 3).

Original query:
Mostrami un cappotto nero per l'inverno.

CLIP query:
black winter coat
Fig. 3: Exposing intermediate intent representations makes debugging easier by isolating whether search failures stem from language translation or vector retrieval

That visibility proved enormously useful. When the retrieval result looked wrong, I could immediately see whether CLIP struggled with the search or whether the language layer had handed it the wrong query in the first place.

For AI systems, observability shouldn't stop at CPU, memory, and HTTP latency. It can also include exposing, or at least logging, the transformations that happen as information moves among models, because those intermediate representations are often where the bug actually lives.

Lesson four: Security starts while the prototype is still fun

Because my professional background is in security, I couldn't resist attacking my own fashion chatbot.

I asked Miranda to write a C++ Hello World program.

Clearly, that isn’t what a fashion search assistant is supposed to do, even if an LLM sits behind the interface. That exposed the need for a domain gate: a control that would keep Miranda focused on fashion-related requests and reject prompts outside that intended use.

But once I added that boundary, I discovered the opposite problem. Consider these two prompts:

Write shell code.
Find me a T-shirt with shell code.

The word code appears in both, but their intent is completely different. The first should be rejected, but the second is a completely legitimate fashion request.

A simple blocklist of suspicious words wasn’t going to work. The system had to understand context, which points to a broader security principle: Security controls need to understand the system’s intended capability rather than reacting only to individual tokens appearing in a prompt.

Thinking through those boundaries while Miranda was still a prototype was much easier than trying to bolt them on later.

Lesson five: Local AI can go surprisingly far

The entire experiment began on an Apple Silicon Mac, with OpenCLIP and PyTorch retrieval running through MPS while the language model and fashion archive remained local. That wasn't just convenient.

For enterprise design archives, the images themselves may represent valuable intellectual property, and a design team may reasonably prefer an architecture in which proprietary designs don't have to leave an environment under its control simply to make them searchable.

And, because the PyTorch code already selects between MPS and CUDA, the same basic architecture can move from a Mac prototype to an NVIDIA GPU without redesigning the application.

Doing so creates a practical path from prototype to production: Start locally, measure what’s actually happening, and then scale the component that needs it.

That same approach can extend to where those workloads run. As a visual search application moves into production and needs to support more users, larger archives, or globally distributed teams, the CUDA-based components can move to distributed GPU infrastructure without changing the basic retrieval design.

Moving from local prototype to planetary scale

Akamai Inference Cloud is built for that kind of real-time, distributed inference, bringing GPU compute closer to users and data while allowing teams to scale the parts of the system that actually need it.

While testing locally on Apple Silicon proves the mathematical efficiency of GEMM retrieval, enterprise visual search across millions of global assets requires distributed infrastructure. Deploying these OpenCLIP and PyTorch workloads to Akamai Inference Cloud places GPU-accelerated decision-making closer to global design teams — helping to ensure ultra-low latency, protect proprietary IP, and deliver predictable cost efficiency.

And then the T-shirt came back

To close the loop, I tried one final experiment.

I added three images of an Akamai × UNIQLO PEACE FOR ALL T-shirt to the fashion corpus and rebuilt the index, bringing it to 289,222 images.

I deliberately did not ask Miranda for an “Akamai T-shirt.” Instead, I searched for “T-shirt with nerdy computer code.” Miranda then searched all 289,222 vectors.

The Akamai × UNIQLO shirt appeared as the third result with a similarity score of 0.307 (Figure 4).

The Akamai × UNIQLO shirt appeared as the third result with a similarity score of 0.307 (Figure 4).
Fig. 4: Miranda served the Akamai × UNIQLO T-shirt as the third result after searching all 289,222 vectors
The Akamai × UNIQLO shirt appeared as the third result with a similarity score of 0.307 (Figure 4).

The surrounding results were in exactly the semantic neighborhood I hoped to see: T-shirts containing binary digits, technical-looking text, and other computer-related graphics.

In that run, the GEMM retrieval took about 10.8 milliseconds. 

The result closed the loop in a way that I hadn’t planned. Akamai and UNIQLO put code onto a T-shirt, which helped me think about what AI-native search might mean for fashion. I turned that fashion into vectors, searched those vectors for a nerdy T-shirt with computer code, and the system found the Akamai shirt again without being told to look for Akamai.

How wonderfully circular.

Maybe RAG is bigger than documents

RAG is often explained as a way of giving an LLM access to documents that it didn't see during training.

That's useful, but this experiment reinforced something more fundamental: The architecture has to follow the information that users are trying to retrieve.

For legal research, those representations may mostly be words. For operations, they may be logs and metrics. For fashion designers, architects, industrial designers, or creative teams, they may increasingly be visual.

For Miranda, that meant starting with the visual archive itself, representing it in a form the system could search, and then adding language reasoning only where it was useful. The vector database, model, or infrastructure comes after that.

Miranda started as something that I thought about while watching a movie on a long flight. Along the way, it ended up teaching me more about routing, multimodal retrieval, latency, security boundaries, local inference, and the value of measuring before architecting.

And somewhere inside a matrix of 289,222 × 512 floating-point numbers, there’s now a rather nerdy Akamai T-shirt. My Miranda found it, and I think Miranda Priestly might even approve.

About the Author(s)

Alex Leung

Alex Leung

Alex Leung is a Senior Enterprise Architect at Akamai. He advises leading enterprises across media, commerce, and digital platforms on building scalable, secure, and high-performance internet architectures.

With more than 20 years of experience, Alex has led a wide range of initiatives spanning over-the-top (OTT) streaming, edge computing, and large-scale distributed systems. In addition to helping broadcasters evolve their services for OTT delivery, he has conducted security assessments for numerous organizations, strengthening the resilience of their web and mobile applications against modern threats.

Prior to joining Akamai, Alex delivered complex projects including a video-on-demand e-learning platform for government agencies in the Hong Kong SAR  and an image search engine built on Apache SOLR.

He holds a Master’s degree in Applied Physics from Stanford University and a Bachelor’s degree in Engineering Physics from Cornell University.