Welcome to Metriql Documentation

Learn how to transform natural language into powerful SQL queries and actionable insights.

What is Metriql?

Metriql is an AI-powered analytics platform that allows you to query your databases using plain English. No SQL knowledge required—just ask your questions naturally and get instant results with beautiful visualizations.

Quick Start

1

Create an Account

Sign up for a free account at Metriql. No credit card required for the trial period.

2

Connect Your Database

Connect your PostgreSQL, MySQL, MongoDB, or other supported databases. We support both cloud and self-hosted databases.

# Example connection string
postgresql://user:password@host:5432/database
3

Start Querying

Type your questions in plain English and get instant SQL queries with results.

Example query:
"Show me the top 10 customers by revenue this year"

Installation

Web Application

The easiest way to use Metriql is through our web application. No installation required!

Access Web App

CLI Tool

# Install via npm
npm install -g @metriql/cli
# Or via yarn
yarn global add @metriql/cli

API Access

Integrate Metriql into your applications using our REST API or official SDKs.

JavaScript/TypeScript
npm install @metriql/sdk
Python
pip install metriql-sdk

How It Works

Metriql uses advanced AI models to understand your natural language queries and convert them into optimized SQL queries.

1. Natural Language Input

You type your question in plain English, just like you would ask a colleague.

2. AI Processing

Our AI analyzes your query, understands the intent, and generates optimized SQL.

3. Results & Visualization

Get instant results with automatic chart generation and insights.

Natural Language Processing

Metriql's NLP engine understands various ways of asking questions. Here are some examples:

✓ Time-based queries
"Show me sales from last month"
"What was our revenue in Q2 2024?"
✓ Aggregations
"Calculate the average order value"
"Sum up total revenue by category"
✓ Comparisons
"Compare this month's sales with last month"
"Show year-over-year growth"
✓ Filtering
"Find customers who spent more than $1000"
"Show products with low inventory"

SQL Generation

Every natural language query is converted to SQL. You can always view and edit the generated SQL.

Query: "Show me top 5 products by revenue"
SELECT
product_name,
SUM(order_value) as total_revenue
FROM
orders
GROUP BY
product_name
ORDER BY
total_revenue DESC
LIMIT
5;

Connecting Databases

Metriql supports connecting to multiple databases simultaneously. Follow these steps:

  1. 1
    Navigate to Data Sources
    Go to Settings → Data Sources in your dashboard
  2. 2
    Choose Your Database Type
    Select from PostgreSQL, MySQL, MongoDB, and more
  3. 3
    Enter Connection Details
    Provide host, port, database name, and credentials
  4. 4
    Test & Save
    Test the connection before saving

Security Note

All connection credentials are encrypted at rest and in transit. We use industry-standard security practices to protect your data.

Supported Databases

PostgreSQL

Full support for PostgreSQL 10+ including advanced features like JSONB and CTEs.

✓ Fully supported

MySQL

Support for MySQL 5.7+ and MariaDB with all standard SQL features.

✓ Fully supported

MongoDB

Query MongoDB collections using natural language, automatically converted to aggregation pipelines.

✓ Fully supported

Snowflake

Connect to your Snowflake data warehouse for large-scale analytics.

✓ Fully supported

BigQuery

Google BigQuery integration for petabyte-scale data analysis.

✓ Fully supported

Redshift

Amazon Redshift support for cloud data warehousing.

✓ Fully supported

Writing Natural Queries

The key to getting great results is writing clear, specific queries. Here are some tips:

Be Specific

"Show me revenue by product category for Q1 2024"
Specific time period and grouping
"Show me revenue"
Too vague, missing context

Use Natural Time References

• "last week", "this month", "Q1 2024"
• "last 30 days", "year to date"
• "between January and March"

Include Sorting and Limits

• "top 10 customers by revenue"
• "lowest performing products"
• "sorted by date descending"

Query Examples

Revenue Analysis
"What is our total revenue by month for the last 6 months?"
Returns monthly revenue aggregated over the past 6 months with automatic time-series visualization
Customer Segmentation
"Show me customer distribution by country and their average order value"
Groups customers by country with calculated average order value, suitable for geographic visualization
Inventory Management
"Which products have less than 10 items in stock?"
Filters products with low inventory, useful for restocking alerts
Performance Comparison
"Compare sales this quarter vs last quarter by region"
Creates a comparison view with quarter-over-quarter growth metrics

Need Help?

Can't find what you're looking for? Our team is here to help!