Natural language search module for JSON arrays, with AI Quickstart
Top 72.5% on sourcepulse
WishfulSearch enables natural language querying of JSON arrays, transforming complex questions into SQL queries for an embedded SQLite database. It's designed for developers needing to filter and retrieve data from structured JSON without writing manual query logic, offering a flexible, multi-model LLM approach.
How It Works
The core mechanism involves converting JSON objects into relational tables within an sql.js
SQLite database. An AI Quickstart feature analyzes a single JSON object to automatically generate the necessary DDL schema, object-to-relational mapping functions, and few-shot examples for LLM prompting. User queries are then enriched with context (schema, data samples, history) and sent to an LLM (GPT, Claude, Mistral) to generate SQL queries, which are executed against the database.
Quick Start & Requirements
npm i wishful-search
(server-side), or use the bundled wishfulsearch.js
(client-side).sql.js
WASM file URL is required.movies_metadata.csv
and running tests/movies.run.ts
.Highlighted Details
Maintenance & Community
This project is primarily maintained by a single developer. Community contributions for testing and development are welcomed.
Licensing & Compatibility
sql.js
.Limitations & Caveats
The project is marked as being for educational purposes and to be used at the user's own risk. Robust tests are noted as missing, and client-side testing is limited. Security is a concern, as LLM-generated queries can never be fully safe, and the system is best used where full database exposure isn't a security risk.
1 year ago
1 week