diff --git a/frontend/src/app/rag/page.tsx b/frontend/src/app/rag/page.tsx index 836fe3d..97e682e 100644 --- a/frontend/src/app/rag/page.tsx +++ b/frontend/src/app/rag/page.tsx @@ -31,10 +31,22 @@ interface Collection { } interface CollectionStats { - total_collections: number - total_documents: number - total_size: number - active_collections: number + collections: { + total: number + active: number + } + documents: { + total: number + processing: number + processed: number + } + storage: { + total_size_bytes: number + total_size_mb: number + } + vectors: { + total: number + } } export default function RAGPage() { @@ -117,8 +129,8 @@ function RAGPageContent() { ) } - const formatBytes = (bytes: number) => { - if (bytes === 0) return '0 Bytes' + const formatBytes = (bytes: number | null | undefined) => { + if (!bytes || bytes === 0) return '0 Bytes' const k = 1024 const sizes = ['Bytes', 'KB', 'MB', 'GB'] const i = Math.floor(Math.log(bytes) / Math.log(k)) @@ -145,9 +157,9 @@ function RAGPageContent() { - {stats.total_collections} + {stats.collections.total} - {stats.active_collections} active + {stats.collections.active} active @@ -157,7 +169,7 @@ function RAGPageContent() { - {stats.total_documents} + {stats.documents.total} Across all collections @@ -169,7 +181,7 @@ function RAGPageContent() { - {formatBytes(stats.total_size)} + {formatBytes(stats.storage.total_size_bytes)} Total indexed content
- {stats.active_collections} active + {stats.collections.active} active
Across all collections
Total indexed content