📣 It’s Here: TiDB Spring Launch Event – April 23. Unveiling the Future of AI & SaaS Infrastructure!Register Now

TOPRISM, established in 2015, is a leading provider of location-based intelligent software solutions. The company leverages location data and AI technology to help businesses make better decisions across their operations. Their solutions support various aspects of business digitalization, from channel management to logistics optimization, serving industry leaders in FMCG, liquor, electronics, fashion retail, chain stores, tobacco, and automotive sectors.

The Challenge: Overcoming Operational Bottlenecks While Safeguarding Merchant Data

As TOPRISM’s business grew and diversified, they encountered an increasing challenge in handling data queries from their merchant customers. These merchants regularly needed specific insights from TOPRISM’s vast location-intelligence database, but accessing this information wasn’t always straightforward.

The core challenge was that merchants frequently had ad-hoc questions about market information. For instance, they might need to know the distribution of certain chain stores in a specific city or check if particular restaurants were tagged with special recognition in the database. While these questions were simple in nature, answering them created several operational challenges.

Most merchants lacked the technical expertise to write SQL queries, meaning they couldn’t independently access the data they needed. This led to a constant stream of requests to TOPRISM’s technical team who had to manually process these queries. The situation created a bottleneck in operations and wasn’t scalable as the customer base grew.

Additionally, as a data-driven company, TOPRISM needed to ensure any solution would maintain strict data security standards. Direct database access wasn’t an option – they needed a secure, API-based approach that would protect their data while serving their customers’ needs.

The Solution: Embracing TiDB Cloud Chat2Query

After evaluating various options, TOPRISM chose TiDB Cloud Chat2Query based on several key factors. Security was paramount – the solution’s API-first approach aligned perfectly with their requirements, allowing controlled data access through secure HTTPS endpoints rather than direct database exposure.

The solution’s technical capabilities were proven by its performance in industry benchmarks, scoring 86.30 on the Spider benchmark and ranking in the top 4 on the BIRD benchmark. Its implementation of Chain of Thought (COT) and Retrieval Augmented Generation (RAG) technologies ensured accurate processing of complex merchant queries.

From an operational perspective, the choice was equally compelling. As TOPRISM was already using TiDB, the Chat2Query API integrated seamlessly with their existing architecture. The serverless nature eliminated infrastructure management needs, while the pay-as-you-go model and comprehensive feature set – including visualization capabilities and multi-agent query optimization – made it a cost-effective solution requiring minimal development effort.

TOPRISM’s New Streamlined Architecture

TOPRISM implemented TiDB Cloud’s Chat2Query service through a streamlined architecture that improved how merchants access market intelligence. Here’s a detailed look at the implementation and how it works:

TOPRISM - Architecture
  1. Web Interface: A user-friendly frontend where merchants can input queries in natural language.
  2. Data Processing Layer:
    • Integration with PowerJob pipeline scheduling
    • ETL task management for data processing
    • DataX for data synchronization
    • Comprehensive data center applications for report queries
  3. Database Layer:
    • TiDB Cloud as the core database
    • Integration with existing PostgreSQL databases
    • Secure API endpoints for data access

The implementation of TiDB Cloud’s Chat2Query now allows merchants to:

  • Ask questions in plain language
  • Receive instant, accurate responses
  • Access visualized results
  • Maintain data security through controlled API access

💡How TiDB Cloud’sChat2Query Works in Practice

Let’s take a real example of how TOPRISM’s merchants use the system:

When a merchant asks “Show me all premium restaurants within 1km of shopping malls in Shanghai’s Pudong district,” the following process occurs:

  1. Context Enrichment
    • Chat2Query analyzes TOPRISM’s database schema, understanding relationships between location data, restaurant categories, and mall information
    • The system then leverages vector databases to enrich context about geographical relationships and business classifications
  2. Query Processing
    • The natural language query is transformed into SQL using Chain of Thought (COT) reasoning
    • The system breaks down the complex query into components:
      • Identifying premium restaurants
      • Calculating distances from malls
      • Filtering for Pudong district
      • Applying the 1km radius constraint
  3. Accuracy Enhancement
    • Multi-agent collaboration mechanism validates the generated SQL
    • Post-processing refinement improves query accuracy by 2-4%
    • RAG (Retrieval Augmented Generation) technology ensures accurate geographical context
  4. Result Delivery
    • Data is retrieved through secure API endpoints
    • Results are presented with intuitive visualizations
    • Interactive maps show spatial distribution of results

The Results: A Self-Service System with Top-Notch User Experience

The implementation has added another dot of color to how TOPRISM’s users access data insights. Adhoc query response times have reduced significantly, from 20 mins to seconds, as most users can now self-serve their data needs without technical support.

This has had a ripple effect on TOPRISM’s operations. Technical staff previously handling routine queries can now focus on more complex tasks. End user satisfaction has also improved due to faster access to insights in any case, and data utilization has increased across different business scenarios.

Through this implementation, TOPRISM has transformed their merchant adhoc data service from a manual, time-consuming process into an efficient, self-service system that maintains high security standards while delivering superior user experience.

Spin up a Serverless database with 25GiB free resources.

Start Right Away