This is a submission for the Sanity Challenge, Path One: Ship an Agent That Queries Real Content
What I Built
I built REZ, a customer support agent for businesses.
If you sell anything online, you know the drill. The same questions hit your inbox every day. Where's my order? Can I return this? Do you ship to Canada? So you either answer them yourself or pay someone to sit in the inbox all day. The annoying part is that the answers are already on your website.
So I built an agent that reads the website for you and manages the information in a structured knoeledge base powered by sanity.
You paste your website link. REZ reads your pages and learns your products, prices and policies. Then it gives you one line of code to add to your site. From there, a chat bubble answers your customers day and night, and every answer shows the page it came from.
When REZ doesn't know something, it doesn't make it up. Refunds, complaints, anything it isn't sure about, it takes the customer's details and emails your team the whole conversation.
For a business, that means:
- Fewer repetitive emails, so your team spends its time on problems that actually need a person
- Customers get answers at 3am instead of waiting until Monday
- You can read and edit every answer REZ gives
- No made-up answers. If it's not on your site, REZ says so and hands it to you
Demo
Live app: https://rezagent.vercel.app
Video walkthrough: youtube link
Code
Temitope15
/
REZ
REZ learns your business and answers your customers for you, day and night. Anything it can’t handle comes straight to you.
REZ
REZ is a customer-support agent a business installs with one script tag. Give it a website URL and it:
- Reads the site with its own crawler (sitemap + links, respects robots.txt). Pages that arrive as an empty JavaScript shell are rendered in headless Chrome, so React/Vue/Angular sites work too.
- Extracts small, single-topic answers with Gemini into structured Sanity documents. Every answer keeps its source URL. When two pages disagree, the answer is flagged for the business to review.
- Builds a Sanity Context Knowledge Base from those documents (dataset source) and serves it to the agent through the Context MCP endpoint.
- Answers customers in an embeddable widget, cites its source, and refuses to guess.
- Escalates anything it can't resolve: a ticket document in Sanity plus an email to the business (SMTP) with the transcript and a drafted reply.
- Reports: every conversation, including tool calls, is saved to Sanity Context…
How I Used Sanity
When REZ reads a website, it doesn't just dump the pages somewhere. It breaks them into small answers, one topic each, and saves every answer as a document in Sanity with the page it came from. Fifteen pages of the Death Wish Coffee site turned into 41 answers like "Can I return coffee?" and "Do you ship to Canada?". If two pages disagree, the answer gets flagged so the owner can fix it.
I then point Sanity Context at those answers. Each business gets its own Knowledge Base built from a simple GROQ query:
*[_type == "knowledgeArticle" && business._ref == $businessId && enabled != false]
This is the part I like most. Because the Knowledge Base is built from my documents and not the raw website, the owner stays in control. They edit an answer in the dashboard, click "Push edits", and the agent knows the new answer. They turn an answer off, and the agent stops using it. Sanity also sorted the 41 answers into topics on its own, like returns, shipping and subscriptions.
When a customer asks a question, the agent uses the Context MCP tools. It calls initial_context to see what the Knowledge Base covers, knowledge_base_search to find the right topic, and knowledge_base_read to read the full answer. Then it replies in a few sentences and names its source. I added one tool of my own, escalate_to_human, for when the answer isn't there.
Everything happens from code with @sanity/client, so a business signs up through a form and gets a working Knowledge Base without me touching anything. Every conversation is also saved to Sanity Insights, so the owner can see which questions REZ struggled with and what to add next.
A plain keyword search would answer "can I return coffee?" with a whole help page. REZ answers with the one rule that applies, including the catch that coffee can't be returned, and tells you where it found it.
What's not there yet: the free plan allows two Knowledge Bases, so extra businesses fall back to a simpler search. When the team replies to an escalation, the reply goes by email, not back into the chat.
Sanity Project Details
-
Project ID:
wtwf6oam -
Dataset:
production(public). Browse the articles -
Knowledge Base: Death Wish Coffee support (
kb9xFlYaxFwv), dataset source overknowledgeArticledocuments -
Context MCP endpoint:
rez -
Document types:
business,sourcePage,knowledgeArticle,ticket

Top comments (7)
Excellent project. The balance between automated scraping/MCP tooling and keeping the owner in control with editable Sanity docs is spot on. Solid build for the challenge!
You rock!
🔥🔥🔥
Feeling the build ..hehehe
Nice work
Very interesting
Great build
Thank you ser!