Kaizen Teams

Dropdown

Table of Contents

Time to read

·

12

Published on

·

September 3, 2025

Last updated on

·

May 26, 2026

Vera Gonzalez, AI Engineer at Kaizen Softworks

Vera Gonzalez

Too young to quit

Frontend Developer

How to Apply RAG Techniques to Boost Your AI Applications

Published on

·

May 27, 2026

Last updated on

·

May 26, 2026

Time to read

·

12

Vera Gonzalez, AI Engineer at Kaizen Softworks

Vera Gonzalez

Frontend Developer

Large Language Models (LLMs) are powerful, but they come with two big limitations:

  • They don’t always have the most up-to-date knowledge.
  • They can only remember what fits in their context window.

Retrieval-Augmented Generation (RAG) solves this by connecting your LLM to an external knowledge base and retrieving relevant context before generating a response. (And yes… RAG also means “rag”, but here it’s definitely more high-tech than something you use to clean the kitchen 🧽).

1. What is RAG and how does it work?

Think of RAG as an assistant that searches first, then answers.

  1. The user sends a prompt.
  2. The system retrieves relevant information from a database.
  3. That information is added to the original prompt.
  4. The LLM generates the final answer.

Example: An HR chatbot could first retrieve the latest company policy document before answering questions about vacation days.

2. Retrieval techniques you can try

When it comes to finding the right information for your LLM, there are several approaches, each with its own strengths.

The most straightforward one is Keyword Search, where the system looks for exact or partial word matches in the text. This is simple, fast, and effective when you know the exact terminology to look for. For example, using BM25, you could pinpoint the exact paragraph in a technical manual that matches a user’s query.

Then there’s Semantic Search with Embeddings, which goes beyond exact matches to find text with the same meaning, even when the wording is different. This is particularly useful for cases like retrieving answers about “sick leave” even if the document calls it “medical absence.” By understanding synonyms and related concepts, semantic search adds a powerful layer of flexibility.

Finally, you can combine the best of both worlds with Hybrid Search. In this approach, the system runs both a keyword-based search (like BM25) and a semantic search (using embeddings) in parallel.

The results from each are then merged and re-ranked, often using techniques like Reciprocal Rank Fusion, so that documents highly ranked by either method can appear at the top.

This way, you capture exact matches for critical terms while also retrieving contextually relevant content that may be worded differently, making it especially powerful for cases like technical FAQs where precision and broader understanding both matter.

3. Improving your results

Even with a good retrieval strategy, not all results are equally useful. That’s where optimization techniques come in.

One of them is re-ranking with specialized models, such as cross-encoders. Instead of scoring the query and each document separately, cross-encoders process them together, allowing the model to understand fine-grained context and relationships between words. This produces more accurate relevance scores, ensuring the most useful documents appear first, even if they don’t share many exact keywords with the query.

Another useful approach is Metadata Filtering. By filtering results according to attributes like date, category, or document type, you can eliminate outdated or irrelevant information. Imagine narrowing your search to documents updated in the last six months – it’s a simple step that can drastically improve the quality of the information your system uses.

4. Preparing your data: the art of chunking

LLMs can’t process huge documents all at once. Chunking means splitting them into smaller pieces.

For example: Split a 100-page manual into 500-word sections with 10% overlap to ensure no important context gets lost.

Benefit: Improves retrieval relevance and accuracy.

5. Measure your performance

You can’t improve what you don’t measure.

Here’s two key metrics for RAG:

  • MAP (Mean Average Precision): How well relevant documents are ranked.
  • MRR (Mean Reciprocal Rank): How high the first relevant document appears.

Impact example: After optimizing, relevant documents moved from position #5 to #2, reducing search time for users.

6. What’s next for us at Kaizen?

The most exciting part is putting this knowledge into action.  

We see immediate opportunities to:

  • Boost the performance of chatbots for clients and internal tools.  
  • Experiment with hybrid retrieval to improve accuracy.  
  • Apply chunking strategies to make better use of large document sets.

Because in the end, whether it’s a rag for cleaning or RAG for AI, it’s all about wiping away the mess and delivering sharper results. 😉

Large Language Models (LLMs) are powerful, but they come with two big limitations:

  • They don’t always have the most up-to-date knowledge.
  • They can only remember what fits in their context window.

Retrieval-Augmented Generation (RAG) solves this by connecting your LLM to an external knowledge base and retrieving relevant context before generating a response. (And yes… RAG also means “rag”, but here it’s definitely more high-tech than something you use to clean the kitchen 🧽).

1. What is RAG and how does it work?

Think of RAG as an assistant that searches first, then answers.

  1. The user sends a prompt.
  2. The system retrieves relevant information from a database.
  3. That information is added to the original prompt.
  4. The LLM generates the final answer.

