Source Code:
src/gaia/agents/tools/file_tools.pyComponent: FileSearchToolsMixin
Module:
gaia.agents.tools.file_tools
Import: from gaia.agents.tools.file_tools import FileSearchToolsMixinOverview
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
- 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
3-Phase Search
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
Acceptance Criteria
- 3-phase intelligent search implemented
- Type-aware file reading (Python, Markdown, binary)
- AST-based symbol extraction for Python
- Grep-like content search
- Progress indicators for long searches
- Early termination on match
- Formatted file lists for user selection
- All file types handled gracefully
FileSearchToolsMixin Technical Specification