What it does

A web app that transforms business data into actionable insights using Gemini & TiDB vectors. It helps small businesses to make data-driven decisions and provides actionable insights through natural language queries, indepth analysis and intelligent forecasting via Generative UI.

How we built it

The app integrates with Google's Gemini 2.5 Pro, 2.5-flash, 2.5-flash-lite and Gemini embedding model, via Vercel AI SDK for AI server actions. The data ingestion system parses CSV files and uses Gemini to intelligently slice business data into meaningful contextual segments. Each segment is embedded and stored with metadata inferred from the data slices, creating a rich knowledge base.

I used TiDB Cloud for vector storage. Business data is processed into 1536-dimensional embeddings using Gemini's embedding model. Vector similarity search uses cosine distance calculations for contextually relevant information retrieval. The app provides users with suggested user queries to streamline data insights processes. Gemini analyses queries and generates contextually appropriate JSX components on-the-fly. The AI considers query semantics, data types, and visualisation requirements to create custom interfaces. All AI actions are server-side cached for improved performance during subsequent app use

Features

  • - Generative UI System - Dynamic interface components generated in real-time by AI based on query context
  • Voice-Powered Analytics - Hands-free business intelligence querying via Web Speech API
  • Intelligent Forecasting - Revenue predictions with confidence metrics and trend analysis
  • Advanced Inventory Management - Real-time stock alerts with predictive analytics and reorder recommendations
  • Natural Language Querying - Plain English questions about business data with semantic search
  • Comprehensive Dashboards - Interactive visualisations with chart exports and PDF report generation
  • Smart Data Processing - CSV parsing with intelligent data categorisation and embedding generation
  • Business Intelligence Suite - Revenue breakdown, customer acquisition metrics, and profit margin analysis
  • Performance Features - Server-side caching with vector database optimisation
  • Dark Mode Support - Comprehensive theming across all components
  • Responsive Design - Mobile and desktop optimised layouts
  • Real-time Speech-to-Text - Natural voice interactions with the platform
  • Context-Aware UI Adaptation - Layouts optimised for specific data visualisation needs
  • Seasonal Pattern Recognition - Anomaly detection and strategic planning insights
  • Priority-Based Recommendations - Strategic advice with timeframes and impact analysis
  • Semantic Filtering to capture user intent: count & timeframe of data

Challenges we ran into

  • How to index business data for processing
  • How to effectively present data for the UI
  • Navigating Prisma's lack of vector type unsupport which led to lots of hours of debugging. "Raw query failed. Code: 1105. Message: `cannot convert datum from vector to type double" this persistent issue almost derailed my project completion & submission. Ultimately, I realised Prisma wasn't handlig the unsupported types well and had to use raw SQL, in the TiDB console
  • Ensuring the LLM generates UI per the existing app design system
  • Gemini models being overloaded

Accomplishments that we're proud of

  • Using Prisma to enable vector storage & search implementation in TiDB despite the underlying friction, per the lack of native support of the Vector type in Prisma
  • Enabling Generative UI & intutive components, and charts.

What we learned

  • How to work with unsupported column types in Prisma
  • Augmenting Prisma's lack of native support for vectors with raw SQL queries (in Prisma)
  • Implementing True Generative UI: Generating UI components from scratch by an LLM (Gemini 2.5 flash) per specific data and context

What's next for Probable

  • Send Forecast report via Email

TiDB Cloud Account

** tijanimuhammed84@gmail.com**

Built With

Share this project:

Updates