Example: An HR chatbot could first retrieve the latest company policy document before answering questions about vacation days.

2. Retrieval techniques you can try

When it comes to finding the right information for your LLM, there are several approaches, each with its own strengths.

The most straightforward one is Keyword Search, where the system looks for exact or partial word matches in the text. This is simple, fast, and effective when you know the exact terminology to look for. For example, using BM25, you could pinpoint the exact paragraph in a technical manual that matches a user’s query.

Then there’s Semantic Search with Embeddings, which goes beyond exact matches to find text with the same meaning, even when the wording is different. This is particularly useful for cases like retrieving answers about “sick leave” even if the document calls it “medical absence.” By understanding synonyms and related concepts, semantic search adds a powerful layer of flexibility.

Finally, you can combine the best of both worlds with Hybrid Search. In this approach, the system runs both a keyword-based search (like BM25) and a semantic search (using embeddings) in parallel.

The results from each are then merged and re-ranked, often using techniques like Reciprocal Rank Fusion, so that documents highly ranked by either method can appear at the top.

This way, you capture exact matches for critical terms while also retrieving contextually relevant content that may be worded differently, making it especially powerful for cases like technical FAQs where precision and broader understanding both matter.

3. Improving your results

Even with a good retrieval strategy, not all results are equally useful. That’s where optimization techniques come in.

One of them is re-ranking with specialized models, such as cross-encoders. Instead of scoring the query and each document separately, cross-encoders process them together, allowing the model to understand fine-grained context and relationships between words. This produces more accurate relevance scores, ensuring the most useful documents appear first, even if they don’t share many exact keywords with the query.

Another useful approach is Metadata Filtering. By filtering results according to attributes like date, category, or document type, you can eliminate outdated or irrelevant information. Imagine narrowing your search to documents updated in the last six months – it’s a simple step that can drastically improve the quality of the information your system uses.

4. Preparing your data: the art of chunking

LLMs can’t process huge documents all at once. Chunking means splitting them into smaller pieces.

For example: Split a 100-page manual into 500-word sections with 10% overlap to ensure no important context gets lost.

Benefit: Improves retrieval relevance and accuracy.

5. Measure your performance

You can’t improve what you don’t measure.

Here’s two key metrics for RAG:

  • MAP (Mean Average Precision): How well relevant documents are ranked.
  • MRR (Mean Reciprocal Rank): How high the first relevant document appears.

Impact example: After optimizing, relevant documents moved from position #5 to #2, reducing search time for users.

6. What’s next for us at Kaizen?

The most exciting part is putting this knowledge into action.  

We see immediate opportunities to:

  • Boost the performance of chatbots for clients and internal tools.  
  • Experiment with hybrid retrieval to improve accuracy.  
  • Apply chunking strategies to make better use of large document sets.

Because in the end, whether it’s a rag for cleaning or RAG for AI, it’s all about wiping away the mess and delivering sharper results. 😉

Related Articles

·

May 27, 2026

What AI Can and Can’t Replace in Design Systems

What happens when you build a design system from v0, Figma, and Windsurf, and let AI handle the speed while you keep the judgment.

12 read time

Read more

Just this month, I built a full design system in about 20 hours.

What used to take weeks, sometimes months, is now dramatically faster. So… what actually changed? And more importantly: what didn’t?

Design systems take time. On complex platforms, they can take hundreds of hours.

We were working with a large and complex product where inconsistencies had started to pile up. Different modules had evolved in isolation, teams were making independent decisions, and there were no shared guidelines. The answer was clear: we needed a design system.

AI tools were just starting to emerge back then. They were mostly useful for simple tasks as they tended to hallucinate when things got complex. Developers had started using them earlier than designers, MCP didn't exist yet, and Figma plugins were the best automation we had.

But the context has changed. Fast.

The Manual Era

We did what most teams did. We stopped, and we built it. Manually.

Picture two designers, a mountain of inconsistencies, and no map. We had to cross-reference information manually, digging through the code, detecting what could be merged, agreeing on naming conventions, deciding how to name components. Hours and hours of discussion until we finally landed on a solution.

In the end, we got there. A cleaner system, faster workflows, and for the first time, both teams speaking the same visual language. Hard-won, but it worked.

But now every month a new AI model seems to be released. Design is finally catching up with what developers faced about two years ago. New tools arose, and with that, the scope of our work as designers completely changed.

The Human Factor

For an internal project, I used our Kaizen site as a reference, combined with documentation from industry leaders as a guideline.

I started in v0, which is essentially a chat interface where you can generate UI components through prompts. I fed it the colors, typographies, and a reference image, and from there it was a back-and-forth: the AI generated, I reacted, adjusted, and pushed until the output matched what I had in my head. And just like that, I started prompting my way through a Design System.

