nl2sql-engine 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. nl2sql/__init__.py +38 -0
  2. nl2sql/adapters/__init__.py +0 -0
  3. nl2sql/adapters/duckdb/__init__.py +0 -0
  4. nl2sql/adapters/duckdb/adapter.py +71 -0
  5. nl2sql/adapters/mssql/__init__.py +0 -0
  6. nl2sql/adapters/mssql/adapter.py +122 -0
  7. nl2sql/adapters/mysql/__init__.py +0 -0
  8. nl2sql/adapters/mysql/adapter.py +123 -0
  9. nl2sql/adapters/postgres/__init__.py +0 -0
  10. nl2sql/adapters/postgres/adapter.py +115 -0
  11. nl2sql/adapters/sqlalchemy_base/__init__.py +17 -0
  12. nl2sql/adapters/sqlalchemy_base/adapter.py +476 -0
  13. nl2sql/adapters/sqlalchemy_base/models.py +36 -0
  14. nl2sql/adapters/sqlite/__init__.py +0 -0
  15. nl2sql/adapters/sqlite/adapter.py +88 -0
  16. nl2sql/aggregation/__init__.py +3 -0
  17. nl2sql/aggregation/aggregator.py +98 -0
  18. nl2sql/aggregation/engines/__init__.py +3 -0
  19. nl2sql/aggregation/engines/polars_duckdb.py +125 -0
  20. nl2sql/api/__init__.py +0 -0
  21. nl2sql/api/auth_api.py +60 -0
  22. nl2sql/api/benchmark_api.py +114 -0
  23. nl2sql/api/datasource_api.py +132 -0
  24. nl2sql/api/indexing_api.py +59 -0
  25. nl2sql/api/llm_api.py +82 -0
  26. nl2sql/api/policy_api.py +135 -0
  27. nl2sql/api/query_api.py +138 -0
  28. nl2sql/api/result_api.py +24 -0
  29. nl2sql/api/settings_api.py +65 -0
  30. nl2sql/auth/__init__.py +8 -0
  31. nl2sql/auth/models.py +36 -0
  32. nl2sql/auth/rbac.py +25 -0
  33. nl2sql/cli/__init__.py +0 -0
  34. nl2sql/cli/checks.py +53 -0
  35. nl2sql/cli/commands/__init__.py +0 -0
  36. nl2sql/cli/commands/benchmark.py +34 -0
  37. nl2sql/cli/commands/doctor.py +49 -0
  38. nl2sql/cli/commands/indexing.py +126 -0
  39. nl2sql/cli/commands/info.py +25 -0
  40. nl2sql/cli/commands/install.py +27 -0
  41. nl2sql/cli/commands/policy.py +57 -0
  42. nl2sql/cli/commands/run.py +166 -0
  43. nl2sql/cli/commands/setup.py +415 -0
  44. nl2sql/cli/commands/visualize.py +34 -0
  45. nl2sql/cli/common/decorators.py +34 -0
  46. nl2sql/cli/config.py +24 -0
  47. nl2sql/cli/console.py +52 -0
  48. nl2sql/cli/demo/__init__.py +1 -0
  49. nl2sql/cli/demo/data.py +87 -0
  50. nl2sql/cli/demo/defaults.py +122 -0
  51. nl2sql/cli/demo/factory.py +289 -0
  52. nl2sql/cli/demo/manager.py +230 -0
  53. nl2sql/cli/demo/schemas.py +336 -0
  54. nl2sql/cli/demo/writers/__init__.py +0 -0
  55. nl2sql/cli/demo/writers/docker.py +182 -0
  56. nl2sql/cli/demo/writers/sqlite.py +88 -0
  57. nl2sql/cli/generators/datasources/__init__.py +3 -0
  58. nl2sql/cli/generators/datasources/generator.py +24 -0
  59. nl2sql/cli/generators/datasources/templates.py +7 -0
  60. nl2sql/cli/generators/env/__init__.py +3 -0
  61. nl2sql/cli/generators/env/generator.py +46 -0
  62. nl2sql/cli/generators/env/templates.py +25 -0
  63. nl2sql/cli/generators/llm/__init__.py +3 -0
  64. nl2sql/cli/generators/llm/generator.py +24 -0
  65. nl2sql/cli/generators/llm/templates.py +4 -0
  66. nl2sql/cli/generators/policies/__init__.py +3 -0
  67. nl2sql/cli/generators/policies/generator.py +20 -0
  68. nl2sql/cli/generators/policies/templates.py +2 -0
  69. nl2sql/cli/main.py +195 -0
  70. nl2sql/cli/reporting.py +878 -0
  71. nl2sql/cli/types.py +13 -0
  72. nl2sql/common/__init__.py +1 -0
  73. nl2sql/common/cancellation.py +25 -0
  74. nl2sql/common/context.py +5 -0
  75. nl2sql/common/errors.py +109 -0
  76. nl2sql/common/event_logger.py +88 -0
  77. nl2sql/common/exceptions.py +3 -0
  78. nl2sql/common/logger.py +119 -0
  79. nl2sql/common/metrics.py +50 -0
  80. nl2sql/common/resilience.py +59 -0
  81. nl2sql/common/settings.py +195 -0
  82. nl2sql/configs/__init__.py +6 -0
  83. nl2sql/configs/datasources.py +10 -0
  84. nl2sql/configs/llm.py +36 -0
  85. nl2sql/configs/manager.py +176 -0
  86. nl2sql/configs/policies.py +14 -0
  87. nl2sql/configs/sample_questions.py +11 -0
  88. nl2sql/configs/secrets.py +11 -0
  89. nl2sql/context.py +106 -0
  90. nl2sql/datasources/__init__.py +21 -0
  91. nl2sql/datasources/discovery.py +28 -0
  92. nl2sql/datasources/models.py +21 -0
  93. nl2sql/datasources/protocols.py +3 -0
  94. nl2sql/datasources/registry.py +172 -0
  95. nl2sql/evaluation/__init__.py +6 -0
  96. nl2sql/evaluation/benchmark_runner.py +320 -0
  97. nl2sql/evaluation/evaluator.py +134 -0
  98. nl2sql/evaluation/types.py +22 -0
  99. nl2sql/execution/__init__.py +4 -0
  100. nl2sql/execution/artifacts/__init__.py +3 -0
  101. nl2sql/execution/artifacts/parquet.py +41 -0
  102. nl2sql/execution/artifacts/store.py +165 -0
  103. nl2sql/execution/contracts.py +57 -0
  104. nl2sql/execution/execution_store.py +25 -0
  105. nl2sql/execution/executor/__init__.py +3 -0
  106. nl2sql/execution/executor/sql_executor.py +116 -0
  107. nl2sql/indexing/__init__.py +7 -0
  108. nl2sql/indexing/chunk_builder.py +227 -0
  109. nl2sql/indexing/embeddings.py +180 -0
  110. nl2sql/indexing/enrichment_service.py +316 -0
  111. nl2sql/indexing/models.py +209 -0
  112. nl2sql/indexing/orchestrator.py +90 -0
  113. nl2sql/indexing/vector_store.py +422 -0
  114. nl2sql/llm/__init__.py +8 -0
  115. nl2sql/llm/models.py +10 -0
  116. nl2sql/llm/registry.py +214 -0
  117. nl2sql/pipeline/__init__.py +1 -0
  118. nl2sql/pipeline/graph.py +73 -0
  119. nl2sql/pipeline/graph_utils.py +141 -0
  120. nl2sql/pipeline/nodes/__init__.py +25 -0
  121. nl2sql/pipeline/nodes/aggregator/__init__.py +4 -0
  122. nl2sql/pipeline/nodes/aggregator/node.py +55 -0
  123. nl2sql/pipeline/nodes/aggregator/prompts.py +20 -0
  124. nl2sql/pipeline/nodes/aggregator/schemas.py +28 -0
  125. nl2sql/pipeline/nodes/answer_synthesizer/__init__.py +4 -0
  126. nl2sql/pipeline/nodes/answer_synthesizer/node.py +98 -0
  127. nl2sql/pipeline/nodes/answer_synthesizer/prompts.py +19 -0
  128. nl2sql/pipeline/nodes/answer_synthesizer/schemas.py +24 -0
  129. nl2sql/pipeline/nodes/ast_planner/__init__.py +4 -0
  130. nl2sql/pipeline/nodes/ast_planner/node.py +104 -0
  131. nl2sql/pipeline/nodes/ast_planner/prompts.py +138 -0
  132. nl2sql/pipeline/nodes/ast_planner/schemas.py +236 -0
  133. nl2sql/pipeline/nodes/datasource_resolver/__init__.py +4 -0
  134. nl2sql/pipeline/nodes/datasource_resolver/node.py +253 -0
  135. nl2sql/pipeline/nodes/datasource_resolver/schemas.py +21 -0
  136. nl2sql/pipeline/nodes/decomposer/__init__.py +3 -0
  137. nl2sql/pipeline/nodes/decomposer/node.py +219 -0
  138. nl2sql/pipeline/nodes/decomposer/prompts.py +96 -0
  139. nl2sql/pipeline/nodes/decomposer/schemas.py +143 -0
  140. nl2sql/pipeline/nodes/executor/__init__.py +3 -0
  141. nl2sql/pipeline/nodes/executor/node.py +107 -0
  142. nl2sql/pipeline/nodes/generator/__init__.py +4 -0
  143. nl2sql/pipeline/nodes/generator/node.py +267 -0
  144. nl2sql/pipeline/nodes/generator/schemas.py +13 -0
  145. nl2sql/pipeline/nodes/global_planner/__init__.py +4 -0
  146. nl2sql/pipeline/nodes/global_planner/node.py +186 -0
  147. nl2sql/pipeline/nodes/global_planner/schemas.py +101 -0
  148. nl2sql/pipeline/nodes/refiner/__init__.py +4 -0
  149. nl2sql/pipeline/nodes/refiner/node.py +132 -0
  150. nl2sql/pipeline/nodes/refiner/prompts.py +28 -0
  151. nl2sql/pipeline/nodes/refiner/schemas.py +13 -0
  152. nl2sql/pipeline/nodes/schema_retriever/__init__.py +3 -0
  153. nl2sql/pipeline/nodes/schema_retriever/node.py +252 -0
  154. nl2sql/pipeline/nodes/schema_retriever/schema.py +27 -0
  155. nl2sql/pipeline/nodes/validator/__init__.py +7 -0
  156. nl2sql/pipeline/nodes/validator/node.py +839 -0
  157. nl2sql/pipeline/nodes/validator/schemas.py +12 -0
  158. nl2sql/pipeline/pipeline_runner.py +72 -0
  159. nl2sql/pipeline/routes.py +72 -0
  160. nl2sql/pipeline/runtime.py +153 -0
  161. nl2sql/pipeline/state.py +92 -0
  162. nl2sql/pipeline/subgraphs/__init__.py +5 -0
  163. nl2sql/pipeline/subgraphs/schemas.py +23 -0
  164. nl2sql/pipeline/subgraphs/sql_agent.py +167 -0
  165. nl2sql/public_api.py +199 -0
  166. nl2sql/schema/__init__.py +37 -0
  167. nl2sql/schema/in_memory_store.py +173 -0
  168. nl2sql/schema/protocol.py +88 -0
  169. nl2sql/schema/sqlite_store.py +233 -0
  170. nl2sql/schema/store.py +29 -0
  171. nl2sql/secrets/__init__.py +14 -0
  172. nl2sql/secrets/factory.py +85 -0
  173. nl2sql/secrets/interfaces.py +16 -0
  174. nl2sql/secrets/manager.py +139 -0
  175. nl2sql/secrets/models.py +56 -0
  176. nl2sql/secrets/providers/aws.py +30 -0
  177. nl2sql/secrets/providers/azure.py +49 -0
  178. nl2sql/secrets/providers/env.py +8 -0
  179. nl2sql/secrets/providers/hashi.py +46 -0
  180. nl2sql/services/__init__.py +0 -0
  181. nl2sql/services/callbacks/__init__.py +0 -0
  182. nl2sql/services/callbacks/monitor.py +84 -0
  183. nl2sql/services/callbacks/node_context.py +7 -0
  184. nl2sql/services/callbacks/node_handlers.py +187 -0
  185. nl2sql/services/callbacks/node_metrics.py +14 -0
  186. nl2sql/services/callbacks/presenter.py +12 -0
  187. nl2sql/services/callbacks/token_handler.py +56 -0
  188. nl2sql_engine-0.1.0.dist-info/METADATA +295 -0
  189. nl2sql_engine-0.1.0.dist-info/RECORD +192 -0
  190. nl2sql_engine-0.1.0.dist-info/WHEEL +5 -0
  191. nl2sql_engine-0.1.0.dist-info/entry_points.txt +9 -0
  192. nl2sql_engine-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,295 @@
