{"repo":"Zay-M3/NaturalSQL","free":true,"listed":false,"github":"https://github.com/Zay-M3/NaturalSQL","clone":"git clone https://github.com/Zay-M3/NaturalSQL.git","description":"NaturalSQL: Lightweight Python library that converts SQL schema into vector context so LLMs can generate more accurate SQL from natural language.","language":"TypeScript","stars":19,"topics":["chromadb","mysql","postgresql","rag","sql","sqlite","sqlserver"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"NaturalSQL Documentación en español: README SPANISH.md Lightweight library to convert your SQL database schema into a vector database, so LLMs can use real table/column context to generate more accurate SQL from natural language. Problem I wanted to interact with SQL databases through an LLM without pulling in large frameworks with many unrelated features. Solution NaturalSQL extracts your database schema, vectorizes it using a configurable backend ( chroma or sqlite ) and configurable embedding provider ( local or gemini ), then performs semantic retrieval to return relevant schema context for your LLM. Installation SQLite is included in the Python standard library. For Gemini, the current SDK is google-genai (import path: google.genai ). Use environment variables for API keys (e.g. GEMINI API KEY ), never hardcode secrets. Supported SQL engines - PostgreSQL - MySQL - SQL Server - SQLite Quick start Automatic cache The first search() call loads the embedding model ( 2-5s). Subsequent calls reuse the in-memory instance and typically run in 10-15ms. Similarly, build vector db() reuses existing vector storage when available ( forced reset=False ) to avoid unnecessary reindexing. E2E examples API NaturalSQL( kwargs) Creates an instance with DB and embedding configuration. Parameter Type Default Description --- --- --- --- db url str \\ None None Database connection URL db type str \"\" Engine: postgresql , mysql , sqlite , sqlserver db normalize embeddings bool True Normalize embed","default_branch":null,"files":null,"tree":[],"storefront":"/r/Zay-M3","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Zay-M3/NaturalSQL/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}