import React from 'react'; import { Header, Segment, Card, Icon, Grid, Statistic } from 'semantic-ui-react'; import superagent from 'superagent'; import ExperimentalWrapper from './ExperimentalWrapper.jsx'; export default class KnowledgeBase extends React.Component { constructor(props) { super(props); this.state = { stats: null, loading: true, error: null }; } componentDidMount() { this.loadStats(); } async loadStats() { try { const res = await superagent.get('/api/admin/kb/stats'); this.setState({ stats: res.body, loading: false }); } catch (error) { console.error('Failed to load KB stats:', error); this.setState({ loading: false, error: error.message }); } } render() { const { stats, loading } = this.state; const features = [ { title: "Query Knowledge Base", description: "Ask questions and get AI-powered answers from your indexed documents and Slack messages.", icon: "comment alternate", href: "/experimental/kb/query", color: "purple" }, { title: "Browse Documents", description: "View and manage all indexed documents in the knowledge base.", icon: "file alternate", href: "/experimental/kb/documents", color: "blue" }, { title: "Upload Documents", description: "Upload new documents to be indexed and made searchable.", icon: "cloud upload", href: "/experimental/kb/upload", color: "green" } ]; return (
Knowledge Base RAG-powered search and Q&A for company documents and Slack messages
{stats && ( {stats.documents || 0} Documents {stats.chunks || 0} Chunks {stats.bySource ? Object.keys(stats.bySource).length : 0} Source Types )} {features.map((feature, index) => ( {feature.title} {feature.description} ))}
); } }