Manuscript Offprint

arXiv:2608.29096

Development of an Autonomous AI Coding Agent using Monte Carlo Tree Search (MCTS) and Gemini LLM Frameworks

Pravin Game, Vipin Ramakrishnan, Prathamesh Wagh

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The ongoing changes in software engineering requirements have created a substantial need for automated tools which can create secure source code from natural language input. The performance of traditional Large Language Models (LLMs) becomes limited by their "one-shot" capability which results in logical hallucinations together with reduced algorithmic performance during complicated operations. The research presents an autonomous AI Coding Agent which establishes a connection between LLM-generated content and production-ready software through its organized methodology for decision making. Our framework uses the Gemini 2.5 Flash API for essential reasoning capabilities while employing a tailored Monte Carlo Tree Search (MCTS) method to solve code generation challenges as a search operation. The agent uses a "Self-Critic" evaluator system to test different implementation methods which it ranks according to their accuracy and difficulty level before it improves its operational framework through backpropagation. The system operates through a Flask-based web interface which delivers instant feedback together with

syntax highlighting features. Our experimental results show that the MCTS-based method achieves a 92% success rate on complex logical prompts while surpassing standard zero-shot generation models.

Keywords: Artificial Intelligence, Autonomous Coding Agent, Monte Carlo Tree Search (MCTS), Large Language Models, Gemini 2.5 Flash, Flask, LangChain, Software Automation.

Chapter 1: Introduction

References (9)

  • Mastering Coding Challenges with AlphaCode and Monte Carlo Tree Search
  • Transformer and Large Language Models for Automatic Code Generation: A Systematic Literature Review
  • Self-Criticism and Tree-of-Thoughts Reasoning in LLM-driven Software Engineering
  • Automated Generation and Evaluation of Algorithms using Langchain and Gemini LLM
  • Mastering the Game of Go with Deep Neural Networks and Tree Search
  • Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Self-Refine: Iterative Refinement with Self-Feedback
  • ReAct: Synergizing Reasoning and Acting in Language Models
  • The Rise and Potential of Large Language Model Based Agents: A Survey