What I Learned Putting AI Agents in Production
Lessons from building an AI-powered product — function calling, prompt management, and the gap between demos and production systems.
Working inside a real microfrontend architecture — what it's actually like when Next.js, Angular, and React microfrontends coexist in production.
Written By Alinus Dumitrana
Mar 01, 2026 • 3 min read
I recently spent several months working on a large fintech platform that uses a microfrontend architecture. Not a greenfield "let's try microfrontends" project — a real production system that evolved into this shape over years. Here's what it actually looks like from the inside.
The setup, simplified:
The flow for any given URL: Next.js checks if it has a page for that route. If not, it loads the Angular app as a fallback. The Angular app might then load a React microfrontend for certain sections.
Next.js (shell) → Angular (fallback) → React microfrontend (optional)
Yes, three frameworks in one user session. Yes, it works. No, it's not elegant.
Nobody sits down and designs this. It happens incrementally:
Each decision made sense at the time. The result is complex, but the alternative — a full rewrite — is almost always worse. You'd spend months rewriting while the product team waits, and you'd introduce new bugs in already-stable code.
Shared design system. All three frameworks render components from the same design system. This is what makes the transitions invisible to users — they don't know (or care) that the page they just navigated to is running a different framework.
Independent deployments. Each microfrontend deploys independently. A bug in the React checkout flow doesn't block a fix in the Angular account settings.
Feature flags for migration. When we migrated a page from Angular to Next.js, we'd put it behind a feature flag. Roll it out to 5% of users, verify nothing breaks, then gradually increase. Rolling back is just toggling the flag.
Shared state is painful. Authentication tokens, user preferences, cart data — anything that needs to be consistent across frameworks requires careful coordination. We used a combination of cookies, URL parameters, and a thin shared JavaScript layer.
Testing is complicated. Unit tests work fine within each framework. Integration tests that cross framework boundaries are harder. E2E tests are essential — they're the only thing that verifies the full user flow works across all three layers.
Bundle size. Yes, the user downloads Angular, React, and Next.js. We mitigated this with aggressive code splitting and lazy loading, but it's a real cost. The first load is heavier than a single-framework app.
Developer onboarding. New team members need to understand all three frameworks and how they interact. The mental overhead is significant.
The long-term goal is consolidation into Next.js. The approach:
I spent some time during an innovation day prototyping an AI agent that could assist with these migrations — analyzing Angular components and suggesting Next.js equivalents. It's an interesting idea for reducing the manual effort, though it needs more work before it's practical.
For most teams, no. The overhead is significant, and you need a certain scale before the benefits (independent deployments, team autonomy) outweigh the costs (shared state complexity, testing difficulty, bundle size).
But if you're already in a microfrontend architecture — because the codebase evolved that way — the answer isn't to panic and rewrite. It's to migrate incrementally, maintain a shared design system, and invest in E2E testing. The architecture works. It's just not simple.
Lessons from building an AI-powered product — function calling, prompt management, and the gap between demos and production systems.
The case for compiling your web app — HTML, CSS, API, and all — into a single executable with zero runtime dependencies.