Static documentation is a known pain point in modern engineering, often leading to developer velocity drains and hallucination-prone generic AI queries. Malawige Inusha Thathsara Gunasekara has entered the fray with DocuMind, a submission for the Sanity Challengeβs Path One track that transforms scattered technical publications into an interactive, grounded AI agent. The system unifies DEV.to posts and internal wikis into a dynamic conversational partner, powered by Next.js 15, Sanity CMS Content Lake, and Google Gemini AI.
Grounded Retrieval Architecture
DocuMind avoids the common pitfall of relying on general model weights by implementing a strict Retrieval-Augmented Generation (RAG) pipeline. When a user submits a query, the server extracts high-signal semantic tokens and executes a GROQ query against the Sanity Content Lake. This retrieves the top four most relevant articles based on keyword matches in titles, descriptions, and tags. Google Gemini is then constrained to answer strictly using this retrieved context, ensuring that if a concept is missing from the knowledge base, the model explicitly acknowledges the gap rather than hallucinating an answer.
Automated Bidirectional Synchronization
The agent isn't a static snapshot; it features a robust synchronization engine. Gunasekara implemented a real-time webhook receiver that ingests newly published DEV.to Markdown and converts it into structured Sanity Portable Text blocks. This process is supported by an on-demand sync button in the UI and an automated GitHub Action that runs background reconciliation every six hours. This ensures the AIβs knowledge base remains current with the latest architectural decisions and API schemas without manual intervention.
Verifiable Source Attribution
Trust in AI outputs requires transparency, and DocuMind delivers this through verifiable source attribution. Every response generated by the agent includes clickable Source Cards that link directly to the full Sanity-backed article reader. This allows developers to cross-check claims against the original text immediately. The architecture treats Sanity as the single source of truth, using a custom Markdown-to-PortableText engine to parse headings, lists, and code blocks into valid Sanity block specs, preserving syntax highlighting and structure.
Key Takeaways
- DocuMind uses GROQ queries to retrieve exact Portable Text blocks, constraining Gemini to prevent hallucinations.
- Automated synchronization via webhooks and GitHub Actions keeps the knowledge base updated every six hours.
- Every AI response includes clickable Source Cards linking to the original Sanity-backed documentation.
- The project leverages Google Antigravity IDE for architecture planning and automated testing of the RAG pipeline.
The Bottom Line
This is how you build a useful agent: by grounding it in structured, verifiable data rather than letting it freestyle. DocuMind proves that combining Sanityβs structured content model with Geminiβs reasoning capabilities can solve real documentation fragmentation issues without the usual AI slop.