
Overview
LiteDB is a modern, ultra-fast database viewer and editor built with Tauri and React. Designed as a privacy-first tool, it provides interactive schema visualization and transactional batch operations for PostgreSQL and SQLite. It features a Context-Aware RAG Pipeline that injects database schemas into local LLMs for highly accurate Text-to-SQL generation, alongside an on-device vector search engine for seamless semantic data exploration.
Architecture
The application leverages a Rust backend for efficient database driver integration and file system operations, communicating with a React frontend. The Context-Aware RAG pipeline actively introspects the connected database to format metadata for local Text-to-SQL inference, while Transformers.js handles in-app vector embedding generation.
Key Features
Ultra-Lightweight Architecture
Achieved a 5.4MB idle RAM footprint by migrating to Tauri and Rust, making it exponentially lighter than traditional Electron-based alternatives.
Context-Aware Text-to-SQL
Extracts table definitions and foreign keys to dynamically inject schema context into local models (Ollama) or cloud providers, drastically reducing syntax errors.
On-Device Vector Search
Executes privacy-first semantic matching using Transformers.js (ONNX) and local embedding models (BGE-Large), supporting Cosine, L2, and Inner Product metrics.
Interactive Schema Visualization
Generates dynamic Entity Relationship Diagrams (ERDs) with auto-layout, visual foreign key mapping, and one-click SVG/PNG export capabilities.
Tech Stack
Backend
Frontend
AI/ML
Database
Challenges & Solutions
Standard Text-to-SQL agents often generate invalid or hallucinated queries due to a lack of structural awareness.
Built a schema introspection system that extracts table structures and data types, injecting them directly into the LLM's system prompt based on the active database driver.
Validating RAG pipelines usually requires setting up complex external vector services, adding latency and privacy concerns.
Engineered an on-device Vector Search engine utilizing pgvector and ONNX, allowing developers to execute semantic matching locally without external API calls.
Maintaining and distributing a cross-platform desktop application manually is error-prone and time-consuming.
Built an automated CI/CD pipeline via GitHub Actions to cross-compile Rust binaries for Windows, macOS, and Linux, integrating an over-the-air (OTA) update system.