Intro:
I didn’t set out to build a tool.
I just wanted GPT to stop hallucinating when I asked it to join two tables.
That led me to spend late nights thinking about schemas, prompts, and how language models "see" structured data.
👨💻 What is USPL?
USPL (Unified Schema Prompt Layer) is a lightweight Python framework that turns natural language into SQL — specifically for multi-table relational databases — using GPT-3.5.
It helps GPT generate JOINs, understand foreign keys, and compose queries over normalized schemas.
It’s open source, documented in English & Traditional Chinese, and licensed under MIT.
👉 GitHub Repo
💡 Why I Built It
Language models are powerful, but they struggle with:
Schema complexity
Relational reasoning
JOIN logic across multiple tables
Even fine-tuned LLMs need better input.
I didn’t want to fine-tune a model.
I wanted to change the prompt — and prove that was enough.
So I designed a prompt format that compresses schema metadata into a clean, LLM-friendly JSON.
No sample data, just pure structure and meaning.
This became the core of USPL.
🧪 How It Works
User describes their schema (as a JSON unified prompt)
User asks a natural language question
GPT generates SQL
Python executes it
GPT summarizes the result in plain language
That’s it.
All without training, plugins, or special tooling.
📘 The Tech Stack
Python
OpenAI API (GPT-3.5-turbo)
SQLite (execution layer)
Dotenv / CLI interface
MIT License
🧠 What I Learned
Prompt design is data engineering.
GPT performs best when we remove ambiguity, not when we add more power.
Documentation matters.
Building in public makes me sharper.
🌸 Closing Thoughts
I’m TSAI PEI LIN, a fullstack engineer from Taiwan.
This project was made during my off-hours, driven by frustration, curiosity, and a love for structure.
If you work on AI + data tools, I’d love to connect.
Fork the repo, try it, break it — I’m happy either way.
USPL is not the end, it’s just the first layer.