Building an AI knowledge base that can query code isn't hard. The hard part is making sure it still keeps pace with the codebase itself three months later—this is the core judgment we saw this week in a long-form piece on Juejin. The author uses a real scenario as an example: 8 files changed, 0 of them actual code files. The correct response is "do nothing"—otherwise you're just burning API budget and waiting time for nothing.
What this is
This is an in-depth article on the engineering practice of landing RAG (Retrieval-Augmented Generation—having AI retrieve from an external knowledge base before answering), focused on an often-overlooked link: incremental index updates. The article proposes a three-layer decision mechanism—the first layer decides "skip or update this change," the second decides "rebuild only the changed functions," the third decides "propagate impact along the call chain." The core assumption underlying the entire logic: functions are relatively independent semantic units (the minimum unit of vector representation), so they can be locally replaced without running a full rebuild.
Industry view
Supporters see this as the必经之路 (necessary path) for RAG engineering—a mid-sized codebase full rebuild can easily take hours, and it's impossible to run one on every commit. Filtering by file type combined with function-level incremental updates is a pragmatic compromise. The numbers in the article are concrete: when 50 functions change out of a total of 7,761 functions, the update cost is about 0.6% of a full rebuild.
But the counterargument stands just as firmly. The "function as independent semantic unit" assumption doesn't hold up in real-world engineering: renaming a function affects the embeddings of all its callers; refactoring a class's inheritance shifts the entire symbol index; cross-file decorators, dynamic imports, and generic expansion all cause "local replacement" to produce hidden errors. Put differently, what incremental updates save in time may be paid for in "knowledge base drift that nobody notices three months later." We note that the author themselves admits propagation analysis is "an even harder problem"—but offers no verifiable solution.
Impact on regular people
For enterprise IT departments: If you're evaluating code AI tools, don't just ask "can it find things"—ask "can it still find things three months later?" Index maintenance cost is hidden TCO (Total Cost of Ownership).
For individual careers: This kind of engineering detail is becoming the dividing line between "AI application engineers" and "AI demo engineers." People who understand call-graph propagation are far scarcer than those who only know how to call APIs.
For the consumer market: There won't be direct short-term transmission to consumer-facing products, but enterprise code AI pricing may shift from "per query" to "per maintenance," ultimately affecting procurement budgets.