How clusterzx/paperless-ai works
Paperless-AI is a web application that automates document metadata generation and adds manual review, configurable classification, and RAG-based search and chat for a Paperless-ngx archive. The main automated workflow scans Paperless documents, requests AI analysis, then updates document metadata and records processing state. In the RAG workflow, the web API delegates indexing and search to a Python service; question answering also retrieves document content and uses the configured AI provider. README capabilities are included, but links for unsampled setup, manual, and rules implementations are limited to what the tree and excerpts support.
Main entry points: server.js Application server · ragService.js RAG client · paperlessService.js Paperless client · aiServiceFactory.js AI service factory
Components 20
Document processing
- Application server
server.js - Paperless client
services/paperlessService.js - Processing records
models/document.js - Manual processing
services/manualService.js
Search and chat
- RAG API routes
routes/rag.js - RAG client
services/ragService.js - RAG index and search
main.py - Semantic index
main.py
AI providers
- AI service factory
services/aiServiceFactory.js - AI provider services
services
Web application
- RAG interface
public/js/chat.js - Manual processing UI
public/js/manual.js - Setup routes
routes/setup.js - Setup service
services/setupService.js - Settings interface
public/js/settings.js - Web views
views
Other components
- Scheduled scan
- Paperless-ngx
- AI model API
- Web user
Connections 19
- Scheduled scan → Application server: triggers scan
- Application server → Paperless client: fetches documents
- Paperless client → Paperless-ngx: reads and updates
- Application server → AI service factory: requests analysis
- AI service factory → AI provider services: selects provider
- AI provider services → AI model API: sends prompts
- Application server → Processing records: records processing
- Web user → RAG interface: asks or searches
- RAG interface → RAG API routes: submits request
- RAG API routes → RAG client: delegates request
- RAG client → RAG index and search: calls RAG API
- RAG index and search → Semantic index: indexes and searches
- RAG client → Paperless client: fetches source content
- RAG client → AI service factory: requests answer generation
- Web user → Manual processing UI: reviews documents
- Web user → Setup routes: configures application
- Setup routes → Setup service: delegates setup
- Web user → Settings interface: changes preferences
- Web user → Web views: uses interface