feat(api): add DELETE /ingest to reset the Qdrant collection - #14
Merged
Conversation
/ingest upserts under random UUID point ids, so nothing deduplicates across repeated calls -- a caller re-ingesting the same corpus (e.g. an external eval harness before an authoritative run) needs a way to wipe back to a clean, single-ingest index. QdrantStore.reset() deletes and recreates the collection; the new endpoint is scoped to the vector collection only, leaving BM25, the semantic cache, and the retrieval-by-id store untouched.
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.
Summary
Inti's eval harness (
konjoai/inti) discovered that every prior Gate A run had been running against an accumulating, un-deduplicated Qdrant index β/ingestupserts under random UUID point ids, so nothing deduplicates across repeated ingests (362 points for a 30-case corpus after three sprints of re-ingesting the same corpus). This PR adds the reset capability Kyro was missing, scoped narrowly per Wes's decision: an automated reset endpoint, not tenant isolation or a documented manual step.QdrantStore.reset()(konjoai/store/qdrant.py) β deletes and recreates the collection, returns the point count removed.DELETE /ingest(api/main.py) β wipes the Qdrant collection/ingestwrites to and returns{points_removed}. Scoped to the vector collection only: the BM25 index, semantic cache, and retrieval-by-id store are untouched.Pipelineprotocol gainsreset(); the existing_StubPipelinetest double inapi/test_api.pygets a matching stub.Test plan
python3 -m pytest api/test_api.py tests/unit/test_auth.py -qβ 47 passed, including the two new tests (test_reset_invokes_pipeline_reset_and_reports_points_removed,TestQdrantStoreTenantScoping::test_reset_deletes_and_recreates_the_collection, which mocks the Qdrant client the same way the existing tenant-scoping tests in that class do)ruff check/ruff format --checkclean on all changed filesdry_check.pyβ no new DRY violations (the one pre-existing hit is indashboard/src/lib/api.ts, unrelated to this change)Generated by Claude Code