FilesystemFileSearchMiddleware: glob and grep tools over a folder, using ripgrep when available
@devsingh05▲ 4 net votes
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.