Hybrid analysis
Deterministic checks handle predictable issues while the LLM focuses on semantic inconsistencies.
Loading...
Built a focused data-cleaning workflow that combines deterministic CSV validation with LLM-assisted semantic analysis. Users can upload a CSV, review detected issues and AI suggestions, accept or reject changes, and export a cleaned dataset without allowing the model to modify source data automatically.
Next.js application using Papa Parse for CSV processing, deterministic validation for predictable data-quality checks, a server-side API route for OpenAI analysis with GPT-5.6 Luna, and Zod to validate structured AI responses before they reach the review interface.
Core Architecture Decisions
Deterministic checks handle predictable issues while the LLM focuses on semantic inconsistencies.
OpenAI responses are validated before entering application state.
Only approved suggestions are applied when generating the cleaned CSV.
Designed the complete CSV analysis and human-review workflow.
Separated deterministic validation from semantic LLM analysis.
Integrated OpenAI through a server-side API boundary with structured response validation.
Implemented accept and reject controls so AI suggestions never modify source data automatically.
Built cleaned CSV generation and export from approved user decisions.
Predictable checks such as missing values, duplicates, and format validation were handled deterministically. The LLM was reserved for contextual and semantic issues where rule-based validation was less effective.
The OpenAI integration returns structured findings that are validated with Zod before being exposed to the UI, reducing dependence on unstructured model responses.
AI recommendations are presented as suggestions rather than automatically applied changes. Users explicitly accept or reject each correction before the cleaned dataset is generated.
Deterministic CSV analysis remains useful independently of the LLM, preventing the core workflow from becoming entirely dependent on an external AI service.
Combining predictable data-quality rules with contextual AI analysis without duplicating responsibilities.
Constraining LLM output into a reliable structured format suitable for application logic.
Keeping AI suggestions useful while preserving explicit user control over every modification.
Designing a simple review experience for potentially noisy or ambiguous data-quality findings.
OpenAI credentials and model communication remain behind a server-side application boundary rather than being exposed to the browser.
Structured AI output is validated before it becomes application state, preventing malformed model responses from being trusted directly by the client.
Uploaded data is not modified automatically by the model. Cleaned output is derived only from corrections explicitly approved by the user.
Delivered a complete AI-assisted CSV cleaning workflow from upload through reviewed export.
Demonstrated a practical LLM integration where AI complements deterministic application logic instead of replacing it.
Created a public project that can be inspected through both the deployed application and source repository.
Separating deterministic logic, model communication, response validation, and user decisions made the AI feature easier to reason about and maintain.
LLM responses become significantly more useful in product workflows when they are constrained and validated like any other external integration.
For data-cleaning tasks, AI suggestions are more trustworthy when users can inspect and approve changes before they affect exported data.