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 with the steps to follow
  • sqlthought --version — Show installed version
  • sqlthought configure — Configure Groq API + model
  • 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.

📕 License

MIT License © 2025 Tiyasa Mukherjee

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.3.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.3-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sqlthought-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 e46a3b3175dd79d9ec5fea16605a19aedf0e4be5fe77ceb0cd2a8b3e5fc91b34
MD5 2f49fddbdaadfd29df3f8130e08b7e88
BLAKE2b-256 dd3a4beeb59ae483b2935fc7ca134f1721ec41d47728ba0754f397dc611217c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sqlthought-1.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cbab52650b0460ccc03c47b9a0279462f41cb44a66b335051bee44af4538d2b2
MD5 e83c7f3333e18ce95bed23fc9f81a043
BLAKE2b-256 591812ea3f38123dd6af532ef049d3b47222fa2ece4af550617100e354bac1e6

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