Seamlessly ingest, analyze, semantically search, and chat with your private documents using advanced Retrieval-Augmented Generation (RAG).
DocSense AI is a highly scalable, multi-modal knowledge engine designed to serve as your private, hyper-intelligent AI assistant. By allowing you to upload your personal or corporate knowledge bases (PDFs, URLs, YouTube videos, GitHub Repositories), it automatically extracts, processes, and embeds the data into a high-dimensional vector space using pgvector.
It utilizes Retrieval-Augmented Generation (RAG) powered by the Cohere Command-R LLM to provide highly accurate, hallucination-free answers backed by precise, clickable citations directly to your original source documents.
| 🚀 Feature | 💡 Description |
|---|---|
| Multi-Modal Ingestion | Support for PDFs, DOCX, TXT, Website URLs, YouTube Transcripts, and GitHub READMEs. |
| Smart Summaries | Automatically generates an AI summary, key topics, and keywords instantly upon file upload. |
| Omni-Search Modes | Find information across all your knowledge via Semantic, Keyword, or Hybrid search. |
| Interactive Citations | AI chat responses include smart citations. Click any citation to instantly open the exact page of the document! |
| Document Workspaces | Organize knowledge into specific collections (e.g., "College", "Interviews", "Work"). |
| Premium Aesthetic UI | Beautiful dark mode, custom glassmorphism, perfectly scaled vector graphics, and fluid Framer Motion animations. |
Extend the intelligence of DocSense AI directly into your browser!
The DocSense AI Companion is a dedicated Chrome Extension that bridges the gap between your web browsing and your private knowledge base.
- ⚡ Seamless Ingestion: Instantly save the current webpage, article, or selected text straight to your DocSense AI backend with a single click.
- 🔍 Contextual Search: Highlight any text on any webpage to quickly run a semantic search against your private documents.
- 🔗 Source Code & Installation: Check out the dedicated repository here: DocSense-Companion on GitHub
graph TD
A[Next.js Client] -->|REST API| B[FastAPI Backend]
B --> C[(PostgreSQL + pgvector)]
B --> D[Cohere API]
subgraph AI Processing Pipeline
E[Document Upload] --> F[Extraction Service]
F --> G[LangChain Text Splitter]
G --> H[Cohere embed-english-v3.0]
H --> I[Vector DB Storage]
end
B -.-> E
- Extraction: Specialized parsers (
PyMuPDF,youtube-transcript-api,beautifulsoup4) cleanly extract raw text. - Summarization: Cohere generates an initial metadata analysis (summaries, key topics) for instant UI feedback.
- Chunking: Text is intelligently split using
LangChain's RecursiveCharacterTextSplitter with contextual overlaps. - Embedding: Chunks are vectorized using Cohere's state-of-the-art
embed-english-v3.0model. - Retrieval:
pgvectorexecutes blazing-fast cosine similarity searches to retrieve the most relevant contextual snippets. - Generation: Cohere's
command-r-08-2024synthesizes the retrieved context and user query to formulate accurate answers with strict source tracking.
Next.js 15 (App Router) • TypeScript • Tailwind CSS • Framer Motion • Radix UI
FastAPI • PostgreSQL (asyncpg) • pgvector • SQLAlchemy 2.0 • JWT Auth
Cohere Command-R • Cohere Embed v3 • LangChain
- Node.js 18+
- Python 3.10+
- Docker & Docker Compose
Start the PostgreSQL database with the pgvector extension pre-installed:
docker-compose up -dcd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Create the environment file and fill in your keys
cp .env.example .envRequired Backend Environment Variables (backend/.env):
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/knowledge_engine
JWT_SECRET_KEY=your_super_secret_key
COHERE_API_KEY=your_cohere_api_key
UPLOAD_DIR=./uploads
MAX_FILE_SIZE=52428800
EMBEDDING_MODEL=embed-english-v3.0
LLM_MODEL=command-r-08-2024Start the FastAPI server:
uvicorn app.main:app --reloadcd frontend
npm installRequired Frontend Environment Variables (frontend/.env.local):
NEXT_PUBLIC_API_URL=http://localhost:8000Start the Next.js dev server:
npm run devNavigate to http://localhost:3000 to access the platform!
docsense-ai/
├── frontend/ # Next.js 15 Application
│ ├── src/app/ # App Router Pages & Layouts
│ ├── src/components/ # Reusable UI & Glassmorphism Components
│ └── src/lib/ # API & Auth Utilities
├── backend/ # FastAPI Application
│ ├── app/models/ # SQLAlchemy Async Models
│ ├── app/routers/ # API Route Handlers
│ ├── app/schemas/ # Pydantic Validation Models
│ └── app/services/ # Business Logic & AI RAG Pipeline
└── docker-compose.yml # Vector Database Configuration
- GraphRAG: Implementing Knowledge Graphs alongside vectors for complex multi-hop reasoning.
- Offline LLMs: Adding support for local execution via Ollama for complete data privacy.
- Visual PDF Integration: Integrating
react-pdfto visually highlight the exact paragraph matched inside the rendered document.