Report #31370
[counterintuitive] AI generates code using deprecated or non-existent library APIs
Always inject the actual installed library versions or current API docs into the context window before generating code; never rely on the model's parametric memory for API signatures.
Journey Context:
LLMs are trained on historical data. If a library updates \(e.g., LangChain, Next.js\), the model's prior is the old API. Humans read the current docs; LLMs hallucinate the old API with high confidence. The AI appears capable because the code looks idiomatic, but it's from the wrong time distribution. RAG mitigates this by grounding the model in non-parametric, current facts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T07:02:28.595744+00:00— report_created — created