A submission for the Sanity Challenge β Path One: Ship an Agent That Queries Real Content
π¨ The Problem:
When an investigation depends on multiple sources, the difficult part isn't generating another AI answer.
It's knowing why the answer should be trusted.
A useful investigation agent needs to answer questions like:
- What does the source actually say?
- Which evidence supports this conclusion?
- Are two sources contradicting each other?
- Where did this particular claim come from?
- Can another person inspect the evidence behind the answer? That's what I built CrisisIQ to explore.
π§ What I Built:
CrisisIQ is an AI-powered investigation interface that turns source material into a structured investigation.
Instead of asking an LLM:
βWhat happened?β
and trusting whatever comes back, CrisisIQ is designed around:
SOURCE
β
SANITY KNOWLEDGE BASE
β
STRUCTURED CONTENT
β
AGENT QUERY
β
EVIDENCE + CLAIMS
β
INVESTIGATION RESULT
The important part is that the agent isn't operating on a pile of unstructured text.
It can work against content that has structure and provenance.
π The Interface:
The main interface is intentionally built like an investigation workspace rather than a generic chatbot.
You can see:
- active investigations
- evidence
- source information
- findings
- conflicting claims
- investigation status
The goal was to make the evidence trail part of the interface instead of hiding it behind the AI response.
π The Interesting Part: Sanity Context
This is where the project becomes a Path One project rather than simply an AI app.
I pointed Sanity Context at the content used by the investigation.
That content is distilled into a Knowledge Base that the agent can query through MCP.
Instead of manually dumping documents into the prompt, the agent can retrieve relevant structured content when it needs it.
Sanity
β
βΌ
ββββββββββββββββββ
β Knowledge Base β
βββββββββ¬βββββββββ
β
β MCP
βΌ
ββββββββββββββββββ
β CrisisIQ Agent β
βββββββββ¬βββββββββ
β
β relevant content
βΌ
ββββββββββββββββββ
β Investigation β
ββββββββββββββββββ
π§© Why Structure Matters:
This was the part I found most interesting.
A normal keyword search can often answer:
βFind documents mentioning X.β
But an investigation isn't always that simple.
Consider:
Source A
ββββββββ
"The incident started at 14:05."
Source B
ββββββββ
"The first alert appeared at 14:17."
Those aren't necessarily interchangeable facts.
CrisisIQ can preserve them as separate pieces of evidence instead of flattening everything into one generated paragraph.
That gives the agent something more useful to reason over:
Claim
βββ Evidence
β βββ Source
β
βββ Conflicting Evidence
βββ Source
That's the reason I wanted the content to be structured in the first place.
π€ What the Agent Actually Does:
The agent isn't just a chatbot sitting beside the content.
A typical investigation looks like:
User:
"What evidence supports the reported timeline?"
β
Agent queries Sanity Context
β
Relevant content retrieved
β
Agent identifies supporting evidence
β
Sources remain attached
β
CrisisIQ presents the investigation
The important part is the middle.
The agent retrieves the content instead of relying entirely on what was placed in its initial prompt.
βοΈ When Sources Disagree:
This is where I wanted the project to go beyond a simple RAG demo.
Suppose the Knowledge Base contains:
Claim A
Source A reports that the event occurred at 14:05.
Claim B
Source B reports that the first observed event was at 14:17.
CrisisIQ doesn't need to pretend one sentence magically resolves the disagreement.
Instead, the conflicting evidence can remain visible:
14:05 β Source A
14:17 β Source B
That makes the uncertainty part of the investigation rather than something the model quietly hides.
ποΈ The Data Model:
The structured content behind the experience looks roughly like:
Incident Case
β
βββ Incident ID
βββ Summary
βββ Severity
βββ Status
β
βββ Evidence[]
β βββ Detail
β βββ Source
β βββ Source URL
β βββ Confidence
β
βββ Timeline[]
β
βββ Findings[]
β βββ Finding
β βββ Reasoning
β βββ Sources
β
βββ Contradictions[]
βββ Claim A
βββ Claim B
βββ Resolution
This is important because the agent isn't simply retrieving a giant blob of text.
It is working with relationships between pieces of information.
π§ͺ A Real Investigation:
I started with a question that required information from the underlying content rather than something that could be answered from the UI itself.
Then the agent queried the available content.
The useful part was seeing the answer come back with the underlying information still connected to its source.
The final interface presents the result as an investigation rather than just a chat response.
π» The Code:
The project is open source:
CrisisIQ on GitHub
The important pieces are separated into:
CrisisIQ/
β
βββ api/
β βββ chat
β
βββ path-two/
β βββ schemaTypes/
β βββ src/
β βββ sanity.config.ts
β
βββ ...
The application handles the investigation experience, while Sanity handles the structured content layer.
π Demo:
Live demo:
Repository:
Srigouri08
/
CrisisIQ
AI-powered incident investigation agent using Gemini and Sanity Context MCP.
CrisisIQ
CrisisIQ is an incident investigation dashboard for turning scattered operational records into a clear, evidence-grounded investigation. It helps teams reconstruct what happened, compare conflicting accounts, and keep uncertainty visible instead of jumping to an unsupported root cause.
Case #001
The first dashboard case is fictional PulsePay β The 37-Minute Outage. Its timeline and evidence panels are demonstration content; the investigation agent does not receive those panels as evidence and determines conclusions from content retrieved through Sanity Context.
Investigation workflow
- Evidence retrieval: collect relevant source material through Sanity Context.
- Timeline reconstruction: arrange reported events into a sequence.
- Contradiction analysis: compare conflicting claims and the records that support or challenge them.
- Uncertainty detection: keep gaps and competing explanations visible rather than hardcoding a root cause.
Architecture
CrisisIQ β Gemini β Sanity Context MCP β Sanity Knowledge Base β evidence
The browser chat sends messages to POST /api/chat. Locally, Viteβ¦
Demo note: Some investigation functionality depends on the configured model/API credentials.
π§ What Sanity Changed About the Build:
The biggest thing I learned from this project is that retrieval isn't the interesting part by itself.
The interesting part is what happens when the retrieved information already has structure:
content
β
relationships
β
provenance
β
retrieval
β
reasoning
That gives the agent something much better to work with than a flat collection of documents.
π οΈ What I Would Improve Next:
There are still things I'd like to take further:
- richer source provenance
- more complex conflicting-claim resolution
- larger Knowledge Bases
- better investigation timelines
- stronger evaluation of retrieved evidence
- more automated investigation workflows
But the core experiment works:
Can an agent become more useful when it queries structured, source-linked content instead of treating the web or documents as one giant text box?
That's what I wanted to explore with CrisisIQ.
π Sanity Project Details:
Sanity Project ID:
0cub7gdo
Dataset:
production
Sanity Context:
CrisisIQ uses Sanity Context MCP to retrieve structured incident-investigation content from the Sanity Knowledge Base. The agent queries this content during investigations and uses the retrieved sources to compare evidence, identify conflicting claims, and ground its responses in the underlying Sanity content.



Top comments (0)