A Database Engine that Sematially answers Natural Language Questions about CRM and automatically Parses the database Structure
C#
0
42 commits
updated Mar 4, 2026
An AI-powered natural language query engine that lets you ask questions to your database in plain English — no SQL required.
Point it at any MSSQL or MySQL database, index your tables, and start asking questions. The system builds a local semantic understanding of your data using ONNX embeddings and answers queries using Google Gemini as the reasoning layer.
"How many customers are from the UK?"
↓
Intent Classification → Count + Filter (Country: UK)
↓
Metadata Query Engine → SELECT COUNT(*) ... WHERE Country = 'UK'
↓
Result: 400 customers
↓
Gemini LLM Formatting → "There are 400 customers from the UK."
The system classifies your question into one of five strategies — Semantic Search, Filter, Count, Aggregate, or List — then executes it deterministically. No SQL is generated by the LLM. Gemini only formats the final answer into natural language.
SemanticDb.Console.exe and appsettings.json into a folderappsettings.json and set your "GeminiApiKey" (get one free)SemanticDb.Console.exe — on first launch it will prompt you to enter your database connection details (server, database name, username, password). These are saved automatically to data/connection.json and never need to be entered again.index to build the semantic indexask How many orders do we have?Prerequisites: .NET 8 SDK, MSSQL or MySQL database, Gemini API key
# Clone the repo
git clone https://github.com/Unknown-086/Semantic-Database-Engine.git
cd Semantic-Database-Engine
# Download the ONNX embedding model
.\scripts\download-models.ps1
# Set your GeminiApiKey in appsettings.json
# (Database connection details are entered interactively on first run)
# Build and run
dotnet build
cd src\SemanticDb.Console
dotnet run
dotnet publish src\SemanticDb.Console\SemanticDb.Console.csproj `
-c Release -r win-x64 --self-contained true `
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true `
-o publish-standalone
> index
Scanning tables: Categories, Customers, OrderItems, Orders, Products, SupportTickets
Indexed 6,430 documents across 6 tables.
> ask How many customers are from the UK?
There are 400 customers from the UK.
> ask What is the average order total?
The average order total is $1,256.59 across 1,500 orders.
> ask Show me completed orders from London
Found 37 orders matching criteria (Status: Completed, City: London).
> ask Tell me about quantum computing
The provided evidence does not contain any data about quantum computing.
> status
6 tables indexed, 6,430 documents, last indexed: 2/27/2026 2:14 PM
> help
Available commands: ask, index, status, test-connection, help, exit
You do not need to manually edit a connection string. When you run the exe for the first time, it walks you through entering your database details:
Database engine (mssql/mysql): mssql
Server: localhost
Database name: my_database
Username: sa
Password: ********
The connection is saved to data/connection.json automatically. On all subsequent runs, the app connects without prompting again.
The only thing you need to set manually is the Gemini API key. Everything else has sensible defaults:
| Section | Key | Description |
|---|---|---|
Reasoning.GeminiApiKey | Your API key | Google Gemini API key (required) |
Reasoning.GeminiModel | "gemini-2.5-flash" | LLM model for answer generation |
Embedding.ModelPath | "models/gte-small.onnx" | Path to ONNX embedding model |
Security.ExcludedTables | ["Admin", "Users", ...] | Tables to skip during indexing |
Security.ExcludedColumnPatterns | ["Password*", "*Token*", ...] | Column patterns to exclude |
Query.DefaultTopK | 10 | Max results per search |
Indexing.BatchSize | 100 | Rows per batch during indexing |
src/
├── SemanticDb.Core/ # Interfaces, models, shared contracts
├── SemanticDb.Console/ # CLI entry point and command loop
├── SemanticDb.Query/ # Intent classification and query orchestration
├── SemanticDb.VectorStore/ # HNSW vector index and metadata query engine
├── SemanticDb.Indexing/ # Table scanning and incremental indexing
├── SemanticDb.Semantics/ # ONNX embedding generation (gte-small)
├── SemanticDb.Reasoning/ # Gemini API integration for LLM answers
├── SemanticDb.Infrastructure.Mssql/ # MSSQL database adapter
├── SemanticDb.Infrastructure.MySql/ # MySQL database adapter
└── SemanticDb.Api/ # Web API (planned for future release)
| Component | Minimum |
|---|---|
| OS | Windows x64 |
| Database | MSSQL Server 2016+ or MySQL 8.0+ |
| LLM API | Google Gemini API key (free tier works) |
| Runtime | None (self-contained exe) or .NET 8 SDK (build from source) |
This project is licensed under the MIT License.
Abdul Hadi — @Unknown-086
C#
100.0%
A Database Engine that Sematially answers Natural Language Questions about CRM and automatically Parses the database Structure
C#
0
42 commits
updated Mar 4, 2026
An AI-powered natural language query engine that lets you ask questions to your database in plain English — no SQL required.
Point it at any MSSQL or MySQL database, index your tables, and start asking questions. The system builds a local semantic understanding of your data using ONNX embeddings and answers queries using Google Gemini as the reasoning layer.
"How many customers are from the UK?"
↓
Intent Classification → Count + Filter (Country: UK)
↓
Metadata Query Engine → SELECT COUNT(*) ... WHERE Country = 'UK'
↓
Result: 400 customers
↓
Gemini LLM Formatting → "There are 400 customers from the UK."
The system classifies your question into one of five strategies — Semantic Search, Filter, Count, Aggregate, or List — then executes it deterministically. No SQL is generated by the LLM. Gemini only formats the final answer into natural language.
SemanticDb.Console.exe and appsettings.json into a folderappsettings.json and set your "GeminiApiKey" (get one free)SemanticDb.Console.exe — on first launch it will prompt you to enter your database connection details (server, database name, username, password). These are saved automatically to data/connection.json and never need to be entered again.index to build the semantic indexask How many orders do we have?Prerequisites: .NET 8 SDK, MSSQL or MySQL database, Gemini API key
# Clone the repo
git clone https://github.com/Unknown-086/Semantic-Database-Engine.git
cd Semantic-Database-Engine
# Download the ONNX embedding model
.\scripts\download-models.ps1
# Set your GeminiApiKey in appsettings.json
# (Database connection details are entered interactively on first run)
# Build and run
dotnet build
cd src\SemanticDb.Console
dotnet run
dotnet publish src\SemanticDb.Console\SemanticDb.Console.csproj `
-c Release -r win-x64 --self-contained true `
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true `
-o publish-standalone
> index
Scanning tables: Categories, Customers, OrderItems, Orders, Products, SupportTickets
Indexed 6,430 documents across 6 tables.
> ask How many customers are from the UK?
There are 400 customers from the UK.
> ask What is the average order total?
The average order total is $1,256.59 across 1,500 orders.
> ask Show me completed orders from London
Found 37 orders matching criteria (Status: Completed, City: London).
> ask Tell me about quantum computing
The provided evidence does not contain any data about quantum computing.
> status
6 tables indexed, 6,430 documents, last indexed: 2/27/2026 2:14 PM
> help
Available commands: ask, index, status, test-connection, help, exit
You do not need to manually edit a connection string. When you run the exe for the first time, it walks you through entering your database details:
Database engine (mssql/mysql): mssql
Server: localhost
Database name: my_database
Username: sa
Password: ********
The connection is saved to data/connection.json automatically. On all subsequent runs, the app connects without prompting again.
The only thing you need to set manually is the Gemini API key. Everything else has sensible defaults:
| Section | Key | Description |
|---|---|---|
Reasoning.GeminiApiKey | Your API key | Google Gemini API key (required) |
Reasoning.GeminiModel | "gemini-2.5-flash" | LLM model for answer generation |
Embedding.ModelPath | "models/gte-small.onnx" | Path to ONNX embedding model |
Security.ExcludedTables | ["Admin", "Users", ...] | Tables to skip during indexing |
Security.ExcludedColumnPatterns | ["Password*", "*Token*", ...] | Column patterns to exclude |
Query.DefaultTopK | 10 | Max results per search |
Indexing.BatchSize | 100 | Rows per batch during indexing |
src/
├── SemanticDb.Core/ # Interfaces, models, shared contracts
├── SemanticDb.Console/ # CLI entry point and command loop
├── SemanticDb.Query/ # Intent classification and query orchestration
├── SemanticDb.VectorStore/ # HNSW vector index and metadata query engine
├── SemanticDb.Indexing/ # Table scanning and incremental indexing
├── SemanticDb.Semantics/ # ONNX embedding generation (gte-small)
├── SemanticDb.Reasoning/ # Gemini API integration for LLM answers
├── SemanticDb.Infrastructure.Mssql/ # MSSQL database adapter
├── SemanticDb.Infrastructure.MySql/ # MySQL database adapter
└── SemanticDb.Api/ # Web API (planned for future release)
| Component | Minimum |
|---|---|
| OS | Windows x64 |
| Database | MSSQL Server 2016+ or MySQL 8.0+ |
| LLM API | Google Gemini API key (free tier works) |
| Runtime | None (self-contained exe) or .NET 8 SDK (build from source) |
This project is licensed under the MIT License.
Abdul Hadi — @Unknown-086
C#
100.0%