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 + modelsqlthought queryโ Query your database using natural languagesqlthought versionโ Show installed versionsqlthought 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlthought-0.0.2.tar.gz.
File metadata
- Download URL: sqlthought-0.0.2.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ca5dae184f62a8b0e6815ddaf27d2c2ce4ffec316dd7135a85133aa5043689f
|
|
| MD5 |
ff37efc0735583555b81c20bf5204e95
|
|
| BLAKE2b-256 |
2f0a93021db4d1fd87d893c507b8b47c472b1929482aee693938c03831c81359
|
File details
Details for the file sqlthought-0.0.2-py3-none-any.whl.
File metadata
- Download URL: sqlthought-0.0.2-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b6d6ae274dc9ce87ccd46bd9901e6a3b2dea72e579c614c367a72bce45f2727
|
|
| MD5 |
911e1abffb6db4416b3ce507b8730892
|
|
| BLAKE2b-256 |
24cedc01e77d8850d3f5d97302866379c4b674f4898a9447dd9e20382ee41043
|