Spaces:
Build error
Build error
Create README.md
Browse files
README.md
CHANGED
|
@@ -1,13 +1,35 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Multi-Agentic SQL Generator
|
| 2 |
+
|
| 3 |
+
The Multi-Agentic SQL Generator is a modular, multi-step system that translates natural language queries into SQL queries, validates and optimizes them, and then executes them against a SQLite database. The system leverages OpenAI's language models (via a LangGraph workflow) for query understanding, validation, and optimization. It also provides evaluation capabilities using RAGAS metrics (such as context precision and context recall) to assess performance and quality.
|
| 4 |
+
|
| 5 |
+
## Capabilities
|
| 6 |
+
|
| 7 |
+
- **Natural Language Query Understanding:**
|
| 8 |
+
Converts natural language queries into structured SQL metadata according to a predefined database schema.
|
| 9 |
+
|
| 10 |
+
- **Query Validation:**
|
| 11 |
+
Checks the generated SQL for syntax errors and security risks (e.g., harmful operations like `DROP`, `DELETE`).
|
| 12 |
+
|
| 13 |
+
- **Query Optimization:**
|
| 14 |
+
Optimizes SQL queries for performance, ensuring only the necessary columns, joins, and filtering conditions are included.
|
| 15 |
+
|
| 16 |
+
- **SQL Execution:**
|
| 17 |
+
Executes the optimized SQL query against a SQLite database and returns the results.
|
| 18 |
+
|
| 19 |
+
- **Evaluation with RAGAS Metrics:**
|
| 20 |
+
Evaluates the generated output using metrics like:
|
| 21 |
+
- **Faithfulness:** How closely the output matches the expected result.
|
| 22 |
+
- **Answer Relevancy:** How well the result addresses the user query.
|
| 23 |
+
- **Context Precision:** Whether the query returns only the necessary data.
|
| 24 |
+
- **Context Recall:** Whether the query returns all required data.
|
| 25 |
+
|
| 26 |
+
- **Extensibility and Deployment:**
|
| 27 |
+
Easily integrable with front-end frameworks (e.g., Chainlit) and deployable on platforms like Hugging Face Spaces.
|
| 28 |
+
|
| 29 |
+
## Installation
|
| 30 |
+
|
| 31 |
+
1. **Clone the Repository:**
|
| 32 |
+
|
| 33 |
+
```bash
|
| 34 |
+
git clone https://github.com/yourusername/multi-agent-sql-generator.git
|
| 35 |
+
cd multi-agent-sql-generator
|