100% Local-First

Knowledge is everywhere
so is in your business'
SQL scripts

SlothQuery transforms SQL queries, schema constraints, and business logic rules into a searchable knowledge base. Designed for analysts and anyone in the organization who wants to understand and write their business-specific SQL with accuracy and speed.

$ pip install slothquery
Copy
PyPI Package Live package active on PyPI
<> Explore Codebase on Github
The knowledge loop

A better path from scattered SQL to confident answers.

Every step stays reviewable, local, and connected to the context your organization actually owns.

01

Capture

Bring in queries, schemas, playbooks, notes, and vault metadata.

02

Shape

Extract useful context, then let a human edit and approve what matters.

03

Retrieve

Ask chat for grounded explanations and dialect-aware SQL from your knowledge.

Analytical Integrity.
Zero database leaks.

Everything runs locally on your workstation. No external API feeds can view your private schema structures.

01

Context Pruning

Automatically maps and restricts schema feeds to only include definitions related to the user's specific request. Keep prompts tidy.

02

Dialect Validation

Syntactic verification checks run in the background using SQLGlot, helping generated logic fit the selected warehouse dialect and naming conventions.

03

Instant Re-indexing

Editing query context or playbooks triggers real-time ChromaDB updates. Human revisions take top-rank retrieval priority instantly.

04

Portable User Data

Application logic separates cleanly from user data. Database and vectors reside inside your home directory. Updates won't affect files.

A closer look

Everything your SQL
team needs to remember.

Move through the product surfaces. The story and the interface change together.

01 05 surfaces

Start with a question

Open a new chat and make the next query easier.

Recent chats, starter prompts, and a visible SQL dialect give every conversation a clear place to begin. Ask for SQL, explain a metric, debug a query, or teach SlothQuery a rule from your organization.

New SlothQuery chat interface with starter prompts and recent chats
LOCAL-FIRST / GROUNDED / REVIEWABLE

Getting Started

Install, configure, load knowledge, and start asking grounded questions.

1
Setup & Install

Install SlothQuery

Ensure you have Python 3.10+ installed. Then create and activate a virtual environment to keep dependencies isolated:

# Create virtual environment
python -m venv sloth_env

# Activate environment
sloth_env\Scripts\activate

# Install the package
pip install slothquery
2
Configuration

Configure Your LLM API

Launch the app with `slothquery`, then go to Settings → Configurations. Set your LLM API provider, paste your key, test the connection, and save.

Don't have a paid API? Start free — SlothQuery works with Gemini, OpenRouter, and Groq out of the box.

# Start SlothQuery application
slothquery
3
Initialization

Build or Import a Knowledge Base

Already have a .slothkb file? Go to Settings → Import to load it instantly.

Starting fresh? Open the Knowledge Studio to start storing your assets, queries, business logics, and contexts.

4
Querying

Start Chatting

Select your SQL dialect in the chat panel and start querying.

Ask it to generate SQL, explain metrics, or map out table relationships — all with context-aware accuracy tuned to your schema.

5
Troubleshooting & Relaunch

Manage Limits & Relaunch

If you reach your API rate limits, switch to a different provider or configure a new model under Settings → Configurations.

To restart the application at any time, simply open your terminal, activate your environment (e.g. activate your sloth_env), and run command:

slothquery

Knowledge Studio workflow

Shape trusted organizational context before it reaches chat.

01 Segmentation & Validation

Isolate with Vaults & Set Dialects

Create separate Vaults to organize queries, notes, and rules by business function (e.g., Marketing vs. Finance). When querying, choose your SQL Dialect (Snowflake, PostgreSQL, BigQuery, etc.) in the chat panel to instantly trigger dialect-specific background syntax validation.

02 Contextual Precision

Add Comments Near CTEs & Map Schemas

When preparing SQL files for upload, always add comments near your CTEs and complex subqueries explaining their business intent. Map physical Table Schemas in the studio so the AI learns exactly which columns belong to which tables.

03 Interactive Import Flow

Verify Business Intent in the Popup

Uploading SQL queries automatically triggers extraction. You'll receive a confirmation popup displaying the parsed unified context: business intent, table schemas, rules, formulas, and logics. You can edit this metadata before saving—human-revised context takes priority during AI retrieval.

04 Global Business Rules

Leverage Playbooks & Analyst Notes

Document formulas and metrics constraints in central Playbooks. Use freeform Analyst Notes to capture tribal knowledge or query quirks. The chatbot retrieves and reads all active playbooks and notes before writing a single line of SQL.

Your SQL deserves a memory

Don’t be a sloth.
Ship knowledge.

Install SlothQuery locally and turn the logic hidden in your SQL into something your whole team can retrieve.

pip install slothquery