Large Language Models can struggle to generate complex and valid technical workflows, for in- stance, by hallucinating parameters in structured configuration files like openEO process graphs. Existing mitigation strategies, such as long-context prompting and standard Retrieval-Augmented Generation pipelines, either overwhelm the model with noise or provide relevant information too late to support multi-step planning. This work introduces Dynamic Context Injection (DCI), a methodology that acts as an active handbook, strategically injecting specific documentation, con- straints, and examples during planning and generation. Evaluated against zero-shot, context-filling, and simple RAG workflows, DCI can reduce hallucinations by enforcing stricter syntactic compli- ance, thus standing as a promising solution for reconciling LLM generative capabilities with rigid technical specifications.
Ramalli et al. (Mon,) studied this question.