<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: spancer</title>
    <description>The latest articles on DEV Community by spancer (@spancer).</description>
    <link>https://dev.to/spancer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3608901%2Fb47e27a5-17a7-4221-92dd-f6703ebf2d5b.png</url>
      <title>DEV Community: spancer</title>
      <link>https://dev.to/spancer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/spancer"/>
    <language>en</language>
    <item>
      <title>Why Coomia DataGPT Needs “Diverse Thinking”</title>
      <dc:creator>spancer</dc:creator>
      <pubDate>Thu, 13 Nov 2025 08:04:08 +0000</pubDate>
      <link>https://dev.to/spancer/why-coomia-datagpt-needs-diverse-thinking-21d5</link>
      <guid>https://dev.to/spancer/why-coomia-datagpt-needs-diverse-thinking-21d5</guid>
      <description>&lt;p&gt;In the world of data analytics, something ironic is happening:&lt;br&gt;
AI systems are getting smarter — yet their answers sound more and more alike.&lt;/p&gt;

&lt;p&gt;Ask any model “Which products generate the most revenue?”,&lt;br&gt;
and you’ll likely get nearly identical responses — same tone, same logic, same conclusion.&lt;br&gt;
This is known as mode collapse — when a model learns to be safe and agreeable, but stops exploring new possibilities.&lt;/p&gt;

&lt;p&gt;🧠 What We Learned from “Verbalized Sampling”&lt;/p&gt;

&lt;p&gt;A recent paper — Verbalized Sampling: How to Mitigate Mode Collapse and Unlock LLM Diversity — offered a fascinating idea:&lt;/p&gt;

&lt;p&gt;The loss of diversity doesn’t come from the model itself, but from the data we use to train it.&lt;br&gt;
Human annotators often prefer “typical” answers — so the model learns to please, not to think.&lt;/p&gt;

&lt;p&gt;The authors proposed a simple but powerful idea:&lt;br&gt;
Before producing an answer, let the model verbalize several candidate options, then choose among them.&lt;br&gt;
This verbalized sampling process reintroduces reasoning, comparison, and variation — leading to richer, more diverse outputs.&lt;/p&gt;

&lt;p&gt;⚙️ How DataGPT Applies This Idea&lt;/p&gt;

&lt;p&gt;In Coomia DataGPT, we follow a similar principle.&lt;br&gt;
When you ask:&lt;/p&gt;

&lt;p&gt;“Which customer segments have the highest retention?”&lt;/p&gt;

&lt;p&gt;Instead of generating one SQL query, DataGPT:&lt;/p&gt;

&lt;p&gt;Thinks through multiple possible query paths (by region, age group, or acquisition channel);&lt;/p&gt;

&lt;p&gt;Evaluates which ones produce statistically significant insights;&lt;/p&gt;

&lt;p&gt;Chooses the most meaningful results and presents them with explanations.&lt;/p&gt;

&lt;p&gt;You don’t just get an answer —&lt;br&gt;
you get an answer that feels like it was reasoned out by an analyst team.&lt;/p&gt;

&lt;p&gt;🚀 Why It Matters&lt;/p&gt;

&lt;p&gt;Data analytics is not about finding one answer.&lt;br&gt;
It’s about discovering patterns, anomalies, and perspectives.&lt;/p&gt;

&lt;p&gt;An AI data copilot must not only understand SQL,&lt;br&gt;
but also think like a curious human — exploring multiple viewpoints before concluding.&lt;/p&gt;

&lt;p&gt;That’s what inspired us to make Coomia DataGPT a system that truly thinks before it answers.&lt;/p&gt;

&lt;p&gt;🌐 What’s Next&lt;/p&gt;

&lt;p&gt;We’re extending this multi-path thinking approach to:&lt;/p&gt;

&lt;p&gt;Automated data governance and quality analysis&lt;/p&gt;

&lt;p&gt;Richer integrations (Trino, Doris, ClickHouse, BigQuery)&lt;/p&gt;

&lt;p&gt;Advanced visualizations and data storytelling&lt;/p&gt;

