|
4 | 4 |
|
5 | 5 | Lucidata is an LLM based query tool designed to democratize data access. It translates natural language questions into SQL/API queries over structured datasets, returning clear, traceable answers and exports. |
6 | 6 |
|
7 | | -## Features (WIP) |
| 7 | +## Features |
8 | 8 |
|
9 | 9 | - Natural Language Interface: Ask questions in plain English |
10 | | -- Query Translation: Automatic conversion to SQL/API queries |
11 | | -- Result Visualization: Clear tables and charts |
12 | | -- Export Options: Download results in various formats (CSV, Excel, etc.) |
13 | | -- Query Transparency: Track and export generated queries |
| 10 | +- Query Translation: Automatic conversion to SQL queries |
| 11 | +- Query Transparency: Track and export generated queries, explanations, and model confidence |
| 12 | + |
| 13 | +### Road-Map |
| 14 | + |
| 15 | +- Support for Generic WebAPI queries |
| 16 | +- Result Visualization |
14 | 17 |
|
15 | 18 | ## Getting Started |
16 | 19 |
|
17 | 20 | ### Prerequisites |
18 | 21 |
|
19 | 22 | - `docker` installed |
20 | | -- OpenAPI `API_KEY` |
| 23 | +- An OpenAPI `API_KEY` |
21 | 24 |
|
22 | 25 | ### Usage |
23 | 26 |
|
24 | 27 | 1. Clone the repository |
25 | 28 | ```bash |
26 | | - git clone https://github.com/jdhoffa/lucidata.git |
| 29 | + gh repo clone jdhoffa/lucidata |
27 | 30 | cd lucidata |
28 | 31 | ``` |
29 | 32 |
|
30 | | -2. Start the application with Docker Compose |
| 33 | +2. Build and start the application with `docker compose`: |
31 | 34 | ```bash |
| 35 | + docker compose build # it can take a while to compile, be patient :-) |
32 | 36 | docker compose up |
33 | 37 | ``` |
34 | 38 |
|
35 | | -3. Enter your natural language query in the input field and click "Submit" |
| 39 | +3. Send your query to the query_router endpoint, and check out the results! |
| 40 | +``` bash |
| 41 | +curl -X POST "http://localhost:8002/translate-and-execute" \ |
| 42 | + -H "Content-Type: application/json" \ |
| 43 | + -d '{ |
| 44 | + "natural_query": "Show me the cars with the best power-to-weight ratio, sorted from highest to lowest" |
| 45 | + }' |
| 46 | +``` |
36 | 47 |
|
37 | | -4. Review the results and use the export options as needed |
| 48 | +4. (Optional) Pipe the output to the `jq` CLI: |
| 49 | +``` bash |
| 50 | +curl -X POST "http://localhost:8002/translate-and-execute" \ |
| 51 | + -H "Content-Type: application/json" \ |
| 52 | + -d '{ |
| 53 | + "natural_query": "Show me the cars with the best power-to-weight ratio, sorted from highest to lowest" |
| 54 | + }' | jq |
| 55 | + |
| 56 | +# you can also select a specific tag |
| 57 | +curl -X POST "http://localhost:8002/translate-and-execute" \ |
| 58 | + -H "Content-Type: application/json" \ |
| 59 | + -d '{ |
| 60 | + "natural_query": "Show me the cars with the best power-to-weight ratio, sorted from highest to lowest" |
| 61 | + }' | jq '.results' |
| 62 | +``` |
38 | 63 |
|
39 | 64 | ## System Architecture |
40 | 65 |
|
@@ -77,9 +102,18 @@ graph TD |
77 | 102 | ## Example Queries |
78 | 103 |
|
79 | 104 | ``` |
80 | | -"What is the projected energy mix in 2030 according to IEA's Net Zero scenario?" |
| 105 | +# Query #1 tests mathematical operations (division of hp/wt) |
| 106 | +"Show me the cars with the best power-to-weight ratio, sorted from highest to lowest." |
| 107 | +
|
| 108 | +# Query #2 tests sorting and multi-column selection |
| 109 | +"Compare fuel efficiency (MPG) and horsepower for all cars, sorted by MPG." |
| 110 | +
|
| 111 | +# Query #3 tests aggregation functions with grouping |
| 112 | +"What's the average horsepower and MPG for automatic vs manual transmission cars?" |
81 | 113 |
|
82 | | -"How does natural gas production in the US compare to China over the next decade in WoodMac's base case?" |
| 114 | +# Query #4 tests more complex aggregation and grouping |
| 115 | +"Show me the relationship between number of cylinders and fuel efficiency with average MPG by cylinder count" |
83 | 116 |
|
84 | | -"Show me the top 5 countries by renewable energy growth in the next 5 years." |
| 117 | +# Query #5 tests limiting results and specific column selection |
| 118 | +"Find the top 5 cars with the highest horsepower and their quarter-mile time (qsec)" |
85 | 119 | ``` |
0 commit comments