A system with three AI agents that work together to design, build, and analyze databases:
- Database Designer Agent - Designs database schemas based on requirements
- Data Engineer Agent - Builds the database from the schema
- Database Analyst Agent - Queries the database and provides insights
- AI-Powered Database Design: Generate optimal database schemas based on natural language requirements
- Automated Database Creation: Build SQLite databases from the generated schemas
- Intelligent Data Analysis: Query the database and get insights using natural language
- Web Interface: Simple web UI to interact with the system
- API Endpoints: RESTful API for integration with other systems
- CLI Interface: Command-line interface for quick testing
-
Clone this repository
-
Install dependencies:
npm install -
Create a
.envfile with your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here DATABASE_PATH=./database.sqlite -
Run the application:
npm startOr for development with auto-reload:
npm run dev
Open your browser and navigate to http://localhost:3000 to use the web interface.
POST /design- Design a database schema based on requirementsPOST /build- Build a database from a schemaPOST /sample-data- Add sample data to the databasePOST /analyze- Analyze data based on a requestPOST /workflow- Run the entire workflow from design to analysis
Run the example script to see the system in action:
npm run example
Run the application and follow the prompts to use the CLI interface:
npm start
- src/agents/ - Contains the three agent implementations
databaseDesignerAgent.js- Designs database schemasdataEngineerAgent.js- Builds databases from schemasdatabaseAnalystAgent.js- Analyzes data and provides insights
- src/utils/ - Utility functions
openai.js- OpenAI API integrationdatabase.js- Database operationssampleData.js- Sample data generation
- public/ - Static web files
index.html- Web interface
- index.js - Main application entry point
- example.js - Example script
- Node.js - JavaScript runtime
- Express - Web framework
- SQLite - Database
- OpenAI API - AI models for agents
- dotenv - Environment variable management
ISC