Inspiration
As a developer, finding the correct information in extensive documentation can be time-consuming, especially when frameworks evolve rapidly and APIs change between versions. Developers often need to compare documentation, migration guides, API references, and release notes across multiple versions to understand what changed and which approach is correct.
This inspired me to build DevDocs Intelligence, an agentic AI-powered documentation assistant that makes technical knowledge easier to discover, understand, and connect. My goal was to go beyond a conventional chatbot by combining structured documentation with intelligent retrieval and live web search through SerpApi.
What it does
DevDocs Intelligence helps developers ask complex questions about Next.js and receive contextual, version-aware answers supported by relevant sources.
Key features include:
- AI-powered Q&A: Uses the Gemini API to understand technical questions and generate contextual responses.
- Structured documentation: Organizes knowledge into four content types: Documentation, API Reference, Migration Guide, and Release Note.
- Knowledge retrieval: Uses Sanity Knowledge Base and Sanity Context MCP to retrieve relevant information from interconnected documentation.
- Live web research: Uses SerpApi to retrieve web search results when current information or external sources are needed.
- Source-grounded answers: Presents relevant source references so developers can investigate the information behind an answer.
- Streaming responses: Delivers answers progressively for a more interactive experience.
The project’s content corpus contains 30 structured documents connected through 128 cross-document relationships, helping the system connect related APIs, documentation, migrations, and release notes.
How we built it
I built DevDocs Intelligence using a modern web stack and an agent-based retrieval architecture.
- Next.js and TypeScript: Power the frontend and application layer.
- Gemini API: Handles question understanding, tool selection, reasoning, and answer generation.
- Sanity CMS: Stores and manages structured technical documentation.
- Sanity Knowledge Base: Supports contextual retrieval from the documentation corpus.
- Sanity Context MCP: Provides a standardized interface through which the agent accesses relevant knowledge.
- SerpApi: Supplies live web search results to complement the existing documentation knowledge.
- Streaming API responses: Allow generated answers to appear progressively in the interface.
The system combines structured knowledge retrieval with live search when appropriate. Gemini can use the available tools to gather relevant evidence and synthesize an answer while keeping the sources distinguishable. The objective is to improve answer relevance and reduce the risk of unsupported claims rather than assume that AI-generated answers are always correct.
Challenges we ran into
One of the main challenges was designing a reliable retrieval workflow that connects related documentation without losing important version-specific details.
Other challenges included:
- Modeling documentation, APIs, migration guides, and release notes as separate but interconnected content types.
- Establishing meaningful relationships between documents so the agent can retrieve relevant context across topics.
- Integrating tool-based retrieval into the Gemini workflow while preserving the existing application architecture.
- Handling API failures, missing information, and cases where the available sources do not fully answer a question.
- Keeping source attribution clear when information comes from structured Sanity content and live web search.
- Managing API credentials securely and maintaining a stable, responsive user experience with streaming responses.
These challenges reinforced the importance of treating retrieval quality, source transparency, and error handling as core parts of an AI application—not just focusing on the generated response.
Accomplishments that we're proud of
I am proud to have built a documentation intelligence system that combines structured content management, knowledge retrieval, and an AI-powered conversational interface.
Some key accomplishments are:
- Created four custom Sanity content types for documentation, API references, migration guides, and release notes.
- Organized a corpus of 30 structured documents with 128 cross-document relationships.
- Integrated Gemini with Sanity-based retrieval tools through the agent workflow.
- Implemented streaming responses and source references in the user interface.
- Designed the architecture to combine existing knowledge with live web search through SerpApi.
- Validated important application flows, including type checking, production builds, and error handling during development.
Most importantly, the project explores how structured and interconnected technical knowledge can make an AI documentation assistant more useful than a chatbot that relies only on general model knowledge.
What we learned
Building DevDocs Intelligence taught me that a useful AI agent requires more than a powerful language model. It also needs a well-designed knowledge layer, reliable retrieval tools, clear source attribution, and careful handling of missing or conflicting evidence.
I learned how to structure technical content for retrieval, connect tools to a Gemini-based agent, work with Sanity Knowledge Base and MCP, and design a workflow that combines stored documentation with live search.
I also learned that version awareness is especially important for developer tools. A technically correct answer for one framework version may be misleading for another. Making source versions visible and explicitly acknowledging gaps in the available evidence are therefore important areas for continued improvement.
What's next for DevDocs Intelligence
The next goal is to make DevDocs Intelligence more reliable, comprehensive, and useful for everyday development.
Planned improvements include:
- Expanding the documentation corpus to cover more Next.js versions and additional frameworks.
- Improving live search and source selection through SerpApi.
- Making source versions, publication dates, and corpus revisions more visible wherever the available metadata supports it.
- Adding stronger evaluations for unsupported questions, conflicting sources, and missing target-version documentation.
- Improving retrieval relevance and reducing irrelevant or outdated context.
- Adding automated tests for tool selection, source attribution, and version-specific answers.
- Exploring repository-aware assistance that can connect documentation insights to a developer's actual codebase.
My long-term vision is to make DevDocs Intelligence a dependable research companion for developers—one that connects structured knowledge with live information and helps them make better technical decisions with transparent supporting evidence.
Built With
- aiagents
- geminiapi
- mcp
- nextjs
- rag
- sanitycms
- sanitycontextmcp
- tailwindcss
- typescript