| """Knowledge base management API endpoints.""" | |
| from fastapi import APIRouter, Depends | |
| from sqlalchemy.ext.asyncio import AsyncSession | |
| from src.db.postgres.connection import get_db | |
| from src.middlewares.logging import get_logger, log_execution | |
| logger = get_logger("knowledge_api") | |
| router = APIRouter(prefix="/api/v1", tags=["Knowledge"]) | |
| async def rebuild_vector_index( | |
| user_id: str, | |
| db: AsyncSession = Depends(get_db) | |
| ): | |
| """Rebuild vector index for a user (admin endpoint).""" | |
| # This would re-process all documents | |
| # For POC, we'll skip this complexity | |
| return { | |
| "status": "success", | |
| "message": "Vector index rebuild initiated" | |
| } | |