← Back to Console Docs

AI Assistant

Query your pricing data using natural language with AI-powered insights

Overview

The AI Assistant allows you to ask questions about your pricing data in plain English. It converts your queries into SQL, retrieves the data, and provides natural language answers with context and follow-up suggestions.

Access: Navigate to Assistant in the project sidebar, or visit /p/[your-project]/assistant

How It Works

1

You ask a question

Type your question in natural language, like "What are my most expensive products?" or "Show me all SKUs with prices over $100"

2

AI processes your query

The AI understands your intent and converts it into a SQL query against your pricing database

3

Data is retrieved

The generated SQL query runs against your database to fetch the relevant data

4

AI generates answer

Results are formatted into a natural language answer with tables, charts, or summaries

Example Queries

Product Discovery

  • What are my top 10 most expensive products?
  • Show me all products with prices under $20
  • List SKUs that haven't changed price in 30 days
  • Which products have the most variants?

Price Analysis

  • What's the average price of my catalog?
  • Show me products with prices above $100
  • Which SKUs have the highest profit margins?
  • What's the price range for my summer collection?

Price Changes

  • Why was SKU-123 price changed?
  • Show me all pending price changes
  • What price changes were applied today?
  • Which products have the most price change history?

Trends & Insights

  • What's my average price increase this month?
  • Show me products with frequent price changes
  • Which categories have the most pricing activity?
  • What's the pricing trend for product XYZ?

Understanding Responses

Each AI Assistant response includes several components:

Natural Language Answer

Human-readable summary of the results

EXAMPLE:
You have 15 products priced over $100, with an average price of $149.99

Data Results

Structured data table or chart showing the query results

EXAMPLE:
Table with columns: Product, SKU, Price, Currency

Generated SQL Query

The actual SQL that was executed (for transparency)

EXAMPLE:
SELECT * FROM products WHERE price > 10000 ORDER BY price DESC LIMIT 10

Follow-up Suggestions

Related questions you can ask to dive deeper

EXAMPLE:
'Show me price history for these products' or 'What's the average discount?'

Suggested Questions

When you first open the AI Assistant, you'll see suggested questions to get started. These are curated queries that demonstrate the assistant's capabilities:

  • "What are my most expensive products?"
  • "Show me all pending price changes"
  • "Why was this price changed?"
  • "What's my average product price?"

💡 Tip: Click on any suggested question to see how the AI responds, then modify it for your specific needs.

Conversation History

The AI Assistant maintains a conversation history during your session:

  • Context Aware: Ask follow-up questions that reference previous queries
  • Scroll Through History: Review past questions and answers
  • Session-Based: History clears when you leave the page
  • Refinement: Iteratively refine queries based on results

Types of Queries

🤖

AI-Powered Queries

Complex natural language questions that require AI understanding

Examples:
  • Why did prices increase?
  • What's the impact of my summer sale?
  • Recommend price adjustments
📋

Pattern-Based Queries

Simple lookups that match common patterns

Examples:
  • Show product ABC
  • List all SKUs
  • Get price for XYZ

Note: Pattern-based queries are faster but less flexible. AI-powered queries can understand more complex requests and context.

Best Practices

Be Specific
Include details like SKU codes, price ranges, or time periods for better results.
Start Simple
Begin with straightforward questions, then refine based on the results.
Use Follow-ups
Click on suggested follow-up questions to explore related data.
Review the SQL
Check the generated SQL query to understand what data was retrieved.
Iterate
If the first answer isn't quite right, rephrase your question or ask for clarification.

Current Limitations

  • ⚠️
    Read-Only: The assistant can query data but cannot create price changes or modify settings
  • ⚠️
    Session History: Conversation history doesn't persist across sessions
  • ⚠️
    Data Scope: Can only access data for the current project
  • ⚠️
    Real-time Only: Responses are based on current database state

API Reference

The AI Assistant API allows you to submit natural language queries programmatically and receive structured responses. All endpoints require authentication via Bearer token.

POST /api/v1/assistant/query

Submit a natural language query to the AI Assistant

REQUEST BODY:
{
  "query": "What are my most expensive products?",
  "projectSlug": "demo"
}
RESPONSE:
{
  "answer": "Your top 3 most expensive products are...",
  "data": [
    {
      "productCode": "PROD-001",
      "name": "Premium Widget",
      "price": 19999  // in cents ($199.99)
    }
  ],
  "sql": "SELECT * FROM products ORDER BY price DESC LIMIT 10",
  "suggestions": [
    "Show me price history for these products",
    "What's the average price across all products?"
  ]
}

Usage Notes

  • Queries should be natural language questions about your pricing data
  • Responses include the natural language answer, structured data, and generated SQL
  • The API is read-only and cannot modify data or create price changes
  • Rate limits apply: 20 queries per minute per user

Related Documentation