Add safe uploaded document clearing#17
Open
ar-amk wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the open Algora bounty for
[ISAAC-497] Implement an enhanced RAG Pipeline for Scientific/Research Workflows./claim #45
Bounty reference: https://algora.io/isaac/bounties/clq18zr98000ejs0gt0nv7gwu
Summary
/api/delete-collectionan explicitDELETEendpoint instead of allowing collection deletion through any request method.CHROMA_PATH, matching the upload route's Docker-friendly Chroma default, instead of hardcodedlocalhost.Why this helps the scientific RAG workflow
The app already lets users upload PDFs into the RAG collection, but there was no user-facing way to clear that uploaded document context. That makes document management brittle: stale research PDFs can continue influencing answers, and the only delete endpoint was unsafe and pointed at a different Chroma host than ingestion.
This PR keeps the scope small and reviewable: it improves document lifecycle control without overlapping the larger citation/chunking/reranking PRs already open.
Verification
From
ui/:npx vitest run __tests__/delete-collection.test.ts --reporter verbose npx prettier --check pages/api/delete-collection.ts components/Chatbar/components/ChatbarSettings.tsx components/Chatbar/components/ClearUploadedDocuments.tsx __tests__/delete-collection.test.ts npx tsc --noEmit --pretty false npm run lint -- --file pages/api/delete-collection.ts --file components/Chatbar/components/ChatbarSettings.tsx --file components/Chatbar/components/ClearUploadedDocuments.tsx --file __tests__/delete-collection.test.ts git diff --checkResults: