{"slug": "ai-is-not-the-solution-to-every-problem-when-rule-based-systems-make-more-sense", "title": "AI Is Not the Solution to Every Problem: When Rule-Based Systems Make More Sense", "summary": "A developer argues that rule-based programs often outperform AI on simple, repetitive tasks, citing a YOLO-based P&ID-to-Bill-of-Material demo that struggled with line tracing, multilayer drawings, and retraining costs. The developer proposes instead parsing DXF files with Python's ezdxf library to extract each equipment node and layer as JSON, then writing results into Excel templates with openpyxl, claiming lower cost and better accuracy than the AI approach. They urge solution builders to evaluate computation cost, training time, and data collection before defaulting to AI.", "body_md": "*Extensive Use of AI for Simple Task Costing Token and Even Then Not Producing Favorable Results*\n\nToday AI has been the buzzword every industry that wants to solve their task with the utilisation of AI, whether it be LLM application for RAG on technical document to ask for solutions, whether it be code, idea, calculation etc., any diffusion model for design, poster generation and all, using image processing model like YOLO to solve problems like defect detection.\n\nBut recent developments I noticed that there is too much extensive use of AI for simple task which a simple rule-based program can perform better. This is a concerning matter as the cost of running any simple AI task is far more than running a rule-based program.\n\n**A Practical Example: P&ID to Bill of Material**\n\nFor example, last month I witnessed a software demo of creation of Bill of Material from P&ID using YOLO which is great as it is a repetitive task if customer ask for continuous revision and human error comes in picture with that counting each and every equipment present there makes this task extensive.\n\nThe solution is there are software to generate P&ID and BOQ but restriction is the template on which BOQ is required and the template on which P&ID is created.\n\nComing back to the YOLO based solution it uses the object detection technique where each P&ID is given in image form to the model and each equipment is detected as an object obviously each equipment used is trained on that model.\n\nThis seems a very good solution to give the count of it. But the limitation is the line tracing, properties and other technical difficulties comes in place due to a P&ID being a multilayer and additional of new equipment will need training of it again plus AI being the buzzword and if it comes in picture the cost of the solution sky rocket.\n\n**A Rule-Based Approach**\n\nNow this problem can be solved by simple use of logic and understanding of drawing and Python.\n\nAs any drawing is basically a graph and the layers are vertically stacked 2D sheet at different coordinate from one dimension and weight are looking at drawing from other axis so different stack of 2D graph gives you a combination of a 2D drawing as now the layers are separated then comes one layer in that you can consider each block used or equipment used is a node which is connected to each other by a pipe.\n\nNow the basic understanding of graph analysis by Python using library ezdxf just change DWG to DXF or any other format to DXF as DWG is proprietary and closed as per AutoCAD.\n\nNow that can simply give you layer by layer JSON of each equipment and as Python is handy you can use pyxl like library to directly insert these values in your required Excel template or to generate a PDF in required format.\n\nThis simple rule-based solution can save cost, perform better than any AI based solution with that it saves you hours of training and computation cost.\n\n**AI Should Be Used Where It Makes Sense**\n\nThat's why I think everyone should read or at least decision maker should read the Kaggle course on AI ethics because that gives you clear idea where to use, how to evaluate and finally decision making for the use case.\n\nAI is the buzzword but it necessarily should not be the solution of every problem statement.\n\nThe simple task solution can be great with a rule-based program works better than AI based solution as I shown earlier and this is also to give an idea to solution builder that before making solution for any use case please evaluate every aspect of it.\n\nAI is a double-edged sword so keep that in mind the computation cost, training time, data collection and so on.\n\n*The Role of LLMs in Rule-Based Solutions*\n\nAs one more thing once you devised the rule-based solution and created the logic you can get that coded from any LLM that will be fast, time saving and useful addition in the process.", "url": "https://wpnews.pro/news/ai-is-not-the-solution-to-every-problem-when-rule-based-systems-make-more-sense", "canonical_source": "https://dev.to/shivraj8615/ai-is-not-the-solution-to-every-problem-when-rule-based-systems-make-more-sense-jnh", "published_at": "2026-09-27 12:44:19+00:00", "updated_at": "2026-09-27 13:01:01.061867+00:00", "lang": "en", "topics": ["artificial-intelligence", "computer-vision", "ai-ethics", "developer-tools"], "entities": ["YOLO", "ezdxf", "openpyxl", "AutoCAD", "Kaggle"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/ai-is-not-the-solution-to-every-problem-when-rule-based-systems-make-more-sense", "markdown": "https://wpnews.pro/news/ai-is-not-the-solution-to-every-problem-when-rule-based-systems-make-more-sense.md", "text": "https://wpnews.pro/news/ai-is-not-the-solution-to-every-problem-when-rule-based-systems-make-more-sense.txt", "jsonld": "https://wpnews.pro/news/ai-is-not-the-solution-to-every-problem-when-rule-based-systems-make-more-sense.jsonld"}}