A sophisticated meta-agent system that creates specialized AI agents automatically
Agent4Agent is an intelligent meta-agent built on the nexau framework that can analyze user requirements and automatically create specialized sub-agents and multi-agent frameworks with tailored capabilities, tools, and prompts.
Agent4Agent is a meta-agent system that automatically creates specialized AI agents based on natural language requirements. Instead of manually configuring agents, you simply describe what you need, and Agent4Agent intelligently:
- ๐ง Generates intelligent system prompts tailored to specific tasks
- ๐ง Selects appropriate tools from 15+ built-in tools
- โ๏ธ Creates custom tools with complete implementation and tests when needed
- ๐ฆ Packages complete agents ready for immediate use
- ๐๏ธ Manages agent lifecycle with persistent storage and registry
- Agent Creatation: Create Agents follow nexau standard.
- LLM-Powered Prompt Creation: Uses LLM to generate comprehensive system prompts
- Smart Tool Selection: LLM-powered analysis to choose optimal tools from 15+ built-in options
- Custom Tool Generation: Automatically creates new tools with complete Python implementation
- Comprehensive Testing: All custom tools include unit tests and integration validation
- Tool Ecosystem: Seamless integration between built-in and generated tools
- Dataset Discovery & Download: Automatically search and download datasets from Hugging Face
- Format Standardization: Convert various dataset formats into standardized SFT training format
- Data Generation by Distillation: Generate high-quality training responses using teacher models
agent4agent/
โโโ ๐ agent4agent.py # Main CLI interface
โโโ ๐ src/ # Core system
โ โโโ ๐ง meta_agent_config.yaml # MetaAgent configuration
โ โโโ ๐ค subagents/ # Sub-agent systems
โ โ โโโ AgentBuilder/ # The core agent creation system
โ โ โ โโโ config.yaml # AgentBuilder configuration
โ โ โ โโโ tools/ # Specialized agent creation tools
โ โ โ โโโ SubAgentPrompter # LLM-powered prompt generation
โ โ โ โโโ ToolSelector # Intelligent tool selection
โ โ โ โโโ ToolGenerator # Custom tool creation
โ โ โ โโโ SubAgentManager # Agent lifecycle management
โ โโโ ๐ฆ created_subagents/ # Generated agents storage
โ โโโ registry.yaml # Agent registry database
โ โโโ [agent_name]/ # Individual agent directories
โ โโโ config.yaml # Agent configuration
โ โโโ test_agent.py # Agent validation tests
โ โโโ tools/ # Custom tools (if any)
โโโ โ๏ธ subagent_creator.py # Agent creation orchestrator
โโโ ๐ subagent_runner.py # Agent execution system
โโโ ๐ nexau/ # nexau framework (git submodule)
- Python 3.12+ (required for modern syntax features)
- UV Package Manager (modern Python package management)
- Git (for cloning with submodules)
git clone --recurse-submodules https://github.com/nex-agi/NexA4A.git
cd NexA4A
# If already cloned without submodules:
git submodule init && git submodule update# Install all dependencies including nexau framework
uv syncCopy the example environment file and configure your settings:
cp .env.example .envuv run agent4agent.pyStart Agent4Agent in interactive mode for the best user experience:
uv run agent4agent.py interactiveThis launches a beautiful, menu-driven interface with multi-turn conversation support:
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ๐ค Agent4Agent CLI โ
โ โ
โ Create and Manage Specialized Sub-Agents โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Welcome to the Agent4Agent Interactive Mode!
This mode allows you to create and use specialized sub-agents interactively.
Use arrow keys to edit, Ctrl+C to exit gracefully.
MAIN MENU
โโโโโโโโโ
1. ๐ง Create a new sub-agent
2. ๐ Use an existing sub-agent
3. ๐ List all sub-agents
4. ๐๏ธ Delete a sub-agent
5. ๐๏ธ Build a multi-agent framework
6. ๐ฏ Use an existing framework
7. ๐ List all frameworks
8. ๐ฅ Delete a framework
9. ๐ช Exit
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Select an option (1-9) [1]:
All examples use Interactive Mode with multi-turn conversations:
uv run agent4agent.py interactive
โ Select "1. ๐ง Create a new sub-agent"
โ Agent name: hf_model_downloader
โ Agent Requirements: Help me create a huggingface model downloader agent. Its function is to find suitable models on huggingface based on user requirements and download them locally. You can use huggingface's API, the API token is in .env's 'HF_READ_KEY'.
โ Select "2. ๐ Use an existing sub-agent"
โ Choose: "1. hf_model_downloader"
โ Task Description: Help me download a qwen 0.5b model to local_data/hf_models
For power users who prefer command-line operations (all commands now support multi-turn interactions):
uv run agent4agent.py create \
--requirements "..." \
--name "..."uv run agent4agent.py use \
--agent data_analyst \
--query "..."# List all created agents
uv run agent4agent.py list
# Delete an agent (registry only)
uv run agent4agent.py delete --agent data_analyst
# Delete an agent completely (registry + files)
uv run agent4agent.py delete --agent data_analyst --completeManage your multi-turn conversation sessions:
# List all saved sessions
uv run agent4agent.py session list
# Resume a previous conversation
uv run agent4agent.py session resume session_abc12345
# Delete a specific session
uv run agent4agent.py session delete session_abc12345
# Clean up old sessions (older than 30 days)
uv run agent4agent.py session clean --days 30# Custom LLM settings in agent configs
llm_config:
model: "${LLM_MODEL}"
base_url: "${LLM_BASE_URL}"
api_key: "${LLM_API_KEY}"
temperature: 0.6
max_tokens: 16000Agents automatically receive runtime context:
**๐ RUNTIME CONTEXT**:
๐ PROJECT ROOT: /path/to/agent4agent
๐
CURRENT DATE: 2025-08-12