Technical
Corpus
The full knowledge command center for documents, folders, shared packages, forked corpora, websites, scrapers, stores, and document governance.
Public and internal interfaces
These are the main routes, handlers, and integration surfaces used by this product area.
GET /api/portal/corpus/stats
GET /api/portal/rag/documents
POST /api/portal/rag/upload
POST /api/portal/rag/url-import
GET /api/portal/corpus/packages
GET/POST/PATCH/DELETE /api/portal/corpus/folders
GET/POST /api/portal/corpus/scrapers
GET /api/portal/dms/documents/{id}
GET /api/portal/dms/versions/{id}
GET /api/portal/dms/audit
Architecture notes
- The main page is caveauai-web/src/pages/app/Corpus.tsx.
- DMS detail behavior is in caveauai-web/src/pages/app/DocumentDetail.tsx.
- Corpus data flows through ai-portal/api/portal/handlers/corpus.php, rag.php, dms.php, and sources.php.
- Existing markdown help lives in caveauai-web/src/help/corpus.
Access and permissions
App pages are authenticated through the shared bnl_session cookie unless explicitly marked public. Public docs should describe integration behavior without including secrets, private tokens, private IPs, or tenant-specific records.
Troubleshooting
- Pending status means parsing or indexing has not finished.
- Trash is soft-delete first; purge is a separate DMS action.
- If a scraper creates no documents, inspect source URL, crawl depth, and run logs.