Backend Architecture (FastAPI) Overview The backend is a FastAPI application located in . It powers the chatbot and RAG functionality. Entry Point - File : - Run : (or via ) - Port : Defaults to . Endpoints - Purpose : Main RAG chat endpoint. - Input : (query, history, user context). - Process : 1. Embed query. 2. Search Qdrant ( ). 3. Build prompt ( ). 4. Generate Agent response. - Output : (answer, contexts). - Purpose : Targeted Q&A on selected text. - Input : (question, selected text). - Process : 1. Validates selection length. 2. Builds selection-specific prompt. 3. specific Agent instru…