--- title: ClientSphere RAG Backend emoji: 🤖 colorFrom: blue colorTo: purple sdk: docker sdk_version: "4.0.0" python_version: "3.11" app_file: app.py pinned: false --- # ClientSphere RAG Backend FastAPI-based RAG (Retrieval-Augmented Generation) backend for ClientSphere AI customer support platform. ## Features - 📚 Knowledge base management - 🔍 Semantic search with embeddings - 💬 AI-powered chat with citations - 📊 Confidence scoring - 🔒 Multi-tenant isolation - 📈 Usage tracking and billing ## API Endpoints - `GET /health/live` - Health check - `GET /kb/stats` - Knowledge base statistics - `POST /kb/upload` - Upload documents - `POST /chat` - Chat with RAG - `GET /kb/search` - Search knowledge base ## Environment Variables Required: - `GEMINI_API_KEY` - Google Gemini API key - `ENV` - Set to `prod` for production - `LLM_PROVIDER` - `gemini` or `openai` Optional: - `ALLOWED_ORIGINS` - CORS allowed origins (comma-separated) - `JWT_SECRET` - JWT secret for authentication ## Documentation See `README_HF_SPACES.md` for deployment details.