Phase 1 Objective: Establish the foundational collaborative workspace where a User and an AI Agent can seamlessly co-create and edit Entity-Relationship (ER) database schemas in real-time.
Before generating synthetic data, the system needs a defined database schema. Phase 1 focuses entirely on building a "Live Sync" schema designer. The unique value proposition is the shared state: the user can build the diagram manually using a GUI, or instruct the AI via chat to build/modify it for them. Both operate on the exact same underlying data structure.
- Onboarding / Context Entry: The user lands on the application, enters their details (
user_id), and defines the project (project_id, name, description). This creates the Context Packet. - Main Workspace: The user is taken to the main interface, split into two main sections:
- Left Pane (Interactive Canvas): A visual ER diagram builder.
- Users can manually add/remove tables.
- Define column names and data types.
- Establish Primary Key (PK) and Foreign Key (FK) relationships.
- Right Pane (AI Chat Panel): A conversational interface.
- Users can type natural language prompts (e.g., "Create an e-commerce schema with users, orders, and products" or "Add a 'status' column to the orders table").
- Left Pane (Interactive Canvas): A visual ER diagram builder.
To achieve the seamless interaction between the User UI and the AI Agent, the system will use a centralized database as the single source of truth.
- Database: SQLite (for Phase 1 simplicity).
- State Management (
schema_json): The entire visual representation and structure of the ER diagram is stored as a JSON object inside theschema_jsoncolumn of the database. - The Interaction Loop:
- Manual Edit: User updates the canvas -> App updates the
schema_jsonin SQLite -> Canvas re-renders. - AI Edit: User sends a chat message -> AI Agent processes intent -> AI calls an
update_schematool/function to modify theschema_jsonin SQLite -> UI detects the change ("Live Sync") and the Canvas updates automatically.
- Manual Edit: User updates the canvas -> App updates the
Based on the architecture, the core SQLite table required to manage the shared workspace is the Projects Table:
- Generating synthetic rows using LLMs.
- Seeding bulk data using SDV (Synthetic Data Vault) or Faker.
- Exporting data to external databases.
Note: The primary technical challenge for Phase 1 will be establishing the real-time or near-real-time synchronization loop between the SQLite database updates (performed by the AI) and the frontend React/Vue canvas.