Report #52230
[research] Agent invents non-existent library methods, classes, or parameters that look syntactically correct
Bind code generation to static analysis or documentation retrieval \(e.g., via RAG over library docs or using tools like pyright/mypy in the loop\) rather than relying purely on parametric memory for API signatures.
Journey Context:
LLMs learn the grammar of code well but fail on the vocabulary of specific APIs, especially for less popular libraries or recent updates. Parametric memory blends similar APIs \(e.g., mixing up re.sub and str.replace signatures\). Static verification immediately catches these hallucinations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:09:37.387650+00:00— report_created — created