1
+ Metadata-Version: 2.4
2
+ Name: nl2sql-engine
3
+ Version: 0.1.0
4
+ Summary: Natural-language-to-SQL engine, CLI and database adapters
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: SQLAlchemy>=2.0
8
+ Requires-Dist: PyYAML>=6.0
9
+ Requires-Dist: langgraph<2,>=1.2
10
+ Requires-Dist: langchain>=0.2.0
11
+ Requires-Dist: langchain-core<2,>=1.6
12
+ Requires-Dist: langchain-chroma<2,>=1.1
13
+ Requires-Dist: langchain-openai<2,>=1.6
14
+ Requires-Dist: chromadb<2,>=1.5
15
+ Requires-Dist: nl2sql-adapter-sdk~=0.1
16
+ Requires-Dist: pydantic>=2.0
17
+ Requires-Dist: opentelemetry-api>=1.20.0
18
+ Requires-Dist: opentelemetry-sdk>=1.20.0
19
+ Requires-Dist: opentelemetry-exporter-otlp>=1.20.0
20
+ Requires-Dist: sqlglot>=23.0.0
21
+ Requires-Dist: pydantic-settings>=2.0.0
22
+ Requires-Dist: pandas>=1.5.0
23
+ Requires-Dist: pyarrow>=14.0.0
24
+ Requires-Dist: pybreaker>=1.3.0
25
+ Requires-Dist: polars>=1.44
26
+ Requires-Dist: duckdb>=1.5
27
+ Requires-Dist: rich>=13.0.0
28
+ Requires-Dist: typer[all]>=0.9.0
29
+ Requires-Dist: inquirerpy>=0.3.4
30
+ Provides-Extra: aws
31
+ Requires-Dist: boto3; extra == "aws"
32
+ Provides-Extra: azure
33
+ Requires-Dist: azure-identity; extra == "azure"
34
+ Requires-Dist: azure-keyvault-secrets; extra == "azure"
35
+ Provides-Extra: duckdb
36
+ Requires-Dist: duckdb; extra == "duckdb"
37
+ Requires-Dist: duckdb-engine; extra == "duckdb"
38
+ Provides-Extra: hashicorp
39
+ Requires-Dist: hvac; extra == "hashicorp"
40
+ Provides-Extra: mssql
41
+ Requires-Dist: pyodbc>=4.0.0; extra == "mssql"
42
+ Requires-Dist: pymssql>=2.2.0; platform_system == "Linux" and extra == "mssql"
43
+ Provides-Extra: mysql
44
+ Requires-Dist: pymysql>=1.1.0; extra == "mysql"
45
+ Provides-Extra: postgres
46
+ Requires-Dist: psycopg2-binary>=2.9; extra == "postgres"
47
+ Provides-Extra: all
48
+ Requires-Dist: duckdb; extra == "all"
49
+ Requires-Dist: duckdb-engine; extra == "all"
50
+ Requires-Dist: pyodbc>=4.0.0; extra == "all"
51
+ Requires-Dist: pymssql>=2.2.0; platform_system == "Linux" and extra == "all"
52
+ Requires-Dist: pymysql>=1.1.0; extra == "all"
53
+ Requires-Dist: psycopg2-binary>=2.9; extra == "all"
54
+
55
+ # NL2SQL
56
+
57
+ The **`nl2sql`** package is the brain of the natural language to SQL engine. It orchestrates the entire query lifecycle using a graph-based agent architecture, and also ships the `nl2sql` CLI (`nl2sql.cli`) and the four database adapters (`nl2sql.adapters.*`).
58
+
59
+ ## 🏗️ Architecture Overview
60
+
61
+ The NL2SQL Core is built around a **graph-based orchestration system** using LangGraph that treats text-to-SQL as a distributed systems problem. The architecture is organized around several key planes:
62
+
63
+ ### 1. **The Control Plane (The Graph)**
64
+ - **Responsibility**: Reasoning, Planning, and Orchestration
65
+ - **Implementation**: Directed Cyclic Graph (LangGraph) with explicit state (`GraphState`)
66
+ - **Features**: Agentic graph with refinement loops for self-correction when plans fail validation
67
+
68
+ ### 2. **The Security Plane (The Firewall)**
69
+ - **Responsibility**: Invariants Enforcement
70
+ - **Implementation**: Valid-by-Construction approach where LLM generates Abstract Syntax Tree (AST) rather than executing SQL
71
+ - **Features**: Static analysis through logical validators enforcing RBAC and schema constraints
72
+
73
+ ### 3. **The Data Plane (The Sandbox)**
74
+ - **Responsibility**: Semantic Search and Execution
75
+ - **Implementation**: Sandboxed Process Pool for SQL driver isolation
76
+ - **Features**: Partitioned retrieval with schema store and vector-based context injection
77
+
78
+ ### 4. **The Reliability Plane (The Guard)**
79
+ - **Responsibility**: Fault Tolerance and Stability
80
+ - **Implementation**: Layered defense with Circuit Breakers and Sandboxing
81
+ - **Features**: Fail-fast approach with strict timeouts preventing cascading failures
82
+
83
+ ### 5. **The Observability Plane (The Watchtower)**
84
+ - **Responsibility**: Visibility, Forensics, and Compliance
85
+ - **Implementation**: Native OpenTelemetry integration
86
+ - **Features**: Distributed tracing (Jaeger), metrics (Prometheus), and forensic audit logs
87
+
88
+ ## 🧠 Key Components
89
+
90
+ ### **Context Management (`context.py`)**
91
+ - `NL2SQLContext`: Centralized application context managing initialization lifecycle
92
+ - Ensures proper ordering: secrets → datasources → LLMs → policies
93
+ - Coordinates all registries and stores
94
+
95
+ ### **Graph Pipeline (`pipeline/`)**
96
+ - **Graph Orchestration**: LangGraph-based state machine managing query flow
97
+ - **Nodes**: DatasourceResolver, Decomposer, GlobalPlanner, Aggregator, AnswerSynthesizer
98
+ - **Subgraphs**: SQL Agent subgraph with AST planner, validators, and executor
99
+ - **State Management**: Shared `GraphState` for auditability and reproducibility
100
+
101
+ ### **Schema Management (`schema/`)**
102
+ - **Schema Store**: Persistent storage for schema snapshots with versioning
103
+ - **Schema Contracts**: Typed representations of database schemas
104
+ - **Versioning**: Multiple schema versions with eviction policies
105
+
106
+ ### **Indexing System (`indexing/`)**
107
+ - **Schema Indexing**: Vector-based indexing of schema information
108
+ - **Chunk Builder**: Breaks schema into searchable chunks
109
+ - **Enrichment Service**: Enhances schema with example questions
110
+
111
+ ### **Data Sources (`datasources/`)**
112
+ - **Registry**: Dynamic registration and management of database adapters
113
+ - **Protocols**: Standardized interfaces for database connectivity
114
+ - **Discovery**: Automatic discovery of available adapter types
115
+
116
+ ### **LLM Management (`llm/`)**
117
+ - **Registry**: Management of multiple LLM instances
118
+ - **Configuration**: Flexible LLM provider configuration (OpenAI, etc.)
119
+ - **Routing**: Intelligent routing to appropriate LLMs
120
+
121
+ ### **Authentication & Authorization (`auth/`)**
122
+ - **RBAC**: Role-based access control for data access
123
+ - **User Context**: Identity and permission context propagation
124
+ - **Policy Engine**: Fine-grained access control rules
125
+
126
+ ## 🚀 Public API
127
+
128
+ The main public interface is provided through the `NL2SQL` class:
129
+
130
+ ```python
131
+ from nl2sql import NL2SQL
132
+
133
+ # Initialize the engine
134
+ engine = NL2SQL(
135
+ ds_config_path="configs/datasources.yaml",
136
+ llm_config_path="configs/llm.yaml",
137
+ policies_path="configs/policies.json"
138
+ )
139
+
140
+ # Run a natural language query
141
+ result = engine.run_query("Show top 10 customers by revenue")
142
+ print(result.final_answer)
143
+ ```
144
+
145
+ ### Two-Tier API Architecture
146
+
147
+ NL2SQL provides a two-tier API architecture:
148
+
149
+ #### 1. Core API (Python) - This Package
150
+ - **Interface**: Direct Python class interface (`NL2SQL` class)
151
+ - **Use Case**: Direct Python integration, embedded applications
152
+ - **Access**: Import and use directly in Python code
153
+
154
+ #### 2. REST API (HTTP)
155
+ - **Package**: API package (`nl2sql-api`)
156
+ - **Interface**: HTTP REST endpoints
157
+ - **Use Case**: Remote clients, web applications, TypeScript CLI
158
+ - **Access**: HTTP requests to API endpoints
159
+
160
+ Both APIs provide access to the same underlying NL2SQL engine functionality, allowing flexible integration options.
161
+
162
+ ### Modular API Structure
163
+
164
+ The engine provides modular APIs for different functionality areas:
165
+
166
+ - `engine.query` - Query execution API (`run_query`, etc.)
167
+ - `engine.datasource` - Datasource management API (`add_datasource`, `list_datasources`, etc.)
168
+ - `engine.llm` - LLM configuration API (`configure_llm`, etc.)
169
+ - `engine.indexing` - Schema indexing API (`index_datasource`, `clear_index`, etc.)
170
+ - `engine.auth` - Authentication and RBAC API (`check_permissions`, `get_allowed_resources`, etc.)
171
+ - `engine.settings` - Configuration and settings API (`get_current_settings`, `validate_configuration`, etc.)
172
+ - `engine.results` - Result management API (`store_query_result`, `retrieve_query_result`, etc.)
173
+ - `engine.policy` - Policy validation API (`validate_policies`, etc.)
174
+ - `engine.benchmark` - Benchmarking API (`run_matrix`, etc.)
175
+
176
+ For complete Core API documentation, see `docs/api/core.md` in this repo
177
+ or the API section of the published MkDocs site.
178
+
179
+ ## 📋 Public API Classes
180
+
181
+ The public API exports the following classes and types:
182
+
183
+ - `NL2SQL` - Main engine class
184
+ - `QueryResult` - Query result container
185
+ - `UserContext` - User authentication context
186
+ - `ErrorSeverity`, `ErrorCode`, `PipelineError` - Error handling types
187
+ - `QueryAPI`, `DatasourceAPI`, `LLM_API`, `IndexingAPI`, `AuthAPI`, `SettingsAPI`, `ResultAPI`, `PolicyAPI`, `BenchmarkAPI` - Modular API classes
188
+ - `BenchmarkConfig` - Benchmark configuration model
189
+
190
+ ## 📦 Installation
191
+
192
+ ```bash
193
+ # Engine, CLI and adapters; sqlite works out of the box
194
+ pip install nl2sql-engine
195
+
196
+ # Add the drivers for selected dialects
197
+ pip install "nl2sql-engine[mysql,mssql]"
198
+
199
+ # Add every database driver
200
+ pip install "nl2sql-engine[all]"
201
+ ```
202
+
203
+ ## 🔖 Versioning Policy
204
+
205
+ The three distributions in this monorepo -- `nl2sql-adapter-sdk`, `nl2sql-engine` and
206
+ `nl2sql-api` -- share a single version number and are released together. They
207
+ pin internal dependencies to the same version to prevent mismatches.
208
+
209
+ ## 🚀 Usage (CLI)
210
+
211
+ The core package exposes the CLI entry point:
212
+
213
+ ```bash
214
+ python -m nl2sql.cli --query "Show me all users" --id my_postgres_db
215
+ ```
216
+
217
+ ## 🛡️ Architectural Invariants
218
+
219
+ | Invariant | Rationale | Mechanism |
220
+ | :--- | :--- | :--- |
221
+ | **No Unvalidated SQL** | Prevent hallucinations & data leaks | All plans pass through `LogicalValidator` (AST). |
222
+ | **Zero Shared State** | Crash Safety | Execution happens in isolated processes; no shared memory with the Control Plane. |
223
+ | **Fail-Fast** | Reliability | Circuit Breakers and Strict Timeouts prevent cascading failures (Retry Storms). |
224
+ | **Determinism** | Debuggability | Temperature-0 generation + Strict Typing (Pydantic) for all LLM outputs. |
225
+
226
+ ## 🏗️ Pipeline Flow
227
+
228
+ The main execution flow follows this sequence:
229
+
230
+ 1. **Datasource Resolver** → **Decomposer** → **Global Planner** → **Layer Router**
231
+ 2. **SQL Agent Subgraph**: Schema Retriever → AST Planner → Logical Validator → Generator → Executor
232
+ 3. **Self-correction loops**: When validation fails, the system refines and retries
233
+
234
+ ### SQL Agent Subgraph Details:
235
+ - **AST Planner**: Generates Abstract Syntax Tree instead of direct SQL
236
+ - **Logical Validator**: Enforces RBAC and schema constraints
237
+ - **Generator**: Converts AST to dialect-specific SQL
238
+ - **Executor**: Runs SQL in sandboxed environment
239
+ - **Refiner**: Self-correction when validation fails
240
+
241
+ ## 🔐 Security Features
242
+
243
+ - **RBAC System**: Role-based access control for data access
244
+ - **Schema Validation**: All queries validated against schema before execution
245
+ - **Sandboxed Execution**: SQL runs in isolated processes
246
+ - **Query Limiting**: Row limits, timeout controls, and byte limits
247
+ - **Audit Logging**: Comprehensive logging of all operations
248
+
249
+ ## 📊 Observability
250
+
251
+ - **OpenTelemetry Integration**: Native support for distributed tracing
252
+ - **Metrics Collection**: Performance and operational metrics
253
+ - **Audit Logs**: Persistent forensic logs for compliance
254
+ - **Structured Logging**: Rich, contextual log information
255
+
256
+ ## 📁 Directory Structure
257
+
258
+ ```
259
+ src/nl2sql/
260
+ ├── api/ # Public API modules
261
+ │ ├── query_api.py # Query execution API
262
+ │ ├── datasource_api.py # Datasource management API
263
+ │ ├── llm_api.py # LLM configuration API
264
+ │ ├── indexing_api.py # Schema indexing API
265
+ │ ├── auth_api.py # Authentication API
266
+ │ ├── settings_api.py # Settings API
267
+ │ ├── result_api.py # Result management API
268
+ │ ├── policy_api.py # Policy validation API
269
+ │ └── benchmark_api.py # Benchmarking API
270
+ ├── auth/ # Authentication and RBAC
271
+ ├── common/ # Common utilities and settings
272
+ ├── configs/ # Configuration management
273
+ ├── adapters/ # Database adapters and the SQLAlchemy base
274
+ ├── cli/ # `nl2sql` command line interface
275
+ ├── datasources/ # Datasource management and discovery
276
+ ├── execution/ # Execution engine and artifacts
277
+ ├── indexing/ # Schema indexing system
278
+ ├── llm/ # LLM management
279
+ ├── pipeline/ # Graph orchestration
280
+ │ ├── nodes/ # Individual pipeline nodes
281
+ │ ├── subgraphs/ # Subgraph definitions
282
+ │ └── routes/ # Routing logic
283
+ ├── schema/ # Schema management
284
+ ├── secrets/ # Secret management
285
+ └── context.py # Application context
286
+ └── public_api.py # Public API facade
287
+ ```
288
+
289
+ ## 📋 Configuration
290
+
291
+ The engine requires configuration files for:
292
+ - `configs/datasources.yaml` - Database connection configurations
293
+ - `configs/llm.yaml` - LLM provider configurations
294
+ - `configs/secrets.yaml` - Secret management configurations
295
+ - `configs/policies.json` - RBAC policies and permissions
@@ -0,0 +1,192 @@
1
+ nl2sql/__init__.py,sha256=m4e97zJ9te5OkWdj4p4G1I5_rB5RWlMYY8cUxu-t0Ik,973
2
+ nl2sql/context.py,sha256=qu6PVYyQQ0LACeZWFscMugDtfDEBs4GYCC7u578N3ow,4228
3
+ nl2sql/public_api.py,sha256=NvDOgmOjL0zdnNiqeySbljeV85H31DgXCHHf3TNbL_U,6584
4
+ nl2sql/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ nl2sql/adapters/duckdb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ nl2sql/adapters/duckdb/adapter.py,sha256=leogUO8MNE3VuUXLRCyRzS_B3zJq4QL5J_Q6GML75lU,2444
7
+ nl2sql/adapters/mssql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ nl2sql/adapters/mssql/adapter.py,sha256=7ICxA75CQMqB-tFturuYN9gtlw5-ppcWyltaGAs6mWI,4367
9
+ nl2sql/adapters/mysql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ nl2sql/adapters/mysql/adapter.py,sha256=0aXjUZiVBAPuBKOs8-bTCy3bmyB-hzpUqsLv7P8W04o,4320
11
+ nl2sql/adapters/postgres/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ nl2sql/adapters/postgres/adapter.py,sha256=c8XuR91nt-g8g8Sce6kmhgtf5Z1xPMhUHiiT72jmYj0,4187
13
+ nl2sql/adapters/sqlalchemy_base/__init__.py,sha256=sd-v8GZsiEOawLc8RuGHWoiath2utLzTO7hnAWH8PUg,293
14
+ nl2sql/adapters/sqlalchemy_base/adapter.py,sha256=MKf3E49J9UHUrjURvOxKbajvmzTXjv6RENpNvwp9Ej0,17916
15
+ nl2sql/adapters/sqlalchemy_base/models.py,sha256=DBo3kODkJYo3wsbqnPktYbrMCrBga2KA2w2_9c1pySQ,1035
16
+ nl2sql/adapters/sqlite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ nl2sql/adapters/sqlite/adapter.py,sha256=BbW1FRtI4CebWSksBj1GO44mSqhroaOeMiwsvwoAiZw,3069
18
+ nl2sql/aggregation/__init__.py,sha256=OkO0MKT6Is7WkXiE6AcdLpTQVP5sD0gLWkSdABqOk5A,77
19
+ nl2sql/aggregation/aggregator.py,sha256=Pqzyr4dPioFvuM0s-G1edu2lNUIPWa-iyRP_i0C0PDQ,3682
20
+ nl2sql/aggregation/engines/__init__.py,sha256=tDu4jAoFuCsv5XMz-ura-iZu4dz-C-syBsYxqH7PdAU,80
21
+ nl2sql/aggregation/engines/polars_duckdb.py,sha256=IRx1AB-fm8OlhSa5Uzzt86-j5eaIPQ6Mgv_-i6Gocog,5368
22
+ nl2sql/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ nl2sql/api/auth_api.py,sha256=LQuQUuyX21J6SYORyrRl-nZz9JvBIqRnVjapyEpBv5s,1545
24
+ nl2sql/api/benchmark_api.py,sha256=U4MO4f0ZyNSlYPo-2eH_mnezUn71kM1uC7BrvxRSK0g,4210
25
+ nl2sql/api/datasource_api.py,sha256=KqE-MALBipP3YUtxZKDNA-Ok0KnTZc9o-AGXCYLlkHw,3848
26
+ nl2sql/api/indexing_api.py,sha256=CRapkkr5Me3rkAvxvSNRuy5RSv5uUyQh0Dq6p5DDFvo,1610
27
+ nl2sql/api/llm_api.py,sha256=Na2uoTnTDL_66ZAiccYlYA8LwRXgY5A7Nou5-RvzK78,2118
28
+ nl2sql/api/policy_api.py,sha256=22UttQ1GAFEH2Cqzu0RpLRwWDRs1P328tp2B7MRP20A,4904
29
+ nl2sql/api/query_api.py,sha256=nlPnrge9J8spBVYCfQLA4JXPVMeOhQfXcBFaH6Nirw8,4763
30
+ nl2sql/api/result_api.py,sha256=rbld5ixySxmrUH6-jjaRgBQAeBPj-rKP-blk4InOIM4,460
31
+ nl2sql/api/settings_api.py,sha256=9ZpZ6ovnSxtbXzP1fYjKgP22ArtIVBZ_C_MgBquqt3E,1768
32
+ nl2sql/auth/__init__.py,sha256=7XFvUBN1L4nRI9KZIXe_Gaa3ggs4lsKq4phA_aXXqzM,130
33
+ nl2sql/auth/models.py,sha256=xGs2xeDyuosdwdtITWaLjvp0ViX_7A4vMqcBKNYRd6I,1683
34
+ nl2sql/auth/rbac.py,sha256=SBhJoSDAkiOHTtTc5HOfOBKKrcJ-IOxZ5kPAxoCSsW0,1005
35
+ nl2sql/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
+ nl2sql/cli/checks.py,sha256=U1n2JwmpyhkxGPeghtQjSoHq-NWHNHfca2sOQb11t6U,1914
37
+ nl2sql/cli/config.py,sha256=S8eAAcMy1dRvNgxCtAECja_2b7tM9q1dHg3DWS4sV5A,762
38
+ nl2sql/cli/console.py,sha256=116IrHIPd0h-fOjp7J5KOwgR3Rj1cEt3rXvfIR0CjCc,1862
39
+ nl2sql/cli/main.py,sha256=LB9eBv8_ynA_l5LT7ttN1vMzUzVY3IThyHqSCA7VsQc,7309
40
+ nl2sql/cli/reporting.py,sha256=gUE5B5JpZGj6IPPkhiYAt0fyzO6FoCRAsM74R3KLAc4,34251
41
+ nl2sql/cli/types.py,sha256=sq7_xp3avnpKkf7dNEpULxgi1XOvlak_zV-cZUKi44E,291
42
+ nl2sql/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
+ nl2sql/cli/commands/benchmark.py,sha256=UEXBlEJmPVwLH2ZGbeFTm9SCQpKXsUxmsN1QA35gzUo,1161
44
+ nl2sql/cli/commands/doctor.py,sha256=XqNvHdQDP9bXc6qzmwKv56tNRGcTLL78K_bK1VgzpN4,1669
45
+ nl2sql/cli/commands/indexing.py,sha256=ECbDv8m0BDHQCIuVqCxwTym7c6P7OjNN5MnV_L8dRag,4532
46
+ nl2sql/cli/commands/info.py,sha256=ecEC1Nqqc9N3Y7U6Q1SJH8WV77jWhoHrYMs4L2dXQc0,876
47
+ nl2sql/cli/commands/install.py,sha256=EqfFiyYhVHrLmFFcde0o800kCXV2GuUKJShGlb7umHU,951
48
+ nl2sql/cli/commands/policy.py,sha256=RAYUAP4PM_63MyCozcyPuPVadM4XWjrz4yfBo3yZtCY,2264
49
+ nl2sql/cli/commands/run.py,sha256=YPBvDlrpVUuxKveU1JPeKYXX0K0fB_d19obRKIcOSSg,5867
50
+ nl2sql/cli/commands/setup.py,sha256=_LWv0hrPo4fZFTcv84mPcWgB3Pg_0qjz35dsWRiveFE,15817
51
+ nl2sql/cli/commands/visualize.py,sha256=4lnWXKCveZkm9PaIIz_v5Ow09bWf0NpA3ttq0JmYqoQ,1182
52
+ nl2sql/cli/common/decorators.py,sha256=Z6smQwwcPr-q6OzYDlpHoLvbyshGyimkruJylZACT8E,1182
53
+ nl2sql/cli/demo/__init__.py,sha256=Qga08KwXp2l2LgWBigddmUB823Igk8He1b8scJkjfGM,32
54
+ nl2sql/cli/demo/data.py,sha256=-jYnywWyT_QgHwwLcdJFA1G7pzPJCoAtHwPlFORNRfo,4274
55
+ nl2sql/cli/demo/defaults.py,sha256=gTQPZ8jZHJ-9h2kkfpW4c-2lfI3ENZueNQEWSUeOTaQ,4682
56
+ nl2sql/cli/demo/factory.py,sha256=YO69fozr7f_cskDpZjEPyYYvfwBvQMBnQmQyjUiNLPw,11640
57
+ nl2sql/cli/demo/manager.py,sha256=UP8B2ZAh-bcdfUmm0bLuJNu7ypVZ_t7f36Pm6dnbArY,8892
58
+ nl2sql/cli/demo/schemas.py,sha256=UMl0BVy1FooJrNhSx_epOEL5gGpfGf7BGJKPN7w-EeE,7760
59
+ nl2sql/cli/demo/writers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
+ nl2sql/cli/demo/writers/docker.py,sha256=ZzHUVKNcfxrHVcQSLvjUaPE2UCDBfoqHbVIEWEaC5b8,5908
61
+ nl2sql/cli/demo/writers/sqlite.py,sha256=vTVt9_eq83z-7JPiPUY5vA5uCtlcb-DfscPcoTOrpcM,2846
62
+ nl2sql/cli/generators/datasources/__init__.py,sha256=CqfdZ8viIWec14z0FvOL1cbB1W8MVaIz_pZuu-fLm_Y,78
63
+ nl2sql/cli/generators/datasources/generator.py,sha256=oO7vD0ZmI927mp0oTkS5lZGWHz4EdzAXUq2r0Ml8Shg,705
64
+ nl2sql/cli/generators/datasources/templates.py,sha256=WpH2o8Ma_9Kegq0YLQD2lLNYQiPkHjgGWYf56OTToU0,162
65
+ nl2sql/cli/generators/env/__init__.py,sha256=8ImX-Gam9P9Fr7AkorO68_B4n-tyhgUiiUy9Us7w4V8,72
66
+ nl2sql/cli/generators/env/generator.py,sha256=-bDazC0wzcqP9B2Q2k7fTVAG6Cn1kPSw9Ftbdku_r1s,1646
67
+ nl2sql/cli/generators/env/templates.py,sha256=l0tEe0xT6qWuLzdGjTgvcnSKOV-RE-uWQzYQtGjxEuc,751
68
+ nl2sql/cli/generators/llm/__init__.py,sha256=fl2hcUjBcifOJtaT5VLFJYGm0pmqmHUKM3ND9kpSPQ0,64
69
+ nl2sql/cli/generators/llm/generator.py,sha256=rUnCMXsBlzGKCYLtHx-zEDKZevJjJXmI3i1hVDjcdRw,661
70
+ nl2sql/cli/generators/llm/templates.py,sha256=8bLYbbD_9u2E8-W5iSmhAmsrg4ueNOXXhijD8r19SKY,67
71
+ nl2sql/cli/generators/policies/__init__.py,sha256=72eZRKt9FSHkO9FoMFaVwaTx0fUfw9P1cjYn2EJR_5I,70
72
+ nl2sql/cli/generators/policies/generator.py,sha256=yMFPNRABIdXKEmwY7LmhUUoMrB4hj9cw8l7MPwzt06I,533
73
+ nl2sql/cli/generators/policies/templates.py,sha256=hlVPkgkShmMaUzSvwrdQxleMPnVsBbkgO4wLOhKBSMM,38
74
+ nl2sql/common/__init__.py,sha256=tykA9lJj-Ls0bwLCqTsRmvKeOE6Xalti3LGXQ69HnYg,65
75
+ nl2sql/common/cancellation.py,sha256=uKaExUiPqzqdPxh1Qj5wPDyyP8YExdid9txt1bY3m84,650
76
+ nl2sql/common/context.py,sha256=K20QOLhr33LwvEKoNyfFnX7BhyJUveOiIrXBc57lp74,222
77
+ nl2sql/common/errors.py,sha256=FlflYXrgxAIaKGgiWrpVgaH2pzMEJq7xsHbZ7mlPSSg,3971
78
+ nl2sql/common/event_logger.py,sha256=z0L9cvF7tkqin47N6XTwN7B8xqLWWYPJX-6fI2VKLXw,3054
79
+ nl2sql/common/exceptions.py,sha256=RIPwDoszksPmZlmexgwMZsdpjh4h1NVYrEkRDdkD7Xw,87
80
+ nl2sql/common/logger.py,sha256=vchEv6yxd0Gsk9PHjrv3H8rt1ziA3tsEtcDYTyRNgrE,3742
81
+ nl2sql/common/metrics.py,sha256=6QEiVbdoq2A_w52T7MnWwzgFR95Mfgydwmp-fqLJ7BA,1711
82
+ nl2sql/common/resilience.py,sha256=UsLy5rhHWPnd0_eFA614hQJIZoLjB1h4dTj535PDKKc,1874
83
+ nl2sql/common/settings.py,sha256=mMhvB3_mTp5frytFAx-LjdTttIB40iG3V6tOmfpaQi0,7583
84
+ nl2sql/configs/__init__.py,sha256=4pYb-vxyiMuvmwKy9raJRbozT0XqcVmpL3H79sf1mv0,255
85
+ nl2sql/configs/datasources.py,sha256=b6o855sSf8WRn_C6rv1TIDk9JXmXjjqO6GbrwteudU4,346
86
+ nl2sql/configs/llm.py,sha256=Vr1WM_GZ0gn8aQ2BDk7EGDXonEUiBuH3Dy-nJiGv_j0,1399
87
+ nl2sql/configs/manager.py,sha256=Am7P3nFixlLJTH2oJHtHrEy3JhpHD8r8LWZkPqWzel0,6698
88
+ nl2sql/configs/policies.py,sha256=PYM5lHY7tzzr_1Ro89mwT1U_XQL23CSec0DJ8SZDoU4,310
89
+ nl2sql/configs/sample_questions.py,sha256=fJ_ODJgIJjwszSivaIlxwhG24FF88JaB-7pdqdPgxL0,298
90
+ nl2sql/configs/secrets.py,sha256=0PNsq7VZIBU3YcjGDuHyY3g-kVUQh4SNb4F2d0jzaJY,303
91
+ nl2sql/datasources/__init__.py,sha256=XtCMiDbHl6h_dwPzlS7eQY6lkECx5gDZyDVtfb0HbRc,690
92
+ nl2sql/datasources/discovery.py,sha256=McqjehO8ABhIvZLCCnoT2siX-9yGuqwkvPHdrIzL09o,916
93
+ nl2sql/datasources/models.py,sha256=NqhA_NNWFdGTKnYYPr6RJ02IG7D03LZVPyAyNTvE95Q,448
94
+ nl2sql/datasources/protocols.py,sha256=QaD7RH2CF5lxZp-3EJqwZF6QaSUi5SGC0zWY4-4xbbM,108
95
+ nl2sql/datasources/registry.py,sha256=j6229xcdjdo8QM3YIm76RiwAWKDPSytEQjbrPrFlpV4,6410
96
+ nl2sql/evaluation/__init__.py,sha256=dptaqnaxm1ENl4cfUgfRvyg-n-XPgfR3-rzTGWaEo18,286
97
+ nl2sql/evaluation/benchmark_runner.py,sha256=r5J39zoPBQeErOYhjtUUhm-x6iRFFleGmC5HXiw1xVA,11856
98
+ nl2sql/evaluation/evaluator.py,sha256=Uljoq5HCJYGO1T8nEFGQFEy-J0lT-nYd1OTDT_Z_l1M,5246
99
+ nl2sql/evaluation/types.py,sha256=1fVZ7JsONqvTeqjOZHNLHt0OYMTU_e8kJTJttfGfFUM,649
100
+ nl2sql/execution/__init__.py,sha256=ByIg595_NRAmadjRmwas-pTFPOkjya3pVrht9XBq2Ag,198
101
+ nl2sql/execution/contracts.py,sha256=Vb_cHsb4gvCdUWQlnPzR8vER1ezf6Yew2Ng_a1-Wx_A,1479
102
+ nl2sql/execution/execution_store.py,sha256=42KYFygO51bRFVxKL11iky--4n8MIqeMhAwT-_8Ivv0,697
103
+ nl2sql/execution/artifacts/__init__.py,sha256=QA6SoTROWjzaQN74of1BwPz_ZR6xMNiQp4WOQ8Wznvo,152
104
+ nl2sql/execution/artifacts/parquet.py,sha256=bMODj2Az4LSib0tOZ47wxrNpS8ErcbiDwYAdA_3lidM,1096
105
+ nl2sql/execution/artifacts/store.py,sha256=mNlKXPX0044k2zqpJPpb0Xws2pxQ2kcpUtPKnlmBeyk,6128
106
+ nl2sql/execution/executor/__init__.py,sha256=Fk-N__HmdycOzoq-CBvAyqCa6sQ1i8R6gymgydC_6FM,79
107
+ nl2sql/execution/executor/sql_executor.py,sha256=63_GYVFRABEJJBiO_XDOA3KIl6HA2_xXA20azUDdH9s,4362
108
+ nl2sql/indexing/__init__.py,sha256=OAE62dnE2JX-tEb2GNKk1VGyI2FapuK7mSmn39ENhAA,146
109
+ nl2sql/indexing/chunk_builder.py,sha256=rPkCy6spBNHFRNMurbaAh4lDnDD1496GnlHU5EYTjZQ,7578
110
+ nl2sql/indexing/embeddings.py,sha256=sVYZOlb9HogDSU6vT_ZM2cGFfVUESviBW3wwhYVfzmw,5846
111
+ nl2sql/indexing/enrichment_service.py,sha256=pkizpHp4ml63vBD2mql4tG9FZ6GV1kbQYs3S0zHPDIU,11275
112
+ nl2sql/indexing/models.py,sha256=lkLnLiYqhbW3tVKLAL-32DejJcIDXQXiQburW1bIm6g,6268
113
+ nl2sql/indexing/orchestrator.py,sha256=CoQ6KgvYE1sUZS30DUxtjTRJTLm76wxEoT9A7sfPqmY,2808
114
+ nl2sql/indexing/vector_store.py,sha256=Gtov4RcqZv3dW2iT9hAjEUa_glkHf1li-Y9wsRYT0AU,12818
115
+ nl2sql/llm/__init__.py,sha256=6zezlG3rcTR8aEMNP1pyjTdP3_McsLN--rD10Y12g_w,119
116
+ nl2sql/llm/models.py,sha256=hbjs6x6ivwsceyhJ0Xiu0yHKw3pMVn5nMQlsk9IoXKM,312
117
+ nl2sql/llm/registry.py,sha256=-dBH-fFtNHW4cN6HPM0UaFZ6Bi4NqkBiUmRjlxs6zvo,7790
118
+ nl2sql/pipeline/__init__.py,sha256=zCseU4QhuaPHxEx4GmbKjv4cXo0fpiqchkyzg4cYy-c,81
119
+ nl2sql/pipeline/graph.py,sha256=Q294D0FUEt0faWXPtxY-l4DtwlweO79Ku1SoPFnPEaU,2627
120
+ nl2sql/pipeline/graph_utils.py,sha256=lVlrMeyHd-ygSKZBuSLZBVAqVjKTQqhRNRBFUECYnIQ,4777
121
+ nl2sql/pipeline/pipeline_runner.py,sha256=Uhpfd_fu649Ubd5FXfnmUWZqFXyKHIRxeDlnk1pPsmg,1926
122
+ nl2sql/pipeline/routes.py,sha256=yEIjHhrO3Sbqg7MPix-dCSgjarZcmyb_I9lb6OZpo0A,2559
123
+ nl2sql/pipeline/runtime.py,sha256=TL6NYADAD-FYOP1RIZgNxeSzxTQMtwXOPkNNwnclLW0,4602
124
+ nl2sql/pipeline/state.py,sha256=vHJ6GvDpAds9Uoutr87ef6OWkB8Em8Ly2mqdh53sBgo,5291
125
+ nl2sql/pipeline/nodes/__init__.py,sha256=Jwp4oVZGSRhDhbLJSOkVVU4zX_5Bm4yftfF3KKAGbOU,825
126
+ nl2sql/pipeline/nodes/aggregator/__init__.py,sha256=qxSeVg8GxlVV9A22OpS4Nk-WlzQ6JNGNMRj6JvY_a70,137
127
+ nl2sql/pipeline/nodes/aggregator/node.py,sha256=Ms8cjqf4S_fOUXlDWPAAur2dH7Q6tctrktV-9ooTvws,2263
128
+ nl2sql/pipeline/nodes/aggregator/prompts.py,sha256=N4q_pcw7umy5h4RuiSooKJ7rbcEZ7-S93KjS0k-8Sd8,778
129
+ nl2sql/pipeline/nodes/aggregator/schemas.py,sha256=Rhcj28iKQuw3p-PRcB_UiitRbihNG6HLNA6DJMWaGyg,1323
130
+ nl2sql/pipeline/nodes/answer_synthesizer/__init__.py,sha256=tPmGUEv5wQmfRh5qTGi4gMaPXI0gOz7p_noVTD6PGo8,195
131
+ nl2sql/pipeline/nodes/answer_synthesizer/node.py,sha256=Qj6zwIGROwbLrlEa5YzgBOS8yC9i3hXbTbE9G4FB5r0,3627
132
+ nl2sql/pipeline/nodes/answer_synthesizer/prompts.py,sha256=sYMMl1ZKAGTIF0in_6unUMflY6-_HyQdm9DIOrRQVV4,619
133
+ nl2sql/pipeline/nodes/answer_synthesizer/schemas.py,sha256=ubonMQii5BAbXj7e88r-O-PiYo-FOzNBVLtu5oUCJ7E,1000
134
+ nl2sql/pipeline/nodes/ast_planner/__init__.py,sha256=Pi9Y2Jn95J8LvcapWc0WB13Y3gKGYrO7bT2vLq_Kig4,125
135
+ nl2sql/pipeline/nodes/ast_planner/node.py,sha256=vEBwVnnwtG6q1CNraofBVdwxR7bX3nEi9l5l-TMeJJg,3817
136
+ nl2sql/pipeline/nodes/ast_planner/prompts.py,sha256=dBsjhhhDYl3m26Cj0gJtLV6PA6uWj23NA4cptZACb94,4387
137
+ nl2sql/pipeline/nodes/ast_planner/schemas.py,sha256=LNkJ4OI-AeY_ax7NPtg7T7lh5Ib_c1GaRAq10Rykl6Q,7716
138
+ nl2sql/pipeline/nodes/datasource_resolver/__init__.py,sha256=cqqBhps2uxY5rJ45ak15u3jAqBUcDzVMewjqKpMXkQ4,199
139
+ nl2sql/pipeline/nodes/datasource_resolver/node.py,sha256=aIbzZxD6BjzhGRYTc261OOKHzOf9LPZcvPyKjMk5XOQ,10360
140
+ nl2sql/pipeline/nodes/datasource_resolver/schemas.py,sha256=OrGwpHf3sFIk2LvkD5s95qKABlzbyyLUw68dQMCEDW8,641
141
+ nl2sql/pipeline/nodes/decomposer/__init__.py,sha256=_-RRipNfIUonSQghdx6mJ4PqJ0WRl7pBX3ouY-Vjsr4,63
142
+ nl2sql/pipeline/nodes/decomposer/node.py,sha256=UQNgMwUjkoHOghIkP4rEXVnF1h3Lad-lMy073DYdJaE,9213
143
+ nl2sql/pipeline/nodes/decomposer/prompts.py,sha256=jlqPLp6bYpPnhxkkY7yUIqofhlwEstb4j9pHZd_huUA,2955
144
+ nl2sql/pipeline/nodes/decomposer/schemas.py,sha256=yX8RVgZY5OonDeGmjnEKp7TLVWXPFPwNpkGkHTXv8Ro,5078
145
+ nl2sql/pipeline/nodes/executor/__init__.py,sha256=rOAHGAS8MoOc8pEneRmEaHbdKcue-AdPhpwecgKkAxE,59
146
+ nl2sql/pipeline/nodes/executor/node.py,sha256=UiKLxTo6VaZxR6pXtzjw2pTiEF-WjKVD10BpyMjivWc,4176
147
+ nl2sql/pipeline/nodes/generator/__init__.py,sha256=4UlJYWooS6pwO-QqxEEJaLztLilvHmmuEn7_Np86y94,121
148
+ nl2sql/pipeline/nodes/generator/node.py,sha256=jmNYrtwDfpobI0JWmkZogMfYOCfyt7K9Kv8N1Aw7184,9939
149
+ nl2sql/pipeline/nodes/generator/schemas.py,sha256=zhe38rq6GDexlkgjAJaQd0U6ptxXt2uAFW0-I9LZ7Fk,370
150
+ nl2sql/pipeline/nodes/global_planner/__init__.py,sha256=0RK5WF80ngh_8wf_bEBIr4DO2BJ9xJAY0dviaN8T--g,137
151
+ nl2sql/pipeline/nodes/global_planner/node.py,sha256=Xru-nrh8WpVKciwng8IK4iIVZpJwdL5AWSLQ3rEiGSY,7815
152
+ nl2sql/pipeline/nodes/global_planner/schemas.py,sha256=fZ1PtEGyK1Xf47i_C8mE-27EsPnnN0j_tCW1Ap2LUlc,2895
153
+ nl2sql/pipeline/nodes/refiner/__init__.py,sha256=_YcGaSWzuYFVyqQo-XnqtIxz1YsVdYlRXYkKh3ST3SQ,113
154
+ nl2sql/pipeline/nodes/refiner/node.py,sha256=7aqQ65wQ-dqgJY1LksK4nuCj_siQzzjxHSTY1aZI1ag,4974
155
+ nl2sql/pipeline/nodes/refiner/prompts.py,sha256=H8zcvKSK6Gl8jRRwl1QqEodoWbH694-0iEgBYK8Vzf0,1056
156
+ nl2sql/pipeline/nodes/refiner/schemas.py,sha256=BX6Br2otLwbJg46_4MDU5NyAneuxiYhqycUGZ2YSxOM,367
157
+ nl2sql/pipeline/nodes/schema_retriever/__init__.py,sha256=miMgIAwDzvrYbnsjgSdnYPEPmNQuKGZQWp7dkzxAM_4,73
158
+ nl2sql/pipeline/nodes/schema_retriever/node.py,sha256=JwsAirR1nCY-9GWh1h5u4GxaQ0nnOm4GfqXCNLa3qlA,9693
159
+ nl2sql/pipeline/nodes/schema_retriever/schema.py,sha256=-lhZnubzXTOIM5Iub2gomjTLx2DzhfndJWUYTe1TBkQ,692
160
+ nl2sql/pipeline/nodes/validator/__init__.py,sha256=SDrs6nZ4okjv8JRg427RlasVeGYA1J99arKQZZiNNzo,160
161
+ nl2sql/pipeline/nodes/validator/node.py,sha256=kzJYWQIuPHDvC7P8u4CtIOy77jlxPuZ0Nf9poI647lM,33724
162
+ nl2sql/pipeline/nodes/validator/schemas.py,sha256=skyWdEKWGwU8rQM4Pit8eR6DrXf-3Do3lYP0b7dmPbM,331
163
+ nl2sql/pipeline/subgraphs/__init__.py,sha256=H-VTzAeo0AfIJhoIohC5xGgCsa39K8xEFx0q7aUDkIQ,99
164
+ nl2sql/pipeline/subgraphs/schemas.py,sha256=CleoVqsvxPshYZHFu7QcQH26c8AFiw-fQ_G2hacq22g,784
165
+ nl2sql/pipeline/subgraphs/sql_agent.py,sha256=nUHYArt0IHGpwRiY28xhns2wPGZ5N574kA1LHSE_6nc,6087
166
+ nl2sql/schema/__init__.py,sha256=Ko4aw9jxijU5YHMuFfp97mKXF_Bsoxc8F5BZsm-_x5w,869
167
+ nl2sql/schema/in_memory_store.py,sha256=zkUNPDRvLDU5StgfFPiLYyuIH8tSdVX0AtDSJJdTa-s,6318
168
+ nl2sql/schema/protocol.py,sha256=16bqaFmmk3XujnovsEpWHkNd6tpoya4qEbDzFYGw8Bw,2504
169
+ nl2sql/schema/sqlite_store.py,sha256=CyP8e350QLpwfrj5Nl0sSrwnRPORuzTThmz69NUB4Kk,7637
170
+ nl2sql/schema/store.py,sha256=Nx74EwtPEEoJUR2zds0OdGqA7bKjQBihRGoQ2o92Up8,854
171
+ nl2sql/secrets/__init__.py,sha256=cnTUjcM_YwkqIWhJ5zdVSLOnwar0t87R6tySh1NcaFE,328
172
+ nl2sql/secrets/factory.py,sha256=wVLV6vpl6uzymtUFYtLHGRBPtA6BKX0cpz77jwCpfU4,3309
173
+ nl2sql/secrets/interfaces.py,sha256=XhQCUGms_d1Y3TG5nJCO7SrP43CqmlXMPHk1KMjNyz4,460
174
+ nl2sql/secrets/manager.py,sha256=zXQMGgdEshMruCKk1nJyjXw58TaBFA4SKEcfkrEYO1k,5182
175
+ nl2sql/secrets/models.py,sha256=OEVEfamjauVkHrtDTftec4wYSGgwk7f0XsC8ZGztSV0,2234
176
+ nl2sql/secrets/providers/aws.py,sha256=dbnrudkq8ZQ13u89tlihTXE-tLG1AKkLtv_Z0DMRyvE,1245
177
+ nl2sql/secrets/providers/azure.py,sha256=6Fqw_H6i9gadu8ey-_BTtp9RYcSH3wTMeJ6MTIDitVA,2054
178
+ nl2sql/secrets/providers/env.py,sha256=Ibwroaj2KwPkroVJuIC3glzS05_axZ1BEsM6l5kl_BM,219
179
+ nl2sql/secrets/providers/hashi.py,sha256=RwC4QBxziILTruRvcynJFMRsF1r1t183WDXxDJqybGs,1675
180
+ nl2sql/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
181
+ nl2sql/services/callbacks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
182
+ nl2sql/services/callbacks/monitor.py,sha256=hFwneVamQcvpcqG-uaQUZRL0oBq4eHU_Cy-qVW4YKDs,3353
183
+ nl2sql/services/callbacks/node_context.py,sha256=bt8udW1MZsQlPH-9acpcvYU3uoZCL27JthLkT6ml7MA,176
184
+ nl2sql/services/callbacks/node_handlers.py,sha256=ufovJXAYzeJ4eFvbKKUJQnYHNws5GW_ihMBZlf-Y25E,6393
185
+ nl2sql/services/callbacks/node_metrics.py,sha256=DD1wraqi01TbtCltTrDyQQ-cngFb0Pvy6GQyhj3ZcKA,339
186
+ nl2sql/services/callbacks/presenter.py,sha256=12-8nD0CSiHrQ2z-gbMhP6983bg_ykb93VZcuEj0yTM,266
187
+ nl2sql/services/callbacks/token_handler.py,sha256=TROVTrIObR-0HiZBTIbfbPyF_aEXu0OdRrZNVc28VB4,1920
188
+ nl2sql_engine-0.1.0.dist-info/METADATA,sha256=pyWBbYHJhGOwZGlV61KmzZ2-KkswORBU0BhoUohFr9Q,12554
189
+ nl2sql_engine-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
190
+ nl2sql_engine-0.1.0.dist-info/entry_points.txt,sha256=EAg8ovR1A1r8Ri_jr8eO9yQQjTAIy398qotlTgdr9n0,337
191
+ nl2sql_engine-0.1.0.dist-info/top_level.txt,sha256=B_NI1U1LA9E8_I9xAGOL1xLjnJs4wrWQocsGIjO3uvg,7
192
+ nl2sql_engine-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,9 @@
1
+ [console_scripts]
2
+ nl2sql = nl2sql.cli.main:main
3
+
4
+ [nl2sql.adapters]
5
+ duckdb = nl2sql.adapters.duckdb.adapter:DuckdbAdapter
6
+ mssql = nl2sql.adapters.mssql.adapter:MssqlAdapter
7
+ mysql = nl2sql.adapters.mysql.adapter:MysqlAdapter
8
+ postgres = nl2sql.adapters.postgres.adapter:PostgresAdapter
9
+ sqlite = nl2sql.adapters.sqlite.adapter:SqliteAdapter
@@ -0,0 +1 @@
1
+ nl2sql