Skip to main content

Connect and Configure Product Catalog for AI Agent

Product catalogs enable your AI agent to recommend and sell products in a relevant, context-aware way during conversations. By connecting a catalog, the agent can match user questions to products from your database, provide detailed descriptions, and share direct purchase links.

๐Ÿ’ก Note: Flametree uses Baserow โ€” an online, no-code database platform โ€” to store and manage your product catalogs. You manage products via the Baserow web interface, and your AI agent automatically retrieves the latest information.


Prerequisitesโ€‹

  • A registered Flametree account
  • At least one AI agent created in Flametree
  • (Optional) A Baserow account registered with the same email address used for Flametree

Setupโ€‹

Step 1. Create a product catalog on the portalโ€‹

  1. Go to AI agents > Products
  2. Click Create product catalog +
  3. Enter a name for your product catalog
  4. Once created, the new catalog and its URL will appear on the screen

Step 2. Open the catalog in Baserowโ€‹

  1. Select the catalog URL
  2. Log in to Baserow or sign up for a new account

โš ๏ธ Important: You must use the same email address for Baserow that you use for Flametree. If the emails do not match, you will not be able to access the workspace.

Step 3. Accept the workspace invitationโ€‹

To access the database, you must accept the invitation to the workspace.

  • From the Baserow main page: Select Accept on the workspace invitation.
  • From your email: Open the invitation email you received and click the provided link.

After accepting, your workspace will display the ProductCatalogs database and your new catalog.

If you don't receive an invitation

  • Select the Resend invitation button on the Product Catalogs page.
  • Check your email inbox and spam folder.
  • Log out of Baserow and log back in to refresh the invitation list.

Step 4. Add products to your catalogโ€‹

  1. Open your product catalog in Baserow
  2. Review the example product in the first row
  3. Add up to 20 products to the catalog by filling in the required fields
FieldDescription
NameProduct name displayed to users. Keep product names short and descriptive
Brief DescriptionShort 2โ€“3 sentence summary. This helps the AI agent quickly identify the most relevant product. Ensure it is clear and benefit-focused to improve AI matching
DescriptionDetailed description containing what's included, the target audience, the problem it solves, how it works, key benefits, and specifications
CategoryProduct category (for example: Manual, Webinar, Course)
PricePrice or pricing model (for example: $29 one-time, Basic โ€“ $10, Advanced โ€“ $20). You can also explain complex pricing in the Description field. Remember to update pricing and descriptions regularly to maintain accuracy
LinkURL where the product can be purchased or viewed
ActiveDetermines whether the product is visible to users
Example entry

The table below illustrates a correctly formatted product entry in Baserow:

FieldValue
NameProductivity Masterclass
Brief DescriptionA 2-hour live webinar to boost your daily productivity
DescriptionThis live webinar covers proven productivity techniques, tools, and mental frameworks to help professionals achieve more in less time. Suitable for freelancers, managers, and entrepreneurs
CategoryWebinar
Price$29 one-time
Linkhttps://example.com/productivity
ActiveFalse

๐Ÿ’ก Tips: Group similar products into categories to improve AI recommendations

  1. On the left sidebar menu, go to the AI Agents > Agents
  2. Double click your agent
  3. Go to General > Product catalog
  4. Select your newly created product catalog

    ๐Ÿ’ก Tip: An agent can be connected to only one product catalog at a time

  5. Click Save

Your AI agent can now recommend and sell products from your catalog directly in conversations. You can also provide specific selling instructions in the Task field on the agent page.

๐Ÿ’ก Tip: If the agent doesn't show products, check that you have selected the correct catalog in General > Product catalog and saved your changes.

Step 6. Connect the tool groupโ€‹

For the AI agent to be able to connect to the product catalogs you need to:

  1. Create the Product Catalog tool group
  2. Add the tool group to the agent workflow
  3. Connect the tool group

Create the Product Catalog tool groupโ€‹

  1. On the left sidebar menu, go to AI Agents > Tools

  2. In the upper-right corner, click Add tool group +

  3. In the form that opens:

    • Add the Name for your tool group โ€” The name of the YAML file
    • Add a short Description โ€” What the tool group does. For example, Baserow Product catalog integration
    • Add a YAML file. The YAML file defines when and under what conditions the tool group is executed
    • Click Save to add the tool group
  4. After saving the tool group, the right sidebar will display the YAML file and the associated Python file name, highlighted in red. Click the three dots next to the file name and upload the corresponding Python file.

    ๐Ÿ’ก Tip: The Python file name you upload must exactly match the name specified in the YAML dependencies section. In the YAML example below, the file name is baserow_info_products.py which means your Python file name should be the same

  5. In the upper-right corner, click Save to apply the change

Example YAMLโ€‹

Download an example of a YAML file for your tool group

To download, right-click and select Save As, then save the file with the .yaml extension.

View the YAML example
kind: Plugin
name: Product catalog # Specific to a product catalog
description: Baserow Product catalog integration

dependencies:
- submodules/baserow_info_products.py # The file with the actual logic that runs when the tool group is executed

skills:
- kind: Skill
name: InitProductDisplaySkill
description: Init brief description of product catalog.
public_available: false
session_init_call: true
implementation: baserow_info_products.get_products_display # baserow_info_products is the file name that should match the Python file name

tools:
- kind: Tool
object_name: ProductInfo
name: get_product_info
description: Get detailed information about a specific product by its ID.
parameters:
- name: product_id
description: "The ID of the product to retrieve information for."
type: str
implementation: baserow_info_products.get_product_info # baserow_info_products is the file name that should match the Python file name

