Rakri AIRAKRI AI
HomeServicesCase StudiesBlogProcessContact
Case Studies / Primastat

Natural-Language BI Platform — Turning Plain English Into Live Business Intelligence

Client
Primastat, India
Category
AI-Powered Business Intelligence / Data Platform
Duration
Ongoing engineering partnership
Status
In Progress
On this page
ContextThe problemApproachArchitectureOutcomeStack

Context

Primastat runs VizKraft, a production BI platform. Non-technical users needed to query business data without writing SQL, across four different underlying database engines.

The problem

General-purpose LLMs asked to write SQL against real schemas hallucinate columns, joins, and syntax that doesn't match the actual database — unacceptable in a product where the query runs directly against live business data.

Approach

We fine-tuned a large language model specifically on this task rather than relying on a general-purpose model with prompting alone.

  • Fine-tuned Kimi K2.5 on 5,000+ real query pairs across 12 database schemas, deliberately including multi-table joins, CTEs, and window functions.
  • Built a schema-injection pipeline (FastAPI, LangChain, SQLAlchemy) that resolves a client's live database schema at query time and injects it directly into the model's context.
  • Every generated query is syntax-highlighted, editable, and re-executable — technical users can audit and correct exactly what the AI decided to run.
  • Streamed results through Kafka across a three-service architecture (React SPA, Node.js orchestration, Python FastAPI) so charts render incrementally as query results arrive, in real time.
Fine-tuning on real schema/query pairs — not just prompting a general model — is what took hallucination from a recurring product risk to a rare, correctable edge case.

Architecture

Plain-English question→Live schema injection→Fine-tuned Kimi K2.5→Generated SQL
Generated SQL→FastAPI execution layer→Kafka event stream→Interactive chart

Outcome

70%+
Reduction in hallucinated queries vs. base model
<1.5s
Plain-English question to interactive chart
30+
Paying clients served in production

The platform is live in production with zero major AI-related incidents to date, and every generated query remains fully visible and editable by the end user.

Stack

Fine-tuned LLM (Kimi K2.5)FastAPILangChainSQLAlchemyReactNode.jsApache KafkaDockerGitHub Actions CI/CDPostgreSQLMySQLMongoDBSQLite

Metrics reported by client and Rakri AI engineering logs as of the current engagement period.

Have a similar nl-to-sql problem?

Book a free 15-minute call. No pitch deck — just an honest read on whether this is an AI problem.

See All Case Studies

Response within 24 hours. No commitment required.

Rakri AIRAKRI AI
AI systems you own, not rent.
ServicesCase StudiesBlogContactconnect@rakriai.com
© 2026 Rakri AI
Rakri Labs Private Limited
CIN: U62013BR2026PTC083979