&lt;p&gt;Coomia DataGPT isn’t here to replace analysts —&lt;br&gt;
it’s here to be their AI Data Copilot — private, fast, and insightful.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How We Built Coomia DataGPT — An AI Copilot for Data Analysis</title>
      <dc:creator>spancer</dc:creator>
      <pubDate>Thu, 13 Nov 2025 01:00:09 +0000</pubDate>
      <link>https://dev.to/spancer/how-we-built-coomia-datagpt-an-ai-copilot-for-data-analysis-1k6k</link>
      <guid>https://dev.to/spancer/how-we-built-coomia-datagpt-an-ai-copilot-for-data-analysis-1k6k</guid>
      <description>&lt;h2&gt;
  
  
  🚀 Introduction
&lt;/h2&gt;

&lt;p&gt;Every data-driven team faces the same challenge:&lt;br&gt;
You have rich data stored in PostgreSQL, MySQL, Trino, or Doris — but turning that data into insight still requires SQL expertise, dashboards, and manual query tuning.&lt;/p&gt;

&lt;p&gt;We built Coomia DataGPT to change that.&lt;/p&gt;

&lt;p&gt;It’s a self-hosted AI copilot that connects directly to your databases, understands questions in plain English, writes SQL automatically, and visualizes the results instantly.&lt;/p&gt;

&lt;p&gt;In this post, I’ll share how it works under the hood, the tech stack behind it, and what we learned while building it.&lt;/p&gt;
&lt;h2&gt;
  
  
  🧩 Architecture Overview
&lt;/h2&gt;

&lt;p&gt;At a high level, Coomia DataGPT has three main components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
+------------------+      +---------------------+      +-------------------+
|  Frontend (React)| ---&amp;gt; |  FastAPI Backend    | ---&amp;gt; |  Database Engines |
|  Chat Interface  |      |  Query + AI Engine  |      | (PostgreSQL, etc.)|
+------------------+      +---------------------+      +-------------------+
                                |
                                v
                        +------------------+
                        | Visualization UI |
                        +------------------+


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Frontend – Built with React + TypeScript, it provides a chat-like interface where users ask questions in natural language.&lt;/p&gt;

&lt;p&gt;Backend (FastAPI) – Handles user requests, interacts with the LLM, and manages SQL execution.&lt;/p&gt;

&lt;p&gt;Database Layer – Connects to PostgreSQL, MySQL, Trino, and Doris using SQLAlchemy adapters.&lt;/p&gt;

&lt;p&gt;Visualization – Uses auto-generated Vega-Lite specs and a lightweight chart renderer for instant charts.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 How It Works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Natural Language Understanding&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When a user asks something like:&lt;/p&gt;

&lt;p&gt;“Which film categories generated the highest total revenue?”&lt;/p&gt;

&lt;p&gt;Coomia DataGPT sends the prompt to an LLM (OpenAI, or a local model if configured).&lt;br&gt;
The LLM translates the request into a structured intent that includes:&lt;/p&gt;

&lt;p&gt;SQL table(s) and fields involved&lt;/p&gt;

&lt;p&gt;Filters and aggregation&lt;/p&gt;

&lt;p&gt;Output type (chart, table, metric)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SQL Generation
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
The AI module generates SQL code dynamically based on schema introspection:

SELECT c.name AS category,
       SUM(p.amount) AS total_revenue
FROM category c
JOIN film_category fc ON fc.category_id = c.category_id
JOIN inventory i ON i.film_id = fc.film_id
JOIN rental r ON r.inventory_id = i.inventory_id
JOIN payment p ON p.rental_id = r.rental_id
GROUP BY c.name
ORDER BY total_revenue DESC;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Execution &amp;amp; Visualization&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The SQL is executed asynchronously via SQLAlchemy or direct drivers (Trino client, Doris connector).&lt;br&gt;
Results are transformed into a unified dataframe and visualized via auto-chart inference:&lt;/p&gt;

&lt;p&gt;If numeric + categorical → bar chart&lt;/p&gt;

&lt;p&gt;If timestamp + value → line chart&lt;/p&gt;

&lt;p&gt;If aggregated → pie or summary card&lt;/p&gt;

