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 that programmers need to keep in mind when working with AI.

Problems with order and duplication

AI agents have difficulty with the correct order of code. For example, they might place initializations at the end of a file, causing runtime errors. Additionally, 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 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 can lose track of the project’s coherence and introduce unwanted duplications or incorrect dependencies during programming.

Most AI coding platforms work with so-called tools that can be called by the large language model. These 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 Code. Optionally, you can set up a local LLM with llama or ollama and choose an MCP server to integrate with. 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 form 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 keep repeating errors lies in how AI interprets APIs. AI models need context and a clear role description to generate effective code. This means prompts must be complete: they should not only contain the functional requirements but also explicitly state the expected result and boundary conditions. To facilitate this, you can save prompts in a standard format (MDC) and always send them along to the AI. This is especially useful for generic programming rules you apply 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. For example, FAISS assists with efficiently searching and retrieving relevant code snippets, while LangChain helps structure AI-generated code and maintain 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 speed up development processes. However, 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 still requires guidance and correction to achieve a good result.

Contact us to help set up the development environment to assist teams in getting the most out of their development environment and spending more time on requirements engineering and design rather than debugging and coding.

 

Gerard

Gerard

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

AIR (Artificial Intelligence Robot)