โš ๏ธ Note: The implementation field must follow the filename.function_name format. Ensure the first part matches your Python file name (excluding the .py extension). The second part โ€” function_name โ€” is already defined in the YAML example.

Example Pythonโ€‹

Download an example of a Python file for your tool group

To download, right-click and select Save As, then save the file with the .py extension. Use the name specified in the YAML file.

View the Python example
import json
import os
import aiohttp
from loguru import logger

from src.utils.statemachine import StateMachine
from src.utils.configs import OverrideAgentConfig


BASEROW_API_TOKEN = os.environ.get("BASEROW_API_TOKEN", "")
BASEROW_URL = os.environ.get("BASEROW_URL", "")
BASEROW_TABLE_ID = os.environ.get("BASEROW_TABLE_ID", "")


async def _update_prompt_field_skill(products_display: str, __statemachine: StateMachine, **kwargs):
"""Skill to update a specific prompt field in particular agent for a given process and state"""

# Constants
PROCESS_NAME = "AssistanceProcess" ## This name should be the same as the process_name in the agent workflow
AGENT_NAME = "SingleStatefulOutboundAgent"
FIELD_NAME = "products_display"

# Update prompt_fields
main_process = __statemachine.processes.get(PROCESS_NAME)
if main_process is None:
logger.error(f"Process '{PROCESS_NAME}' not found in the state machine.")
return

for _, state in main_process.states.items():
if AGENT_NAME in state.agent_overrides:
state.agent_overrides[AGENT_NAME].prompt_fields[FIELD_NAME] = products_display
logger.warning(f"Agent override for {AGENT_NAME}. {main_process.name}.{state.name} / Prompt field '{FIELD_NAME}' updated.")
else:
state.agent_overrides[AGENT_NAME] = OverrideAgentConfig(prompt_fields={FIELD_NAME: products_display})
logger.warning(f"Agent override for {AGENT_NAME}. {main_process.name}.{state.name} / New prompt field '{FIELD_NAME}' set.")



async def get_products_display(**kwargs):
url = f"{BASEROW_URL}/api/database/rows/table/{BASEROW_TABLE_ID}/"
headers = {"Authorization": f"Token {BASEROW_API_TOKEN}"}

params = {
"user_field_names": "true",

}

try:
async with aiohttp.ClientSession(headers=headers) as session:
async with session.get(url, params=params) as response:
response.raise_for_status()
products = await response.json()
display = json.dumps([
{
'id': product['id'],
'Name': product['Name'],
'Brief Description': product['Brief Description'],
}
for product in products['results']
if product['Active']], ensure_ascii=False)
display_prompt = (f'# Products overview\n{display}\n'
'To get more information about a specific product, use the command: '
'`get_product_info(product_id)` where `product_id` is the id of the product you want to inquire about.'
)
await _update_prompt_field_skill(display_prompt, **kwargs)
logger.info(f"Products display updated.")
return

except Exception as e:
# msg = f"Error while fetching product ID {product_id}: {e}"
logger.exception(e)
return None

async def get_product_info(product_id: int, **kwargs):

url = f"{BASEROW_URL}/api/database/rows/table/{BASEROW_TABLE_ID}/{product_id}/"
headers = {"Authorization": f"Token {BASEROW_API_TOKEN}"}

params = {
"user_field_names": "true",

}

try:
async with aiohttp.ClientSession(headers=headers) as session:
async with session.get(url, params=params) as response:
response.raise_for_status()
product_info = await response.json()
return str(product_info)

except Exception as e:
# msg = f"Error while fetching product ID {product_id}: {e}"
logger.exception(e)
return None

if __name__ == "__main__":
import asyncio
async def main():
result = await get_products_display()
print(result)

asyncio.run(main())

โš ๏ธ PROCESS_NAME in the Python file and the process_name in the agent workflow should match. In the Python example above, it's AssistanceProcess.

โš ๏ธ Note: If you are using the above examples for multiple catalogs:

  • Use unique filenames for each YAML file.
  • Assign a unique name inside each YAML configuration.

The system will not save the tool group if duplicate names are detected.

Add the tool group to the agent workflowโ€‹

To make the product catalog available to the agent, add the {products_display} block to the agent prompt template.

  1. On the left sidebar menu, go to Agents > AI Agents
  2. Double-click the agent you want to connect the product catalog to
  3. In the Workflow section, add {products_display} to the prompt_template_override configuration โ€” typically near the task description.

There are two possible cases:

  • If the agent already has a prompt_template_override, add {products_display} to the existing prompt template in the appropriate place.

  • If the agent does not have a prompt_template_override, you must add this section to the workflow right after the available tools section.

    prompt_template_override:
    SingleStatefulOutboundAgent: |
    # Identity:
    {identity}
    # Task:
    {task}
    # Product catalog (populated dynamically by a skill):
    {products_display} โ† ## Add product display in curly brackets
    # Chat history:
    {chat_history}

Connect the tool groupโ€‹

  1. On the left sidebar menu, go to AI Agents > Agents
  2. Double click the agent you wish to connect the tool group to
  3. On the agent page, go to the Tool Groups section
  4. Click Add tool group +
  5. Select the required tool group from the list and click Apply

โš ๏ธ Remember to click Save to apply the changes. Restart the agent if it was running. To do it, click Stop agent and then Start agent.

Done! You've connected the product catalog. The agent can now recommend and sell products directly in conversations. You can also define specific selling instructions in the Task section on the agent page.