Data Relationships
For an AI to answer questions across multiple tables (e.g., “Which customer bought the most products?”), it must understand how those tables are connected. AnalytAI uses a unique Triple-Tier Relationship System to map your data perfectly.
1. Database Foreign Keys (FKs)
Section titled “1. Database Foreign Keys (FKs)”When you connect a SQL database, AnalytAI automatically reads your existing Foreign Key relationships. These are the “hard links” already defined in your database schema.
- Status: Automatic & Instant.
- Reliability: Highest (100% accuracy).
2. Cosmic Detection (AI-Powered)
Section titled “2. Cosmic Detection (AI-Powered)”Often, databases have tables that should be linked but aren’t explicitly connected with Foreign Keys. AnalytAI uses a proprietary Cosmic Detection algorithm to find these hidden links.
- How it works: The algorithm analyzes column names, data types, and actual data patterns to suggest potential relationships.
- Approval: These relationships appear as “Pending” in your project settings. You can review and Approve them to activate them for the AI.
3. Manual Linking (Drag & Drop)
Section titled “3. Manual Linking (Drag & Drop)”For complete control, AnalytAI provides a visual Manual Linking interface powered by React Flow.
- Visualization: See your entire database schema as a visual map.
- Creation: Simply click and drag a line from one column to another to create a relationship.
- Compatibility: The system automatically validates that the data types (e.g., Number to Number) are compatible before allowing the link.
Managing Relationships
Section titled “Managing Relationships”You can find all relationship settings in your Project Settings → Relationships tab.
- Database List: Shows all hard links from your SQL schema.
- Cosmic Suggestions: A list of links for you to “Accept” or “Reject”.
- Manual Map: The visual canvas for custom relationships.