Back to Documentation
Agent Builder15 min read

Using AI Assistant for Data Mapping

Leverage AI to automatically map database entities and relationships for your agents.

Using AI Assistant for Data Mapping

Overview

The AI Assistant in the Data Mapping step helps non-technical users identify and map relevant database entities for their agents using natural language.

When to Use AI Assistant

  • You have many tables/collections and want to focus on specific ones
  • You're not sure which entities are relevant for your use case
  • You want to understand relationships between data
  • You need help identifying business entities

Step 1: Access Data Mapping

  1. In Agent Builder, after Schema Analysis, you'll reach Data Mapping
  2. You'll see the Entity Relationship graph showing all your data
  3. Look for the AI Assistant box at the top

Step 2: Use Natural Language Instructions

Type your requirements in plain English:

Examples:

  • "I want to create agents to show all the outlets and sales data only"
  • "Map those data for orders only"
  • "Show me products and inventory information"
  • "Include customer and order data"

Step 3: Review AI Suggestions

The AI will:

  1. Filter entities: Show only relevant tables/collections
  2. Suggest related entities: Recommend additional entities you might need
  3. Explain reasoning: Tell you why it selected certain entities

Step 4: Iterate and Refine

You can continue using AI Assistant to:

  • Add more filters: "Also include employee data"
  • Remove entities: "Remove inventory tables"
  • Refine focus: "Focus only on sales transactions"

Step 5: Review the Graph

  1. The Entity Relationship graph updates automatically
  2. You'll see:
  3. The graph fits to show only relevant entities
  • - Entities: Number of tables/collections shown
  • - Relationships: Connections between entities
  • - Business Entities: Mapped business concepts

Step 6: Reset if Needed

  • Click Reset to Complete View to see all entities again
  • This clears all filters and shows the full schema

AI Assistant Features

Smart Entity Recognition

The AI understands business terms:

  • "sales" → maps to orders, transactions, invoices
  • "products" → maps to products, items, inventory
  • "customers" → maps to customers, clients, users

Relationship Detection

Automatically identifies:

  • Foreign key relationships
  • Many-to-many relationships
  • Hierarchical structures

Context Awareness

The AI considers:

  • Your agent type
  • Your data source structure
  • Common business patterns

Best Practices

  1. Be Specific: "Show sales data" is better than "show data"
  2. Use Business Terms: Use terms you understand, not technical table names
  3. Iterate: Start broad, then narrow down
  4. Review Suggestions: The AI's suggestions are helpful but review them
  5. Reset When Needed: Don't hesitate to reset and start over

Example Workflow

Scenario: Create an agent for sales analysis

  1. Initial Prompt: "I want to analyze sales data"
  • - AI shows: orders, order_items, products, customers
  1. Refine: "Focus on orders and products only"
  • - AI filters to: orders, order_items, products
  1. Add Context: "Also include outlet information"
  • - AI adds: outlets table
  1. Final Review: Check the graph shows the right entities

Troubleshooting

AI not filtering correctly?

  • Try rephrasing your request
  • Be more specific about what you need
  • Use business terms instead of technical names

Graph not updating?

  • Wait a moment for processing
  • Try clicking Reset and starting over
  • Check browser console for errors

Too many/too few entities?

  • Use more specific instructions
  • Add or remove filters iteratively
  • Review AI suggestions carefully

Advanced Tips

  • Combine multiple filters: "Show sales and inventory, but exclude employee data"
  • Use negation: "Everything except financial records"
  • Reference by function: "Data needed for order processing"
  • Specify relationships: "Include all tables related to customers"