Skip to main content

Building DB, asking natural language questions through agents

Project description

🔗 SQLThought

Are you interested in quickly building a database from CSV files and asking questions in natural language?

You’ve arrived at the right place!

Quick Install

pip install sqlthought

CLI commands

SQLThought includes a full command-line interface:

  • sqlthought - Show the steps to follow
  • sqlthought --version — Show installed version
  • sqlthought configure — Configure Groq API and LLM
  • sqlthought init - Create workspace for setting up db
  • sqlthought build-db — Build a SQLite database from CSV files
  • sqlthought query — Query your database using natural language

🤔 What is this?

SQLThought is built to simplify how people interact with structured data.

Many users know exactly what they want to ask — but writing SQL, understanding joins, tuning filters, or debugging errors takes time.

Traditional NLQ (Natural Language Query) systems jump from text → SQL directly, which often leads to invalid queries and unclear reasoning.

SQLThought takes a more reliable approach:

✅ It thinks step-by-step It analyzes the schema, decomposes the question, plans the query, generates SQL, executes it, and—if something fails—corrects the SQL automatically.

✅ It builds a database for you Just place your CSV files in a folder and run one command to generate a queryable SQLite database.

✅ It gives natural language answers Once SQL is executed, SQLThought converts the results back into a clean, conversational answer powered by Groq.

🧩 What are the key features?

Multi-Agent Reasoning

SQLThought uses LangGraph to orchestrate intelligent pipelines with:

  • Stepwise decomposition
  • State-aware execution
  • Deterministic branches
  • Automatic SQL correction loops
  • Fully transparent, debuggable agent workflows

Groq-Powered LLM Execution

Fast agentic reasoning using Groq’s API, providing:

  • Low-latency inference
  • Predictable outputs
  • Easy model switching
  • Secure local configuration

Modular, Extensible Architecture

Every reasoning stage is isolated and replaceable.

Secure Local Config Storage

~/.sqlthought/config.json

Stores API keys and model preferences locally (never uploaded or logged).

NLQ to SQL conversion

The first reasoning module shipped with SQLThought is a full NLQ → SQL agentic system with:

  • Schema understanding
  • Subtask decomposition
  • Query planning
  • SQL generation
  • SQL execution
  • Automatic correction loops

💁 Contributing

Contributions, feature ideas, and pull requests are welcome! More documentation and developer guides will be added soon.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlthought-1.0.4.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlthought-1.0.4-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file sqlthought-1.0.4.tar.gz.

File metadata

  • Download URL: sqlthought-1.0.4.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for sqlthought-1.0.4.tar.gz
Algorithm Hash digest
SHA256 33faa0b7901feafcb7e7f8b59f62d87c78c3b3a78e7a809cf67a787621ed49be
MD5 aef071459648b4cfe9ee58d1fb5ee995
BLAKE2b-256 a13aa8d4c6c4a24e76fdc98151c34968fa1dcc1bf055c1fcc9254f608db2fe98

See more details on using hashes here.

File details

Details for the file sqlthought-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: sqlthought-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for sqlthought-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c45c13835f6deb537b307706cf07176c555ebd767841316dcd19d08f4de8b95d
MD5 369e26161984e5bd57e4e226d562732e
BLAKE2b-256 35d7bdc7a62a9a55ccd84148326ba64b7ed2a038649800918afe21f8dcca1887

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page