# DocBrain

A self-hosted retrieval-augmented generation framework for teams that cannot send data to third-party APIs, with role-based access control, support for several LLM providers, and natural-language questions answered over uploaded tables via generated SQL.

DocBrain is a self-hosted RAG framework aimed at teams that need document question-answering without sending data to a third-party service; the vector store, ChromaDB, runs locally by default, and the only outbound dependency is the LLM API key the operator supplies for Gemini, OpenAI or Anthropic. It supports both document RAG, over PDFs, DOCX, TXT, Markdown and HTML with cited answers, and what it calls Table-Augmented Generation, where uploaded CSVs or Excel files are queried in plain English and answered through generated SQL; a query router picks between the two automatically based on content type.

Role-based access control provides three permission levels plus knowledge-base sharing with granular permissions, and an FAQ system lets curated question-and-answer pairs take priority over document search results. The stack has no LangChain or LlamaIndex dependency, and deploys with Docker Compose across a FastAPI API server, a Celery worker, MySQL, Redis and ChromaDB, with Pinecone available as an alternative vector store for production scale.

The web frontend lives in a separate repository.

Website: https://github.com/shivama205/DocBrain
