Loading... Loading...
Grenze Logo
GRENZE International Journal of Engineering and Technology Vol. 12 (2026), Issue 2

An End-to-End Pipeline for Automated Database Schema Generation using Local LLMs

Authors

Aswin K Reji, Sneha George, T. Jemima Jebaseeli

Abstract

Software Engineering Designing sound relational database structure is a classical software engineering task which has long required extensive knowledge of the domain and familiarity with SQL syntax, which poses a major barrier to entry among inexperienced developers. Although Large Language Models (LLMs) have shown great potential in code generation, the use of cost-effective locally deployed small models to generate complex schema is frequently impeded by structural hallucinations and malformed results. This research introduces AgentDB Copilot, a zero-code, end-to-end framework that converts conversational requirements in natural language directly to syntactically correct MySQL schema and visual Entity-Relationship (ER) diagrams, automatically using Artificial Intelligence techniques. To address the systematic inaccuracy of small-parameter models, the proposed system offers a robust generation pipeline that is based on a locally deployed 3-billion parameter LLM (Qwen2.5-Coder:3b using Ollama). This pipeline presents a new domain-sensitive prompting strategy to reduce hallucination, as well as a powerful three-stage JSON extraction and sanitization module that can take on imperfect LLM results. The resulting extracted data is converted into full Data Definition Language (DDL) statements with imposed primary and foreign key constraints which are presented to the user through a token-streaming interface which is real time. Eight experimental tests of different application domains show 100 percent success rate in producing structurally correct and complete schemas in 8-12 seconds of regular consumer hardware. Through a union of effective local inference and strict error recovery engineering, the research makes database design democratically accessible and guarantees privacy, zero cloud computational costs, and a developer-friendly user experience.