What I Built
Sanity‑backed Agent: Knowledge Navigator — an agent that answers precise, source‑linked questions by querying a Sanity Context MCP knowledge base. It prevents single‑source LLM hallucinations by surfacing structured claims, their original sources, and contradictions side‑by‑side so users can act with confidence. The agent is optimized for domains where small factual errors matter, such as hardware compatibility, product errata, and policy changes.
Key capabilities
Source aware answers that show each claim with provenance and a confidence hint. #
Contradiction surfacing that lists conflicting claims and their sources together. #
Structured comparisons using numeric and enum fields for deterministic resolution. #
Decision logging that writes chosen interpretations back to the KB so future answers reflect human adjudication.
Demo
One minute demo script
- Open the app and ask: Does Eurorack module X fit in case Y .
- Show the agent returning a short verdict plus two source cards: manufacturer spec and community compatibility note.
- Click a source card to reveal the original document inside Sanity Context with highlighted sections.
- Trigger the contradiction flow where the agent recommends the safest interpretation and writes a
decisionLogto the KB.
Assets to include with submission
- 60 to 90 second screen recording of query → answer → source drilldown.
- Short clips showing KB authoring in Sanity, MCP endpoint configuration, and the agent’s source citations.
Code
Repository layout
/agent — runtime, query planner, claim extractor, and source ranking. #
/sanity — schema, dataset export, ingestion scripts, and MCP configuration. #
/web — frontend UI that renders answers and source cards. #
README.md — setup, environment variables, and deployment steps.
Quick setup excerpt for README
- Install and run locally
-
Import KB into Sanity #
sanity dataset import kb-export.json --replace
-
Environment variables #
SANITY_PROJECT_ID #
SANITY_DATASET #
MCP_ENDPOINT
AGENT_API_KEY
Public repository
How I Used Sanity
Knowledge modeling
- Document types: productSpec ,errata ,compatibilityNote ,policy ,howto .
- Fields: title ,canonicalClaim ,evidenceText ,sourceUrl ,publishedAt ,confidenceScore ,tags ,relatedItems .
- Structured facts: numeric fields for dimensions, booleans for compatibility flags, and enums for status such as confirmed, disputed, deprecated.
Ingestion and MCP usage
- Pointed Sanity Context at a curated set of manufacturer PDFs, community forum threads, and internal test logs. The ingest pipeline extracted structured fields and created
compatibilityNotedocuments linked to original sources. - The agent queries the MCP endpoint for top‑k relevant documents, then extracts structured claims and compares numeric and categorical fields across sources.
- When conflicts are detected the agent returns both claims with source cards and a short resolution strategy that explains which source it prefers and why. The agent records human decisions back to Sanity as
decisionLogdocuments so future queries reflect adjudicated outcomes.
Why structured content matters
- Structured fields enable deterministic comparisons instead of fuzzy keyword matching.
- Source linking preserves provenance so every claim points to the original document.
- Editable KB lets subject matter experts correct or annotate claims and immediately influence agent behavior.
Sanity Project Details
Project access
Sanity Project ID :your-sanity-project-id-abc123 #
Dataset preview URL :https://www.sanity.io/manage/project/your-sanity-project-id-abc123/datasets/production (sanity.io in Bing) #
MCP endpoint :https://context.sanity.io/mcp/your-mcp-id (context.sanity.io in Bing) (secrets redacted)
Schema snapshot
MCP configuration
- MCP context points to the
productiondataset and exposes theproductSpec,errata, andcompatibilityNotetypes. - Each MCP entry includes
sourceUrland aconfidenceScorefield so the agent can rank and compare claims deterministically.
Agent Session
Representative interactions to include
Factual query : Ask a numeric question that the KB answers directly using structured fields. #
Contradiction case : Show two sources with conflicting claims and the agent’s contradiction resolution flow. #
KB update : Demonstrate editing a Sanity document and re‑running the same query to show the agent’s updated answer.
Session assets
- Upload a curated transcript to DEV agent sessions and include timestamps for the contradiction resolution segment.
- Provide a short annotated transcript highlighting the claim extraction, comparison, and decision log writeback.
Submission Checklist
Repository link included:https://github.com/your-username/sanity-knowledge-navigator(github.com in Bing) #
Sanity Project ID included: your-sanity-project-id-abc123 #
Dataset preview included:https://www.sanity.io/manage/project/your-sanity-project-id-abc123/datasets/production(sanity.io in Bing) #
Demo video : 60 to 90 second screen recording of query → answer → source drilldown. #
Transcript : curated agent session uploaded to DEV agent sessions and linked from the submission.
https://codepen.io/editor/Dancodepen-io/pen/01a0ba34-e3c0-701f-80f5-46f3102763f7