Lesson 4.3 — Mapping Intents to Data Sources

Introduction: Connecting the Dots

In the previous lesson, we meticulously designed our intent taxonomy, creating a structured map of all possible user goals. We now have a clear understanding of what our users want to achieve. The next logical step is to determine where the answers to their questions can be found. This process is called intent-to-data-source mapping.

Intent-to-data-source mapping is the crucial step of connecting each intent in our taxonomy to the specific data source, tool, or agent that is best equipped to handle it. This is where our conceptual blueprint (the taxonomy) becomes an actionable routing plan. A well-executed mapping strategy ensures that every query is not only correctly classified but also efficiently directed to the most relevant and reliable source of information.

This lesson will guide you through the process of creating a comprehensive and effective intent-to-data-source map, transforming your taxonomy into a powerful routing engine.

The Data Source Landscape

Before we can map intents to data sources, we must first have a clear inventory of all the information and tools available to our AI agent. In a modern enterprise, this landscape can be incredibly diverse.

Data Source Type
Description
Examples

Vector Stores

Optimized for semantic search, these are the primary knowledge bases for unstructured text.

Product documentation, FAQs, marketing content, support articles.

Structured Databases

Traditional databases (SQL or NoSQL) that store structured data.

Customer records, order information, financial data, inventory levels.

APIs & Tools

Interfaces that allow the agent to interact with other systems and perform actions.

Placing an order, sending an email, checking a shipping status, booking a meeting.

Other AI Agents

Specialized agents with their own unique skills and knowledge bases.

A finance agent, a human resources agent, a technical support agent.

Creating a comprehensive inventory of all available data sources is a critical prerequisite for effective mapping.

The Mapping Process: A Step-by-Step Guide

With our intent taxonomy and data source inventory in hand, we can now begin the mapping process. This is a strategic exercise that requires a deep understanding of both user needs and the available information assets.

Step 1: Creating the Mapping Matrix

The most effective way to visualize and manage the mapping process is to create a mapping matrix. This is a table that lists all of your intents on one axis and all of your data sources on the other.

INTENT
Confidence Gate
Route Type
Target Files / Collections
Filters / Args
Fallback

Get-Order-Status

≥0.65

Function

get_order_status(order_id)

require: order_id

ask_for_order_id → escalate

Refund-Status

≥0.70

KB Vector

refunds_handbook.md, refunds_policy_2023.pdf

tag=refunds, effective_date>=2023

function:get_refund_case

Product-Specs

≥0.60

KB Vector

specs_catalog_2024.pdf, specs/*

product_id={{pid}}, locale={{lang}}

catalog_api

Schedule-Demo

≥0.80

Function

create_demo_meeting()

require: timezone

KB: demo_playbook.md

Out-of-Scope

n/a

Escalate

n/a

n/a

human_handoff

Step 2: Assigning Primary and Secondary Sources

For each intent, identify the primary data source that is most likely to contain the answer. This is the first place the router will look. In some cases, it may also be useful to identify secondary or fallback sources that can be consulted if the primary source does not yield a satisfactory result.

In the example above, a query with the intent product.specifications would first be routed to the "Product Docs" vector store. If no answer is found, it might then fall back to the "FAQs" vector store.

Step 3: Handling Multi-Source Intents

Some intents may require information from multiple sources. For example, to answer an order.track query, the agent might need to retrieve the order details from the "Orders" database and then use the tracking number to call the "Shipping" API. Your mapping should account for these multi-step workflows.

Step 4: Documenting the Rationale

For each mapping decision, it is important to document the rationale behind it. Why is the "Product Docs" vector store the primary source for product.specifications? What specific information is expected from the "Shipping" API? This documentation is invaluable for maintaining and updating the routing system over time.

Conclusion: From Blueprint to Action Plan

Intent-to-data-source mapping is the bridge between understanding user needs and fulfilling them. It transforms our abstract intent taxonomy into a concrete, actionable plan for our routing system. By carefully mapping each intent to the most appropriate data source, we ensure that our AI agent can efficiently and accurately find the information it needs to provide helpful and relevant responses.

In the next lesson, we will address the inevitable complexities of a real-world system: conflict resolution and fallbacks. We will explore how to handle situations where an intent is ambiguous or where the primary data source fails to provide an answer.

Last updated