Skip to content

Implement watchdog client and automatic file indexing - #14

Closed
Aryan-Ranga wants to merge 1 commit into
GDGVIT:devfrom
Aryan-Ranga:feature/watchdog
Closed

Implement watchdog client and automatic file indexing#14
Aryan-Ranga wants to merge 1 commit into
GDGVIT:devfrom
Aryan-Ranga:feature/watchdog

Conversation

@Aryan-Ranga

Copy link
Copy Markdown
Contributor

This PR implements the first version of the automatic file indexing pipeline using a Watchdog client. The backend now supports real-time synchronisation between the local filesystem and the indexed document database.

Features Implemented
Added a standalone Watchdog client to monitor user-selected folders.
Implemented startup scanning to index existing files in watched folders.
Added automatic handling of:
File creation
File modification (re-indexing)
File deletion
File rename/move
Added REST endpoints for:
Uploading files for background indexing
Deleting files by file path
Renaming tracked file paths
Managing watched folders
Added a WatchedFolder database model and API.
Preserved the original filesystem path during indexing instead of storing temporary upload paths.
Added hash-based checks to avoid unnecessary re-indexing during the initial folder scan.
Added support for processing ZIP archives by extracting and indexing their contents.
Implemented event debouncing in the Watchdog client to reduce duplicate indexing triggered by rapid filesystem events.
Added background indexing using FastAPI background tasks.

Testing
Verified the following workflow:

Existing files are indexed during startup.
Newly created files are indexed automatically.
File modifications trigger re-indexing.
File deletions remove indexed records.
File renames update the stored file path.
ZIP archives are extracted and processed successfully.
Indexed files are visible through the /files API.

Notes
Embedding generation currently loads models synchronously and can be slow when indexing many files. Optimising the embedding pipeline and model lifecycle is planned separately.
Support for filtering unsupported file types will be added in a future PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant