Skip to main content
Component: FileSearchToolsMixin Module: gaia.agents.tools.file_tools Import: from gaia.agents.tools.file_tools import FileSearchToolsMixin

Overview

FileSearchToolsMixin provides agent-agnostic file search and management operations shared across multiple agents (Chat, Code). Features intelligent multi-phase search, type-based file analysis, and grep-like content searching. Key Features:
  • 3-phase intelligent file search (CWD → common locations → deep scan)
  • Type-aware file reading (Python AST, Markdown structure, binary detection)
  • Grep-like content search across file systems
  • Directory search with depth control
  • Generic file writing with directory creation
Search Strategy:
  • Phase 0: Deep search current working directory (unlimited depth)
  • Phase 1: Search common locations (Documents, Downloads, Desktop) with depth limit
  • Phase 2: Deep drive/root search if still not found
  • Early termination on first match for speed

API Specification


Implementation Highlights

Python File Analysis


Testing Requirements

File: tests/agents/tools/test_file_search_mixin.py Key tests:
  • 3-phase search progression
  • File type detection and analysis
  • Python AST symbol extraction
  • Markdown structure parsing
  • Binary file detection
  • Grep content search
  • Directory creation on write
  • Large file handling

Usage Examples


FileSearchToolsMixin Technical Specification