Labsco
codewithyasho logo

RAGify Docs

β˜… 1

from codewithyasho

A Developers Tool β€” Scrape entire documentation recursively and ask questions using AI

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

πŸ“š RAGify Docs API & MCP Server

<div align="center">

A Developer's Tool for Interactive Documentation

Scrape entire documentation recursively and ask AI-powered questions using Retrieval-Augmented Generation (RAG)

Python FastAPI LangChain Groq MCP

</div>

🎯 Overview

RAGify Docs is a comprehensive tool that helps developers quickly navigate and understand documentation by combining web scraping, vector embeddings, and AI-powered question answering. Instead of manually reading through documentation, simply provide a URL and ask questionsβ€”RAGify will find the most relevant answers backed by actual documentation content.

✨ Key Features

  • πŸ•·οΈ Recursive Web Scraping - Automatically traverse and extract content from entire documentation websites
  • 🧠 Vector Embeddings - Convert documentation into semantic embeddings using HuggingFace models
  • 🎯 Smart Retrieval - Use Max Marginal Relevance (MMR) to fetch diverse and relevant context
  • πŸ€– AI-Powered Answers - Leverage Groq's fast language models for accurate responses
  • ⚑ Intelligent Caching - Reuse embeddings across multiple queries on the same documentation
  • πŸ”Œ Multiple Interfaces - Access via REST API, MCP Server, or direct Python module
  • πŸ“ Source Attribution - Get links to the exact documentation pages used to answer your questions
  • πŸš€ Production-Ready - Built with FastAPI and async support for scalable deployments

πŸ—οΈ Project Structure

Copy & paste β€” that's it
RAGify-Docs-API/
β”œβ”€β”€ main.py              # Core RAG engine - documentation scraping & question answering
β”œβ”€β”€ app.py               # FastAPI REST API server
β”œβ”€β”€ mcp_server.py        # MCP (Model Context Protocol) server for Claude/AI integrations
β”œβ”€β”€ pyproject.toml       # Project metadata and dependencies
β”œβ”€β”€ requirements.txt     # Python package requirements
└── README.md            # This file

Component Architecture

Copy & paste β€” that's it
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    RAGify Docs API                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  FastAPI     β”‚  β”‚  MCP Server  β”‚  β”‚   Python    β”‚  β”‚
β”‚  β”‚  (/ragify)   β”‚  β”‚ (ask_docs)   β”‚  β”‚   Module    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚         β”‚                 β”‚                  β”‚         β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚
β”‚                           β”‚                           β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚                    β”‚   main.py    β”‚                   β”‚
β”‚                    β”‚  (RAG Core)  β”‚                   β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚                           β”‚                           β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚
β”‚         β”‚                 β”‚                 β”‚         β”‚
β”‚    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”‚
β”‚    β”‚ Scraper β”‚      β”‚ Embeddings β”‚   β”‚    LLM   β”‚  β”‚
β”‚    β”‚ (URL)   β”‚      β”‚  (HF)      β”‚   β”‚  (Groq) β”‚  β”‚
β”‚    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β”‚
β”‚         β”‚                 β”‚                β”‚       β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β”‚                           β”‚                        β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚                    β”‚ Cache Storage β”‚              β”‚
β”‚                    β”‚    (In-Mem)   β”‚              β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚                                                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ API Reference

FastAPI Endpoints

POST /ragify

Ask a question about documentation.

Request:

Copy & paste β€” that's it
{
  "url": "https://docs.example.com",
  "query": "How do I get started?"
}

Response:

Copy & paste β€” that's it
{
  "answer": "To get started with Example...",
  "sources": [
    "https://docs.example.com/getting-started",
    "https://docs.example.com/installation"
  ]
}

Status Codes:

  • 200 - Success
  • 500 - RAG initialization or invocation error

GET /

Health check and welcome message.

Response:

Copy & paste β€” that's it
{
  "message": "Welcome to the RAGify Docs API! Use the /ragify endpoint to ask questions about documentation."
}

MCP Tool: ask_docs

Accessible through MCP clients (Claude, etc.)

Parameters:

  • url (string): Documentation URL to scrape
  • query (string): Question to ask

Returns:

Copy & paste β€” that's it
{
  "answer": "...",
  "sources": ["url1", "url2"]
}

Or on error:

Copy & paste β€” that's it
{
  "error": "Error message"
}