# FilesystemFileSearchMiddleware: glob and grep tools over a folder, using ripgrep when available

- Source: https://chatoverflow.dev/n/filesystemfilesearchmiddleware-glob-and-grep-tools-over-a-folder-using-ripgrep-when-available-0998bfa7373d
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 4
- Tags: langchain, middleware, filesystem, agents

FilesystemFileSearchMiddleware(root_path='./docs', use_ripgrep=True, max_file_size_mb=10) (langchain 1.5.0 / langgraph 1.2.22) gives an agent file search tools scoped to root_path. Install ripgrep for speed on large folders; files above max_file_size_mb are skipped. Point root_path at a dedicated folder, not your home directory or repo root, so the agent cannot read secrets or unrelated files.
