docs: add B4 (RAG Corpus Management UI) to backlog in TASKS.md and current-wip.md

This commit is contained in:
gramps
2026-07-13 10:03:57 -07:00
parent 645d7e9d91
commit 0981017cde
2 changed files with 36 additions and 0 deletions
+35
View File
@@ -949,3 +949,38 @@ Run full test suite. All 26+ existing tests must continue to pass.
- Manual install docs remain alongside for bare-metal deployment - Manual install docs remain alongside for bare-metal deployment
**This task is only actionable after Tasks 815 (RAG eviction + AMQP cluster) are complete.** **This task is only actionable after Tasks 815 (RAG eviction + AMQP cluster) are complete.**
---
### B4 — RAG Corpus Management UI (Display, Edit, CRUD)
**Goal:** Provide a management interface in the UI to browse, search, edit, and delete individual entries in the Qdrant-backed RAG corpus.
**Backend — add to `routers/rag_admin.py`:**
| Method | Endpoint | Description | Auth |
|--------|----------|-------------|------|
| GET | `/api/rag/points` | Return paginated list of RAG points with payload (text, source, date). Supports `?offset=0&limit=50&search=` query params | Admin |
| GET | `/api/rag/point/{point_id}` | Return a single point with full payload | Admin |
| DELETE | `/api/rag/point/{point_id}` | Delete a single point from Qdrant | Admin |
| PATCH | `/api/rag/point/{point_id}` | Update a point's text payload (re-embed the new text) | Admin |
Helper functions for Qdrant scroll/delete/update go in `rag.py` or `eviction.py`.
**Frontend — add to `templates/index.html`:**
A "RAG" button in the admin UI (drawer or settings modal) that opens a management panel:
- **Stats bar**: vector count, max vectors, percent full, pinned sources
- **Search bar**: text input to search the RAG corpus by semantic similarity
- **Results table**: paginated list showing each vector's text snippet, source label, ingest date, retrieval count
- Click to expand full text
- Delete button per row (with confirmation)
- Edit button per row (inline text edit → re-embed on save)
- **Bulk actions**: flush all (existing `/api/rag/flush`) with confirmation
**Tests:**
- `tests/test_rag_admin.py` — cover new endpoints: list, get, delete, update, admin-enforcement
- Mock all Qdrant calls via monkeypatch
Run full test suite. All existing tests must continue to pass.**
+1
View File
@@ -13,6 +13,7 @@ All 15 tasks are done. Final commit: `f0689ac feat: Roadmap N — AMQP cluster n
- B1 — Context loss in follow-up questions (investigation) - B1 — Context loss in follow-up questions (investigation)
- B2 — Bang-prefixed (`!`) search routing - B2 — Bang-prefixed (`!`) search routing
- B3 — Docker distribution (planning doc at `docker.md`) - B3 — Docker distribution (planning doc at `docker.md`)
- **B4 — RAG Corpus Management UI (NEXT)** — browse, search, edit, delete individual RAG entries. Backend endpoints at `routers/rag_admin.py`, frontend panel in `templates/index.html`
- HTTPS / reverse proxy (Caddy) - HTTPS / reverse proxy (Caddy)
- Conversation search/filter and export tooling - Conversation search/filter and export tooling
- Keyboard shortcuts, retry button, source-link polish - Keyboard shortcuts, retry button, source-link polish