Spaces:
Paused
Paused
A newer version of the Gradio SDK is available:
6.1.0
metadata
title: Schema Translator
emoji: π
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.0.0
app_file: app_gradio.py
pinned: false
license: mit
tags:
- llm
- database
- schema-translation
- natural-language-query
python_version: '3.12'
Schema Translator
An intelligent contract schema translation system that enables querying across multiple enterprise customers with heterogeneous database schemas using LLM-powered semantic understanding.
Prerequisites
- Python 3.10+
- UV package manager
- Anthropic API key
Setup Instructions
1. Clone the Repository
git clone <repo-url>
cd schema_translator_v2
2. Create Virtual Environment with UV
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
3. Install Dependencies
uv pip install -r requirements.txt
4. Configure Environment Variables
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY
5. Generate Mock Data
python -m schema_translator.mock_data
6. Run Tests
pytest tests/
7. Start the Application
chainlit run app.py
Project Structure
schema_translator_v2/
βββ README.md
βββ requirements.txt
βββ .env.example
βββ .gitignore
βββ databases/ # SQLite databases
βββ schema_translator/ # Main package
β βββ config.py # Configuration management
β βββ models.py # Pydantic data models
β βββ mock_data.py # Mock data generation
β βββ knowledge_graph.py # Schema knowledge graph
β βββ query_compiler.py # SQL generation
β βββ database_executor.py # Query execution
β βββ result_harmonizer.py # Result normalization
β βββ orchestrator.py # Main pipeline orchestrator
β βββ agents/ # LLM agents
β βββ learning/ # Learning and feedback
βββ tests/ # Test suite
βββ app.py # Chainlit application
Tech Stack
- Language: Python 3.10+
- LLM: Anthropic Claude (claude-sonnet-4-20250514)
- Database: SQLite
- UI Framework: Chainlit
- Data Validation: Pydantic
- Graph: NetworkX
- Testing: pytest
- Environment: python-dotenv
Development
Running Tests
pytest tests/ -v
Code Formatting
black schema_translator/ tests/
Linting
ruff check schema_translator/ tests/
Type Checking
mypy schema_translator/
License
See LICENSE file for details.