Coderen met een AI

Programming with an AI Agent

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

Problems with order and duplication

AI agents struggle with the correct ordering of code. For example, they may place initializations at the end of a file, causing runtime errors. In addition, AI can without hesitation 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 is to use AI coding 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 can lose track of a project’s coherence and introduce unwanted duplications or incorrect dependencies during programming.

Most AI coding platforms work with so-called tools that can invoke the large language model. Those tools are based on an open standard protocol (MCP). It is therefore possible to connect an AI coding agent to an IDE such as Visual Studio Code. You can also set up a local LLM with llama or 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. Handy if you want to deploy the code live immediately.
Models can be found on huggingface.

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 detect and correct errors early. 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 AI agents keep repeating errors lies in how AI APIs are interpreted. AI models need context and a clear role description to generate effective code. This means prompts must be complete: they should not only include the functional requirements but also explicitly state the expected result and the boundary conditions. To facilitate this, you can store prompts in a standard format (MDC) and always send them with the AI. That is especially useful for generic programming rules you follow and the functional and technical requirements and structure of your project.

Tools like FAISS and LangChain help

Products such as FAISS and LangChain offer solutions to help AI better handle context. FAISS, for example, helps efficiently search for and retrieve relevant code snippets, while LangChain assists in structuring AI-generated code and maintaining context within a larger project. But here too you can optionally set it up locally with RAC databases.

Conclusion: useful, but not yet autonomous

AI is a powerful tool for programmers and can help accelerate development processes. Yet it is not really 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.

Get in touch contact set up to help establish the development environment so teams can get the most out of it and spend more time on requirements engineering and design than on debugging and writing code.

 

Gerard

Gerard works as an AI consultant and manager. With extensive experience at large organizations he can quickly unravel a problem and work toward a solution. Combined with an economics background, he ensures commercially responsible choices.