Link data sources to an Agent

In the Agent Builder, connecting relevant data sources is one of the most crucial steps to empower your agent to perform meaningful analysis. Here's how to do it:

Step 1: Go to the Agent Builder

Step 2: Click the "Data Sources" Tab

Step 3: Manage Data Sources


📌 Only Connect the Tables Your Agent Actually Needs

While it might be tempting to connect your entire database, it's better to keep things focused. Connecting too many tables:

  • Can confuse the agent

  • Slows down reasoning

  • Makes debugging harder

Instead, only connect the tables relevant to the agent’s task.

💡 Example Scenarios

❌ Don’t do this: You connect 80+ tables from your main production DB “just in case” — your Retail Agent gets overwhelmed with HR, logistics, and dev ops tables it doesn’t need.

✅ Do this instead: You’re building a 'Sales & Inventory Analyst' to support sales and inventory questions. You only connect:

  • lh_customers

  • lh_order_items

  • lh_product_categories

  • lh_inventory

  • lh_employees (for store-level reporting)

This keeps your agent sharp and focused.

✅ Another good example: You’re building a Marketing Campaign Agent. You only connect:

  • email_campaigns

  • ad_spend_by_channel

  • customer_segments

  • website_traffic_logs

Leave out everything else like finance, warehouses, or IT logs.


🔍 How Does the Agent Understand Relationships Between Tables?

The agent inspects table columns to find:

  • Primary keys (PKs)

  • Foreign keys (FKs)

It builds a relational map automatically using this metadata, so you don’t need to manually define relationships.


🧾 Metadata Helps the Agent Reason Better

The agent uses table and column metadata to understand business context. The more descriptive your metadata, the smarter your agent becomes.

Check out the Metadata docs to learn how to define it well.

Last updated

Was this helpful?