Hi Fred,
I went through the same phase you describe, when AI becomes more of a burden than a help, trying to please or even flatter you, rather than delivering useful code.
The basic problem with AI "hallucinations" is loss of context. If you notice, when a thread grows too large, they start summarizing. This summarization is a warning sign of lost context, which is why the .md file is so essential. It's a summary of the project that you should always keep in the project directory and update as the architecture grows.
Then there's something else that, without intending to advertise any particular company, makes all the difference: the models we use. Give Opus 4.6 a try, for example. The difference compared to previous AI models for software coding is enormous, although this may change in the future. The problem with using this model is the price of the tokens! There you'll find very few situations where the AI says something childish to please you, like: "I'm giving you the corrected code, working perfectly and ready for production, even though it's full of bugs."
In the rules file, give it access to the Wiki with the object Pascal documentation for Delphi or Free Pascal so it can refer to it whenever it has problems or needs to know the RTL, models, etc.; it's essential.
Hi Fred, Your observations are entirely valid. Most of the recurring errors you see aren't due to the AI being "bad," but rather to the lack of a stable working structure. When working with Pascal, Lazarus, or UOS, the model needs some guidance to behave consistently.
To avoid the typical repetition of syntax errors, logic errors, or inconsistent code, everything is greatly simplified by establishing two essential elements: clear instructions and a suitable context file.
Hello Sivestre.
Thanks for the tips, but I asked each AI: "What do I need to do to make sure you remember the corrections I show you and incorporate them in the next session?"
Their responses (similar for all the AIs): Add something like this to your main readme.md file:
Examples and Documentation
Before using UOS or asking questions, we strongly recommend looking at the examples in the examples folder. These examples demonstrate how to correctly use UOS features and can answer many practical questions.
Examples: (link to examples)
I did it but the same errors persist in the next session.
I also noticed that all the AIs make the same syntax errors; it's as if they were all following the same stupid teacher.