A. Project Title
Development of a DAI5-Guided Retrieval-Augmented AI Agent for Turning Parameter Optimization Using Python-Based Computational Modeling
B. Author Complete Name
Raden Jachregantravis
C. Affiliation
Department of Mechanical Engineering, Faculty of Engineering, Universitas Indonesia
D. Abstract
This report presents the development of an artificial intelligence (AI) agent for optimizing turning process parameters, guided by the DAI5 problem-solving framework, which integrates spiritual consciousness with rigorous engineering computation. The project aims to design a Retrieval-Augmented Generation (RAG)-based AI system capable of answering both theoretical and computational questions related to machining optimization, particularly cutting speed, feed rate, and depth of cut in turning operations. The AI agent is supported by a curated knowledge base containing machining theory and a hardened Python computational template that performs constrained nonlinear optimization using the Sequential Least Squares Programming (SLSQP) method.
The methodology combines classical machining modelsโcutting force, surface roughness, power consumption, tool life, and cost per partโwith a spiritually aligned framework that emphasizes intention, ethical awareness, and reflective practice. The system enables the generation of customized Python scripts based on user-defined machining conditions, ensuring transparency, reproducibility, and engineering validity. Results demonstrate that the AI agent can consistently retrieve correct theoretical knowledge, generate structurally correct computational code, and adapt numerical parameters without violating physical or process constraints.
This work highlights the feasibility of integrating spiritual awareness, computational engineering, and artificial intelligence into a unified framework, offering a novel approach to engineering problem-solving that aligns technical excellence with higher-purpose consciousness.
E. Author Declaration
- Deep Awareness (of) I
- In undertaking this project, the author consciously acknowledges that all knowledge, reasoning ability, and technical capability originate solely from The One and Only, The Creator of the universe and all that exists within it. This awareness establishes humility and responsibility in the engineering process, recognizing that human intellect is limited and that true understanding arises through remembrance of God.
- This state of awareness corresponds to the concept of nafs, the fundamental human reality embedded within the heart (qalb), which governs intention, perception, and ethical conduct. By maintaining this awareness throughout the project, the author seeks to ensure that the development of artificial intelligence serves not merely technical efficiency, but also truth, responsibility, and benefit to humanity.
- Intention of the Project Activity
- The intention (niyyah) of this project is to develop an AI-based engineering tool that aids decision-making in manufacturing processes while remaining aligned with ethical principles, honesty, and usefulness. The project is intended as an act of learning and contribution, not self-glorification, and is pursued for the sake of God, with the aim of advancing engineering understanding, educational clarity, and responsible use of artificial intelligence.
F. Introduction
Modern manufacturing processes increasingly demand optimization to balance productivity, quality, cost, and sustainability. In turning operations, the selection of cutting speed, feed rate, and depth of cut significantly affects surface quality, tool life, energy consumption, and economic performance. Traditionally, such optimization is performed through handbook values, trial-and-error experimentation, or statistical methods such as Design of Experiments (DOE).
With the rapid advancement of artificial intelligence, there exists an opportunity to enhance machining optimization through AI-assisted reasoning. However, many AI systems operate as opaque black boxes, providing results without transparency, physical grounding, or ethical reflection. This project addresses this gap by developing a RAG-based AI agent that combines verified machining theory, explicit mathematical models, and reproducible Python computation.
3. Initial Thinking (About the Problem)
- The core problem addressed in this work is twofold:
- Technical Problem:
How to systematically optimize turning parameters under realistic constraints (power, surface roughness, tool life, and cost) using reliable numerical methods. - Methodological Problem:
How to ensure that an AI system providing such optimization remains transparent, verifiable, and aligned with ethical and spiritual values.
- Technical Problem:
- Existing AI approaches often lack explicit constraint handling, fail to cite physical models, or generate unverifiable recommendations. This motivates the development of an AI agent grounded in first-principle machining theory, structured computation, and a value-driven framework.
G. Methods & Procedures
4. Idealization
- To make the problem tractable while maintaining realism, the following idealizations were adopted:
- Cutting force modeled using a linear specific cutting force model:
- Surface roughness modeled using the geometric turning approximation:
- Tool life modeled using the Taylor equation:
- Power calculated from force and cutting speed:
- Cost per part modeled as a combination of machining time and tool consumption.
- Cutting force modeled using a linear specific cutting force model:
- These assumptions are widely accepted in machining analysis and provide a reliable balance between simplicity and engineering accuracy
5. Instruction Set
The solution was implemented through the following procedural steps:
- Validation via Question Sets
A comprehensive set of theoretical, numerical, and code-generation questions was designed to test correctness and robustness.
- Knowledge Curation
Machining theory documents were curated and converted into structured text modules for RAG retrieval.
- Computational Template Development
A hardened Python script (Module 10) was developed containing:- Data classes for geometry, machine, tool, and constraints
- Machining models
- A constrained nonlinear optimizer using SLSQP
- Visualization via cost and roughness plots
- RAG Integration Design
The Python template was embedded as knowledge, accompanied by explicit AI behavior rules to prevent hallucination or structural modification.
- Optimization Algorithm
The Sequential Least Squares Programming (SLSQP) method was used due to its suitability for smooth, constrained nonlinear problems.


H. Results & Discussion
The AI agent successfully demonstrated:
- Accurate retrieval of machining theory across surface roughness, cutting forces, tool life, and cost modeling.
- Correct application of physical constraints, including power limits and roughness thresholds.
- Generation of complete, runnable Python scripts that preserve structure while adapting numerical values.
- Proper use of SLSQP as a gradient-based constrained optimization method.
- Visual interpretation through cost-versus-speed and roughness-versus-feed plots.
From an engineering perspective, the results confirm that optimal cutting conditions often occur at moderate cutting speeds where reduced machining time balances increased tool wear. From a methodological perspective, the project demonstrates that AI systems can be designed to reason transparently rather than opaquely.
I. Conclusion, Closing Remarks, and Recommendations
This project successfully demonstrates the integration of spiritual awareness, engineering computation, and artificial intelligence through the DAI5 framework. The resulting AI agent is not merely a computational tool, but a reflective system that aligns technical decision-making with ethical intention.
Future work may include:
- Integration with real-time machine data
- Expansion to milling and drilling processes
- Execution-enabled AI tools for live computation
- Inclusion of sustainability and energy optimization metrics
J. Acknowledgments
The author expresses gratitude to Prof. Ir. Ahmad Indra Siswantara, Ph.D, from the Mechanical Engineering Department, Universitas Indonesia who introduced the DAI5 framework, enabling a holistic approach to engineering problem-solving.
K. (References) Literature Cited
Kalpakjian, S., & Schmid, S. (2014). Manufacturing Processes for Engineering Materials. Pearson.
Groover, M. P. (2010). Fundamentals of Modern Manufacturing. Wiley.
Shaw, M. C. (2005). Metal Cutting Principles. Oxford University Press.
Siswantara, A. I. (2025). DAI5: โDeep Awareness of Iโ. Depok: UI Publishing. E-ISBN: 978-634-244-036-0.
Taylor, F. W. (1907). On the Art of Cutting Metals. ASME.
Nocedal, J., & Wright, S. (2006). Numerical Optimization. Springer.
L. Appendices
https://drive.google.com/drive/folders/1qmtbsVhBvJlR7aKVJoQDp9ml_AcJRTT7?usp=sharing