跪拜 Guibai
← All articles
AI Agent · Java · Backend Development · Spring AI · LangChain4j · Large Model Implementation · Programmer Transition To AI · Agent Engineering

AI Writes the Demo, You Write the Production System: A Java Engineer's Guide to the Last 10%

By 王中阳AI编程 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

AI-generated code is flooding teams with demos that look finished but lack the safety and observability required for production. Java engineers who can systematically harden these outputs — rather than rewrite them — turn a liability into a defensible skill set.

Summary

A boss generates 90% of an AI agent with Cursor in three days and hands it off for a next-day launch. The code calls public GPT-4 directly, logs customer phone numbers, and buries tool chains inside prompts with no error callbacks. That 90% is demo-grade; the missing 10% is the production soul — private model gateways, data masking, audit trails, and rollback strategies. Java teams can close this gap by bridging Python demos into Spring AI or LangChain4j, swapping cloud APIs for local Ollama or vLLM instances, and instrumenting the Advisor chain for deterministic, auditable tool calls. A six-point checklist covers language bridging, model gateways, auditing, exception fallback, data governance, and release process. The core argument is that AI accelerates the easy part, but the hard part — edge cases, compliance, observability — remains backend engineering's home turf.

Takeaways
AI tools excel at the 90% that runs in a demo but fail at the 10% that makes software production-ready: edge cases, data security, observability, auditability, and rollback capability.
Spring AI and LangChain4j let Java teams wrap existing services as AI-callable tools without switching to Python.
Replacing public cloud model APIs with private Ollama or vLLM instances keeps data in-domain and enables rate limiting and circuit breaking.
Spring AI 2.0's Advisor chain provides a natural injection point for audit logging that captures every tool call's parameters, output, and latency.
A six-point production checklist covers language bridging, model gateway, audit trail, exception fallback, data governance, and release process.
AI won't replace backend engineers who can harden a demo; it will replace those who can only write demos.
Conclusions

The 90/10 framing is a useful heuristic, but it understates the risk: a demo that leaks customer data or fails silently in production can do more damage than starting from scratch.

The advice to keep the existing Java stack and treat AI as just another tool consumer is a pragmatic counter to the 'rewrite everything in Python' pressure many teams feel.

The checklist is sensible but assumes organizational willingness to delay a launch for security reviews and rollback drills — the real bottleneck is often political, not technical.

Concepts & terms
Spring AI
A Spring ecosystem framework that provides abstractions for building AI-powered applications, including ChatClient, Advisors, and tool annotations that let existing Java services be called by language models.
LangChain4j
A Java port of the LangChain framework that enables building AI agent pipelines with a lightweight, annotation-driven approach, independent of the Spring framework.
Advisor Chain
In Spring AI 2.0, a chain of interceptors that wrap each AI call, allowing cross-cutting concerns like auditing, rate limiting, and logging to be injected without modifying business logic.
Ollama / vLLM
Tools for running large language models locally or on private infrastructure. Ollama simplifies local model serving; vLLM provides high-throughput inference serving. Both keep data off public cloud APIs.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