What I Built
AutoFix Knowledge Agent is an intelligent automotive diagnostics and spare parts compatibility advisor powered by Sanity's Structured Content Lake and high-speed LLM reasoning.
In automotive maintenance, a simple keyword search or hallucinated AI response can lead to expensive or hazardous errors (e.g., purchasing a spark plug with the wrong thread pitch, electrode gap, or heat rating for a modern engine).
This agent solves this by using Sanity as the single source of truth, establishing relational integrity between vehicle models, spare parts, and OBD-II diagnostic troubleshooting guides.
Submission Details & Mandatory Identifiers 📌
-
Sanity Project ID:
tftsdpi3 -
Dataset:
production -
Public Dataset URL:
https://tftsdpi3.api.sanity.io/v2024-03-01/data/query/production?query=*[_type in ["vehicle","part","troubleshoot"]] - Live Demo: https://sanity-autofix-agent.vercel.app
- Source Code (GitHub): https://github.com/abdulrahman-maslmany/sanity-autofix-agent
Why Structured Content Was Crucial
Traditional RAG systems that rely solely on flat, chunked vector search struggle with negative constraints and multi-hop compatibility logic.
With Sanity's TypeScript schemas, we structured:
-
Vehicles:
name,make,year,engineType. -
Spare Parts:
partNumber,title,specifications, and explicit Reference Arrays (compatibleVehicles[]->name). -
Troubleshooting Guides:
errorCode(e.g.P0300), symptoms, solutions, and related replacement parts.
When a user asks: "Is SK16R11 compatible with Toyota Camry 2023?", the agent queries the relational graph via GROQ:
groq
{
"vehicles": *[_type == "vehicle"]{ name, make, year, engineType },
"parts": *[_type == "part"]{
partNumber,
title,
specifications,
"compatibleVehicles": compatibleVehicles[]->name
},
"troubleshooting": *[_type == "troubleshoot"]{
errorCode,
symptoms,
solution,
"relatedParts": relatedParts[]->{ partNumber, title }
}
}
Because the relational reference for SK16R11 strictly points to Toyota Corolla 2020, the AI agent reasons that it is strictly incompatible with the Toyota Camry 2023, preventing user error with 100% accuracy.
Screenshots
Tech Stack
Content Platform: Sanity.io Studio v3 & Content Lake
Query Language: GROQ
Frontend & API: Next.js 15 (App Router, Tailwind CSS, Lucide Icons)
AI Engine: Groq Cloud Llama API / OpenAI-compatible endpoint
Deployment: Vercel
Conclusion & Learnings
Building on Sanity's Content Lake made modeling complex multi-entity relationships effortless. Combining GROQ with AI agents unlocks reliable, zero-hallucination domain experts.


Top comments (0)