agent_crew
agent_crew copied to clipboard
RAG: Knowledge Base page with document upload and management
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_atKnowledgeStatus: 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/statusknowledgeApi.listDocuments()→ GET /api/knowledge/documentsknowledgeApi.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