Once a component was ready, I used the html.to.design plugin to bring it into Figma (yes, plugins are still alive!). Think of it as a bridge: the plugin exports designs directly from the browser into a Figma file.

Inside Figma, the intervention was more hands-on. First, I checked that everything was visually consistent with what was defined in v0: colors, typography, styles. Then I used Figma's built-in AI to rename all the component layers using BEM convention (something that would have taken a significant amount of time to do so manually).

BEM, which stands for Block Element Modifier, is a widely adopted naming convention in CSS. It structures layer names hierarchically and predictably, for example: button__label--disabled.

Using it keeps the code clean, readable, and consistent, especially when you're working alongside a developer who needs to understand what came out the other side.

Beyond naming, I also made sure the layer structure would generate the right properties when building component sets in Figma, so that all the variants would be correctly exposed and usable. My team also pointed out that adding descriptions to components and variants was key as context for any agent using them through an MCP.

The last step was connecting everything to Windsurf via MCP. With a frame selected in Dev Mode, Windsurf could read the Figma file and use the components to build more complex screens.

We worked closely with a developer throughout this phase. Not just for the technical knowledge, but because having someone who reads code fluently meant catching things we wouldn't have spotted otherwise. The design role here was direction and supervision: making sure the AI used the components correctly and didn't invent solutions where context was missing.

Every step of the process had a human decision behind it.

AI-assisted UI design workflow showing v0 component generation, html.to.design export to Figma, BEM layer organization, and Windsurf MCP development handoff.

An Unexpected Discovery

At one point, before we had any of the naming conventions figured out, I selected a frame and asked Windsurf to build a form using the components inside it, styled to match a specific card. The developer next to me was skeptical until he saw the result, and then he was just as surprised as I was.

What we realized is that the MCP wasn't reading layer names to understand context. It was reading everything inside the frame, even the loose text sitting alongside the components. Good naming is still worth doing. But the MCP doesn't need it to understand what it's looking at.

UI component library preview with cards, testimonials, service blocks, statistics, and a contact form for a modern software development website.

Learning to Talk to an AI

The more specific and contained your prompt, the better the outcome. We started with the most atomic component: the button, and worked outward from there. Each approved component became context for the next one, so the system gradually picked up the visual language we were building.

At some point I got ambitious and asked for five cards in a single prompt: blog card, service card, testimonial card, stats card, feature card… structures, states and all. The AI delivered.

Visually, everything looked fine. Then the developer looked at the code and pointed out that all five cards were independent components instead of variants of one. For a design system, that breaks everything.

One correction prompt fixed it. But it was a good reminder: the AI does exactly what you ask, not what you mean. And fixing it after the fact can cost more than getting it right from the start.

Some Things Learned Along the Way

  • Precision is key. Natural language is fine when you're asking for a cooking recipe, but when referring to a component, if you say things like "create" instead of "add", you'll probably end up with a whole new set of components instead of additional variants of an existing one.
  • The "Frame" is the context: MCPs can read everything inside the frame you select. This is a game-changer. It means the "naming conventions" debate might be shifting. If the AI understands the context visually and structurally, will we still spend hours discussing nomenclature in 2027?
  • No matter what happens, you can always roll back in less than 5 minutes and start over.
  • Work closely with a developer: they can help you understand MCPs and clear up any code-related doubts. Once you start to grasp their logic, you'll learn very quickly how to prompt in ways that AI actually understands.
  • There's nothing to lose by asking the AI to follow a specific naming convention for the code. It keeps everything clean and readable, and it takes no extra effort.
  • The AI covers roughly 80% of the work (generation, variations, exploration...), but the remaining 20% is where quality lives, and that part is not delegable. The AI executes. The judgment is still yours. And if you skip the review, you're not saving time: you'll spend it later.
  • Context matters more than tooling. What you don't define, the AI will invent. Small components may be resolved well, but large interfaces require more definition from the start. A well-defined system scales. An undefined one generates inconsistencies faster than you can fix them.
  • Figma is no longer the mandatory starting point. It's useful as a visual reference, a QA space, or a consolidation layer. But the AI doesn't need it. We still do.
  • There's no single right workflow yet. What you do depends on the project. We're in a transition moment where the tools change faster than the standards. The best thing you can do right now is experiment.

What AI Still Can’t Replace

Through all of this, a few things became very clear. These are the parts that didn’t change:

  • Knowing when something looks off. The AI generates, but it doesn't notice when the result doesn't feel right. That eye is yours.
  • Direction and supervision. The AI used the components we gave it, but without someone supervising it, it invents solutions where there is no context to work from.
  • The definition of done is still a human call, whether it's a conversation with a PO, a stakeholder, or just the designer's criteria. There's no prompt for that.
  • The context: knowing why certain decisions matter, what a component should communicate, what the user will actually feel. Business knowledge, stakeholder dynamics, unwritten rules, empathy for the end user. These take years to build and live in the people doing the work, not in the tools they use.

