Coding with an AI

Programming with an AI Agent

Artificial intelligence (AI) has fundamentally changed the way we program. AI agents can generate code, optimize, and even assist with debugging. Nevertheless, there are some limitations that programmers must keep in mind when working with AI.

Ordering and Duplication Issues

AI agents struggle with the correct ordering of code. For example, they might place initializations at the end of a file, causing runtime errors. Furthermore, AI can unhesitatingly define multiple versions of the same class or function within a project, leading to conflicts and confusion.

A code platform with memory and project structure helps

One solution for this is using AI code platforms that can manage memory and project structures. This helps maintain consistency in complex projects. Unfortunately, these features are not always applied consistently. As a result, the AI might lose project coherence and introduce unwanted duplications or incorrect dependencies during programming.

Most AI coding platforms work with so-called tools that the large language model can invoke. These tools are based on an open standard protocol (MCP). It is therefore possible to link an AI coding agent to an IDE such as Visual Code. Optionally, you can set up an LLM locally with llama of Ollama and choose an MCP server to integrate with. NetCare has created a MCP server to help with debugging and managing the underlying (Linux) system. Useful for when you want to deploy the code live immediately.
Models can be found on Hugging Face.

IDE extensions are indispensable

To better manage AI-generated code, developers can use IDE extensions that monitor code correctness. Tools such as linters, type checkers, and advanced code analysis tools help to detect and correct errors early on. They are an essential complement to AI-generated code to ensure quality and stability.

The cause of recurring errors: context and role in APIs

One of the main reasons why AI agents continue to repeat errors lies in the way AI interprets APIs. AI models require context and a clear role description to generate effective code. This means that prompts must be complete: they must not only contain the functional requirements but also explicitly state the expected result and the boundary conditions. To facilitate this, you can store the prompts in a standard format (MDC) and send them to the AI by default. This is especially useful for generic programming rules you use, as well as the functional and technical requirements and the structure of your project.

Tools such as FAISS and LangChain help

Products such as FAISS and LangChain offer solutions to enable AI to better handle context. For example, FAISS assists in efficiently searching and retrieving relevant code snippets, while LangChain helps structure AI-generated code and maintain context within a larger project. However, here too, you can optionally set this up locally yourself using RAG databases.

Conclusion: useful, but not yet autonomous

AI is a powerful tool for programmers and can help accelerate development processes. Nevertheless, it is not yet truly capable of independently designing and building a more complex codebase without human oversight. Programmers should view AI as an assistant that can automate tasks and generate ideas, but which still requires guidance and correction to achieve a good result.

Take contact to help set up the development environment to help teams get the most out of the development environment and spend more time on requirements engineering and design than on debugging and writing code.

 

Gerard

Gerard is active as an AI consultant and manager. With extensive experience at large organizations, he can unravel a problem exceptionally quickly and work towards a solution. Combined with an economic background, he ensures business-sound decisions.

AIR (Artificial Intelligence Robot)