&lt;p&gt;Charts are rendered instantly on the frontend using React + Plotly.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧰 Tech Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;td&gt;React, TypeScript, TailwindCSS&lt;/td&gt;
&lt;td&gt;Modern, responsive UI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend&lt;/td&gt;
&lt;td&gt;FastAPI, Python&lt;/td&gt;
&lt;td&gt;Async API + orchestration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI Engine&lt;/td&gt;
&lt;td&gt;OpenAI API / Local LLM (via Agno)&lt;/td&gt;
&lt;td&gt;NL→SQL translation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DB Integration&lt;/td&gt;
&lt;td&gt;SQLAlchemy, Trino-Python, Doris client&lt;/td&gt;
&lt;td&gt;Multi-database connectivity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visualization&lt;/td&gt;
&lt;td&gt;Vega-Lite, Plotly&lt;/td&gt;
&lt;td&gt;Auto-generated charts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Caching&lt;/td&gt;
&lt;td&gt;Redis&lt;/td&gt;
&lt;td&gt;Query and embedding cache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Docker + Docker Compose&lt;/td&gt;
&lt;td&gt;Easy self-hosting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logging&lt;/td&gt;
&lt;td&gt;Loguru&lt;/td&gt;
&lt;td&gt;Structured logging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;JWT / OAuth2&lt;/td&gt;
&lt;td&gt;Secure API access&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  🔒 Why Self-Hosted?
&lt;/h2&gt;

&lt;p&gt;Most AI analytics tools require sending your data to external servers.&lt;br&gt;
We wanted something private, secure, and controllable.&lt;/p&gt;

&lt;p&gt;That’s why Coomia DataGPT runs entirely inside your infrastructure —&lt;br&gt;
no third-party storage, no external API calls unless you choose to use OpenAI.&lt;br&gt;
It’s ideal for organizations with strict data governance needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 Challenges We Solved
&lt;/h2&gt;

&lt;p&gt;Schema adaptation across different SQL dialects&lt;/p&gt;

&lt;p&gt;Ensuring SQL generation stays safe (no destructive queries)&lt;/p&gt;

&lt;p&gt;Managing context between LLM and schema metadata&lt;/p&gt;

&lt;p&gt;Reducing latency with caching and async database execution&lt;/p&gt;

&lt;h2&gt;
  
  
  🧭 Roadmap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Automated Data Governance – built-in data quality checks, lineage tracking, and schema evolution monitoring to keep your analytics trustworthy and compliant.&lt;/li&gt;
&lt;li&gt; More Data Source Integrations – expand beyond PostgreSQL, MySQL, Trino, and Doris to include ClickHouse, DuckDB, BigQuery, and Snowflake.&lt;/li&gt;
&lt;li&gt; Advanced Visualization Library – support for multi-dimensional charts, correlation plots, interactive dashboards, and AI-generated data stories.&lt;/li&gt;
&lt;li&gt; Multi-user Collaboration – shared workspaces, team permissions, and saved query history.&lt;/li&gt;
&lt;li&gt; Domain-Specific AI Models – fine-tuned LLMs for finance, e-commerce, and SaaS analytics.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  💬 Try It Yourself
&lt;/h2&gt;

&lt;p&gt;You can explore Coomia DataGPT here:&lt;br&gt;
👉 &lt;a href="https://coomia.com/docs.html" rel="noopener noreferrer"&gt;https://coomia.com/docs.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Demo video: 🎥 &lt;a href="https://youtu.be/8opQUD109mY" rel="noopener noreferrer"&gt;https://youtu.be/8opQUD109mY&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’d love your feedback on:&lt;/p&gt;

&lt;p&gt;SQL generation accuracy&lt;/p&gt;

&lt;p&gt;Trino and Doris performance&lt;/p&gt;

&lt;p&gt;Chart recommendations and UX&lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;Coomia DataGPT is our attempt to make data interaction more human —&lt;br&gt;
to let anyone, regardless of technical skill, explore data just by asking questions.&lt;/p&gt;

&lt;p&gt;It’s still early, but it’s already helping teams move faster, stay private, and work smarter.&lt;/p&gt;

&lt;p&gt;Your AI Data Copilot — Private. Fast. Smart.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
