Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements support for the AGENTS.md standard, enabling deepagents to automatically load standardized AI agent configuration files from projects.
🎯 Fixes
Closes #449
📝 Summary
This PR adds hierarchical AGENTS.md file discovery and loading to deepagents-cli, following the official agents.md specification. AGENTS.md files provide standardized project context, build steps, tests, and coding conventions that work across multiple AI coding agents (Cursor, Aider, GitHub Copilot, etc.).
🔧 Implementation Details
Core Changes
Configuration Discovery (
config.py)_find_agents_md()function for hierarchical file discoverySettings.get_agents_md_files()for easy accessMemory Integration (
agent_memory.py)AgentMemoryMiddlewareto load AGENTS.md filesagents_md_memoryto state schemaKey Features
✅ Hierarchical Loading: Files loaded from most specific (current dir) to least specific
✅ Monorepo Support: Nested AGENTS.md files provide subproject-specific context
✅ Zero Configuration: Automatic detection and loading
✅ Spec Compliant: Follows https://agents.md/ specification
Example Usage
When working in
packages/package-a/src/, both AGENTS.md files are automatically loaded and combined.🧪 Testing
Comprehensive Test Suite
Unit Tests (
test_config.py)Integration Tests (
test_project_memory.py)All tests passing ✓
Windows Compatibility Fix
execution.pymodule. The original code importedtermiosandttyunconditionally (Unix-only modules), causing import errors on Windows.Changes:
termios/ttyimports conditional with try-exceptHAS_TERMIOSflag for runtime checksinput()for approvalsTesting Request: If you're on Windows, please verify that:
📚 Documentation
🔄 Backward Compatibility
✅ Fully backward compatible - existing functionality unchanged
✅ AGENTS.md loading is optional and automatic
✅ Works alongside existing agent.md files