Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TAMustafa/Local_Chat_RAG
/ functions
Functions
46 in github.com/TAMustafa/Local_Chat_RAG
⨍
Functions
46
◇
Types & classes
21
↳
Endpoints
6
↓ 10 callers
Function
safe_log_gotcha
Log a gotcha, error, or operational event to gotchas.md in the project root. Appends timestamped entries for traceability and compliance.
backend/app/log_utils.py:5
↓ 1 callers
Function
Header
()
frontend/src/components/Layout/Header.tsx:5
↓ 1 callers
Method
_get_text_splitter
Use MarkdownHeaderTextSplitter if markdown, else fallback to RecursiveCharacterTextSplitter.
backend/app/rag/pipeline.py:31
↓ 1 callers
Function
chat_service
Handles chat logic: retrieves relevant docs (hybrid/vector/keyword/MMR), constructs prompt, calls LLM, logs history.
backend/app/services/chat_service.py:9
↓ 1 callers
Function
clear_all_service
Danger: Delete ALL files and chat history from DB and vectorstore. Requires admin-token.
backend/app/services/admin_service.py:8
↓ 1 callers
Function
deleteFile
(fileId: number)
frontend/src/api/filesApi.ts:25
↓ 1 callers
Function
fetchFiles
()
frontend/src/api/filesApi.ts:16
↓ 1 callers
Function
fetchHealth
()
frontend/src/api/healthApi.ts:2
↓ 1 callers
Function
getFileExt
(filename?: string)
frontend/src/components/Files/components/FilePill.tsx:6
↓ 1 callers
Function
get_db
()
backend/app/db/session.py:30
↓ 1 callers
Function
handleSend
()
frontend/src/components/Chat/components/ChatInput.tsx:18
↓ 1 callers
Method
ingest
Ingests a file using adaptive chunking (header-based for markdown, otherwise character-based).
backend/app/rag/pipeline.py:61
↓ 1 callers
Function
init_db
()
backend/app/db/session.py:14
↓ 1 callers
Function
loadFiles
()
frontend/src/components/Files/components/FilesSidebar.tsx:20
↓ 1 callers
Method
load_document
(self, file_path: str)
backend/app/rag/pipeline.py:44
↓ 1 callers
Method
retrieve
Hybrid retrieval: combines vector search, keyword, and metadata filtering. Always uses strict top-k retrieval (no MMR). :param query:
backend/app/rag/pipeline.py:77
↓ 1 callers
Function
sendChat
( optsOrFileId: ChatOptions | string | null, question?: string )
frontend/src/api/chatApi.ts:11
↓ 1 callers
Function
uploadFile
(file: File)
frontend/src/api/filesApi.ts:3
↓ 1 callers
Function
useFileUpload
()
frontend/src/components/Files/hooks/useFileUpload.ts:9
Function
AdminPanel
()
frontend/src/components/Admin/AdminPanel.tsx:7
Function
App
()
frontend/src/App.tsx:6
Function
ChatArea
()
frontend/src/components/Chat/components/ChatArea.tsx:9
Function
ChatBubble
({ message }: { message: ChatMessage })
frontend/src/components/Chat/components/ChatBubble.tsx:18
Function
ChatInput
()
frontend/src/components/Chat/components/ChatInput.tsx:8
Function
FileErrorAlert
({ error })
frontend/src/components/Files/components/FileErrorAlert.tsx:8
Function
FilePill
({ file, onDelete, deleting }: FilePillProps)
frontend/src/components/Files/components/FilePill.tsx:18
Function
FileUpload
()
frontend/src/components/Files/components/FileUpload.tsx:7
Function
FilesList
({ files, loading, deletingId, onDelete })
frontend/src/components/Files/components/FilesList.tsx:13
Function
FilesSidebar
()
frontend/src/components/Files/components/FilesSidebar.tsx:9
Function
LLMStatus
()
frontend/src/components/Layout/LLMStatus.tsx:4
Function
MainLayout
()
frontend/src/components/Layout/MainLayout.tsx:7
Method
__init__
:param vector_db_path: Path for ChromaDB persistence :param chunking_strategy: 'auto', 'header', or 'character'. If 'auto', use heade
backend/app/rag/pipeline.py:19
Function
chat
Chat endpoint: supports hybrid retrieval (keywords, metadata, MMR, k). Accepts ChatRequest body or legacy query params.
backend/app/main.py:190
Function
clear_all
Danger: Delete ALL files and chat history from DB and vectorstore. Delegates business logic to admin_service. Validates admin token length (8
backend/app/main.py:51
Function
delete_file
Delete a file: removes from DB and disk, attempts vectorstore cleanup. Delegates business logic to file_service for DB/disk, keeps vectorstore lo
backend/app/main.py:156
Function
delete_file
(file_id: int, db: Session = Depends())
backend/app/services/file_service.py:37
Function
generic_exception_handler
(request: Request, exc: Exception)
backend/app/error_handlers.py:22
Function
handleClearAll
()
frontend/src/components/Admin/AdminPanel.tsx:13
Function
handleDelete
(id: number)
frontend/src/components/Files/components/FilesSidebar.tsx:36
Function
health_check
Health check endpoint: verifies DB, vectorstore, and LLM health.
backend/app/main.py:68
Function
http_exception_handler
(request: Request, exc: HTTPException)
backend/app/error_handlers.py:9
Function
list_files
List all files in the database. Delegates business logic to file_service.
backend/app/main.py:139
Function
list_files
(db: Session = Depends())
backend/app/services/file_service.py:33
Function
sqlalchemy_exception_handler
(request: Request, exc: SQLAlchemyError)
backend/app/error_handlers.py:15
Function
upload_file
Upload a file and ingest into the RAG pipeline. Delegates business logic to file_service. Validates file extension against SUPPORTED_EXTENSIO
backend/app/main.py:116
Function
upload_file
(file: UploadFile = File(...), db: Session = Depends())
backend/app/services/file_service.py:14