agent_crew icon indicating copy to clipboard operation
agent_crew copied to clipboard

RAG: Knowledge Base page with document upload and management

Open sre-helmcode opened this issue 8 months ago • 0 comments

Description

Create the Knowledge Base frontend page for managing RAG documents at the organization level.

Types (src/types/index.ts)

  • DocumentStatus: 'pending' | 'processing' | 'ready' | 'error'
  • KnowledgeDocument: id, name, file_name, file_size, mime_type, status, status_message, chunk_count, created_at, updated_at
  • KnowledgeStatus: qdrant_running, document_count, ready_count, processing_count, error_count, total_chunks, embedding_model

API Client (src/services/api.ts)

  • knowledgeApi.status() → GET /api/knowledge/status
  • knowledgeApi.listDocuments() → GET /api/knowledge/documents
  • knowledgeApi.uploadDocument(file) → POST /api/knowledge/documents (FormData)
  • knowledgeApi.deleteDocument(id) → DELETE /api/knowledge/documents/:id

Page (src/pages/KnowledgeBasePage.tsx)

  • Status bar: Qdrant indicator, doc count, total chunks, embedding model
  • Upload zone: Drag & drop / click. Accepted: .pdf, .txt, .md, .csv, .xlsx, .json (max 50MB)
  • Documents table: name, size, status badge, chunks, date, delete button
  • Auto-polling every 3s while docs are pending/processing

Navigation

  • Add "Knowledge" nav item in Layout.tsx
  • Add route /knowledge → KnowledgeBasePage in App.tsx

Acceptance Criteria

  • [ ] Knowledge page accessible via navigation
  • [ ] File upload works (drag & drop + click)
  • [ ] Document list shows all docs with correct status badges
  • [ ] Polling updates status in real-time
  • [ ] Delete works with confirmation
  • [ ] Vitest unit tests

sre-helmcode avatar Apr 01 '26 16:04 sre-helmcode