Explore & Integrate

Your APIs are live! Now explore your data through a conversational interface that uses your deployed query programs to answer questions with visualizations.
The Explore section provides a chatbot-like interface that understands your data and automatically creates charts and tables based on your questions.

Interactive Data Explorer

The Explore section lets you ask natural language questions about your data and see instant visualizations.

Access the Explore Interface

1

Open the Explore Interface

Start exploring your data:
  1. Look for the “Explore” section in the left sidebar
  2. Click the ”+” button next to “Explore”
  3. A chatbot-like interface opens with “Explore your data” prompt
Chat interface for exploring data

Explore interface ready for natural language questions

2

Ask Your First Question

Let’s see your stock market data visualized:
  1. Type in the chat interface: “What’s the average closing price for each stock?”
  2. Press Enter or click send
  3. The system uses your deployed query programs to fetch and visualize the data
Stock data displayed as charts and tables

Natural language query returns interactive visualizations

What you’ll see:
  • Charts: Bar charts, line graphs, or pie charts based on your data
  • Tables: Detailed tabular view of the results
  • Interactive Elements: Click, hover, and filter capabilities
  • Export Options: Download data or visualizations
3

Understanding the Visualizations

The Explorer automatically chooses the best visualization for your data:

Bar Charts

For comparing categories like stock tickers, sectors, or price ranges

Line Charts

For trends over time like daily prices or volume changes

Tables

For detailed data with multiple metrics per row

Pie Charts

For showing proportions like market cap distribution
Each visualization is interactive:
  • Click to filter or drill down
  • Hover to see detailed tooltips
  • Export data as CSV or image
  • Resize or fullscreen view
4

Advanced Explorer Features

The Explorer offers powerful capabilities beyond basic questions:
After getting results, refine your analysis:
Initial: "What's the average closing price for each stock?"
Follow-up: "Show only the top 5"
Follow-up: "Add trading volume to this view"
Follow-up: "Group by market cap size"

How the Explore Interface Works

The Explore interface uses your deployed query programs as its knowledge base. When you ask a question, it:
  1. Understands your natural language query
  2. Selects the appropriate deployed query program(s)
  3. Fetches the data using your APIs
  4. Automatically creates the best visualization
  5. Displays interactive results

Integration with Your Applications

Now that you’ve seen the full capabilities, here are common integration patterns:

Dashboard Integration

import { useState, useEffect } from 'react';

function StockDashboard() {
  const [stockData, setStockData] = useState([]);
  
  useEffect(() => {
    fetch('https://api.infactory.ai/v1/run/[PROJECT-ID]/chat/completions', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        messages: [{ 
          role: 'user', 
          content: 'What are the top performers by price change percentage?' 
        }],
        model: 'infactory-v1'
      })
    })
    .then(res => res.json())
    .then(data => setStockData(data.choices[0].message.content));
  }, []);
  
  return (
    <div>
      <h1>Stock Performance Dashboard</h1>
      {/* Render your stock data */}
    </div>
  );
}

Chatbot Integration

from slack_bolt import App
import requests

app = App(token="YOUR_SLACK_BOT_TOKEN")

@app.message()
def handle_message(message, say):
    # Query Infactory API
    response = requests.post(
        "https://api.infactory.ai/v1/run/[PROJECT-ID]/chat/completions",
        headers={
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json"
        },
        json={
            "messages": [{"role": "user", "content": message['text']}],
            "model": "infactory-v1"
        }
    )
    
    result = response.json()
    say(result['choices'][0]['message']['content'])

Best Practices

Cache Responses

Store frequently requested data to reduce API calls

Handle Errors

Implement proper error handling and fallbacks

Rate Limiting

Respect API limits and implement backoff strategies

Monitor Usage

Track API usage through the logs dashboard

Next Steps

Congratulations! You’ve completed the quickstart and have:
  • ✅ Connected your data source
  • ✅ Built intelligent queries
  • ✅ Deployed production APIs
  • ✅ Explored interactive visualizations
Here’s what you can do next:
You Did It! 🎉 In just 10 minutes, you’ve gone from raw data to production APIs with visualization. Welcome to the Infactory community!