Skip to main content

A modular agentic reasoning engine for structured data, including NLQ-to-SQL transformations.

Project description

SQLThought

SQLThought is a modular, extensible multi-agent reasoning framework built for intelligent interaction with structured data, databases, and future analytical workflows.
It currently includes a complete natural-language query (NLQ) โ†’ SQL reasoning pipeline powered by Groq, but the architecture is intentionally designed to support many more reasoning tasks as the project evolves.

SQLThought is not just a utility โ€” it's a foundation for agentic, step-wise, auditable reasoning over structured information.


๐Ÿš€ Key Features

๐Ÿ”น Multi-Agent Reasoning (LangGraph)

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

Ultra-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.

๐Ÿ”น Zero-Friction CLI

SQLThought includes a full command-line interface:

  • sqlthought configure โ€” Configure Groq API + model
  • sqlthought query โ€” Query your database using natural language
  • sqlthought version โ€” Show installed version
  • sqlthought build-db โ€” Build a SQLite database from CSV files

๐Ÿ”น Secure Local Config Storage

~/.sqlthought/config.json

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

๐Ÿ“ฆ Installation

pip install sqlthought

๐Ÿ”ง First-Time Setup

sqlthought configure

You will be prompted for:

  • Groq API key
  • Model name (e.g., openai/gpt-oss-20b or another Groq-hosted model)

Configuration only needs to be done once.


๐Ÿ“‚ Project Structure

sqlthought/
โ”œโ”€โ”€ nlq/
โ”‚   โ”œโ”€โ”€ conversion.py       # Public NLQโ†’SQL API
โ”‚   โ”œโ”€โ”€ build_graph.py      # LangGraph pipeline
โ”‚   โ”œโ”€โ”€ nodes.py            # Multi-agent reasoning nodes
โ”‚   โ”œโ”€โ”€ state.py            # Typed pipeline state
โ”‚   โ””โ”€โ”€ prompts/            # Prompt templates
โ”œโ”€โ”€ ingestion/
โ”‚   โ””โ”€โ”€ build_db.py         # CSV โ†’ SQLite builder
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ db_utils.py
โ”‚   โ”œโ”€โ”€ logger.py
โ”‚   โ””โ”€โ”€ visualizer.py
โ””โ”€โ”€ cli.py                  # Command-line entrypoint


๐Ÿ”จ Building Databases from CSV Files

  • SQLThought ships with a helper for assembling SQLite databases from CSVs.
sqlthought init
  • Upload CSV files into:
sqlthought_data/csv/
  • Then build the database:
sqlthought build-db sample.db
  • Your DB will be created at:
sqlthought_data/sample.db

And is now ready for NLQ reasoning.


๐Ÿง  Natural Language โ†’ SQL

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

๐Ÿ–ฅ๏ธ CLI Example

sqlthought query "List employees earning above 70000" sample.db

๐Ÿค 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-0.0.3.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

sqlthought-0.0.3-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sqlthought-0.0.3.tar.gz
Algorithm Hash digest
SHA256 446035a2c96fed7e76134b8155097cba979ffc77dbf3fbae0328af0e0bca95bc
MD5 491293fd879aaff3187c75e1b4aa973e
BLAKE2b-256 70a0cba32c361364b731dfa701880633730730f64e5e0538a7b8f84dd8a5ce45

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sqlthought-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ae8b35fa6be36eb3a678fdd24143225866bccbf0c9ae7bd83e2aad1b77abb1aa
MD5 fcbb0e1d2690b18abcf00bfa2af0086e
BLAKE2b-256 4b2128bab8291a2f021e0f5ecb0bc20585b38ca6e5f509d1993a4acd989dca5f

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