My Two Cents

The tools changed, and that gave me the chills, but throughout this experience I found that the designer's role is more alive than ever.

What once took a team weeks can now be prototyped in hours. That’s not a threat; it’s an invitation to get curious.

I'm still figuring a lot of this out, and I suspect most of us are. There's no right workflow yet, and honestly, that's fine. We are in a transition where tools change faster than standards. The best thing you can do is experiment. Don't wait for a "definitive" workflow, it might be obsolete by next month.

Go ahead, try prompting your way through a component. You might be surprised how fast the system starts to take shape.

·

May 15, 2026

Can AI Safely Apply Changes Across Microservices?

AI can update microservices safely, but only when it understands the system’s architecture, ownership, and service relationships.

12 read time

Read more

Applying changes across microservices is difficult because business logic is distributed across multiple services, each with its own data, contracts, and responsibilities.

In our experiment at Kaizen Softworks, we tested whether an AI system could safely apply coordinated changes across a microservices architecture using only minimal input.

Short answer: Yes, but only when the AI has enough architectural context.

Why are coordinated changes in microservices so hard?

In distributed systems, a single business change rarely affects just one service.

It often requires:

  • Updating multiple microservices
  • Modifying message contracts
  • Keeping DTOs (Data Transfer Objects) consistent
  • Respecting domain boundaries defined by Domain-Driven Design (DDD)

Key entities in this system:

  • Microservice: An independently deployable service responsible for a specific domain
  • Aggregate (DDD): A cluster of domain objects treated as a single unit
  • DTO (Data Transfer Object): A structured format used to transfer data between services
  • Message/Event: A communication mechanism between services

The complexity is not in the code, it’s in the relationships between components.

The experiment: Can AI reason across services with minimal input?

We designed a controlled experiment to test whether an AI model could apply system-wide changes with limited information.

Input given to the AI:

  • Message definitions (events between services)
  • DTOs (data contracts)

Tasks the AI had to perform:

  1. Identify affected aggregates
  2. Determine service ownership
  3. Apply coordinated changes across services
  4. Maintain consistency in messages and DTOs

In other words, the AI had to behave like a software architect, not just a code generator.

What was the biggest obstacle?

The biggest challenge was not technical, it was contextual.

Before and after diagram showing how ambiguous microservice names prevent AI from understanding service ownership, while aggregate-to-service mapping helps AI apply safe coordinated changes.

Problem: unclear service naming

Instead of descriptive names like:

  • order-service
  • billing-service

Our services were named:

  • john
  • sally
  • roger

This removed any semantic clues about responsibility.

Result: The AI could not infer which service owned which domain logic.

The missing piece: aggregate ownership mapping

To solve this, we introduced a simple but powerful structure:

Aggregate → Service mapping

  • Order → john
  • Shipment → sally
  • Invoice → roger

This created a clear relationship between domain concepts and system components.

Once ownership was explicit, the architecture became understandable.

How we used AI to generate architectural context

Instead of building this mapping manually, we used AI to analyze the codebase and extract:

  • Where each aggregate was defined
  • Which microservice implemented it
  • The relationship between domain and infrastructure

The result was a machine-readable architecture map.

In practice, we used AI to generate the context that AI itself needed.

Results: Can AI safely apply distributed changes?

With the architecture map in place, the AI was able to:

  • Trace message flows across services
  • Identify affected aggregates
  • Locate the correct microservices
  • Apply coordinated updates
  • Maintain consistency between DTOs and messages

While not perfect, the system worked reliably as a proof of concept.

What is the real limitation of AI in microservices?

The main limitation of AI is not code generation, it’s architectural understanding.

Without knowing:

  • Which components exist
  • How they relate
  • Who owns what

AI cannot safely modify a distributed system.

AI performance depends more on context quality than model capability.

When can AI safely modify microservices?

AI works well when:

  • Aggregate ownership is clearly defined
  • Message contracts are explicit
  • Architecture is structured and consistent

AI struggles when:

  • Naming is ambiguous
  • Relationships are implicit
  • Context is incomplete

Simple rule: If the architecture is clear, AI can reason. If not, it guesses.

Final thoughts

This experiment revealed something important:

AI doesn’t fail because it can’t write code.
It fails because it can’t see the system.

As teams move toward AI-assisted development, the focus will likely shift from:

Writing better code to Designing better systems for machines to understand

At Kaizen Softworks, we see this as a foundational shift.

Because when AI can understand architecture, it doesn’t just generate code, it helps evolve systems.