# DocChat

A RAG application that turns any documentation URL into a searchable, chat-based knowledge base, scraping and indexing the site and answering questions with source-backed citations.

DocChat lets a user chat with any documentation site: given a URL, it recursively crawls the site's internal pages, respecting robots.txt, and converts the content into a searchable knowledge base. The backend is a React frontend talking to an Express server, which orchestrates background indexing jobs through BullMQ on Redis and stores embeddings in Qdrant with metadata in PostgreSQL.

It supports two retrieval modes: a vector mode that embeds text chunks through OpenRouter and stores them in Qdrant for semantic search, and a vectorless TreeIndex mode that builds a structural tree of the documentation and retrieves nodes directly from it without embeddings, suited to resource-constrained or offline-friendly setups. When a documentation URL has already been indexed, its existing Qdrant collection or TreeIndex tree is reused, giving other users instant chat access to the same knowledge base.

Additional features include optional long-term memory through Mem0 that captures user profile context across sessions, per-user daily token budget limits tracked in Redis, and audit logging of administrative actions, model usage, and ingestions.

Website: https://avishek.short.gy/docchat
