SchemaAgent is an intelligent relational database design system that can automatically generate a complete database design based on user requirements, including conceptual model, logical model, and physical model. The system uses advanced AI technology to help users quickly build high-quality database structures without having to understand the complex details of database design.
- Simplify the database design process and lower the design threshold
- Automatically generate logical data models based on user-described requirements
- Automatically generate complete physical DDL statements
- Provide comprehensive database design reports
- Manager Agent: Analyzes user requirements, generates requirement analysis reports and result acceptance
- Conceptual Designer Agent: Generates entity-relationship models
- Conceptual Reviewer Agent: Reviews entity-relationship models
- Logical Designer Agent: Converts conceptual models into logical models. Considering data consistency issues, the logical model satisfies the third normal form.
- QA Engineer Agent: Responsible for generating test cases based on user requirements
- Execution Agent: Responsible for verifying whether the logical model can meet the test cases
- Physical Designer Agent: Generates DDL statements and recommends indexes
- Set up a virtual environment:
python -m venv schema- Install Python dependencies:
pip install -r requirements.txtThis will generate results for all examples in the dataset.
In the project root directory, execute:
cd agent
python agent_chat.pypython run.pyYou can get evaluation results by running evaluate.py
In the project root directory, execute:
cd physical_design
python gradio_interface.pyThis will launch a web interface where you can:
- Enter database requirement descriptions
- Generate a complete database design
- Download a complete database design report (PDF format)
Users can input requirements like:
A university needs a student course selection management system to maintain and track students' course selection information.
Students have information such as student ID, name, age, the name of the course chosen by the student, etc.
Each student can take multiple courses and can drop or change courses within the specified time.
Each course has information such as course number, course name, credits, lecturer and class time.
The popularity of a course depends on the number of students who take the course.
The system can predict the popularity of the course and provide support for academic decision-making.
The system will automatically generate a complete database design including table structures, relationships, constraints, and indexes.
