NexA4A
Nex Agent for Agent is a meta-agent system that automatically creates specialized AI agents based on natural language requirements.
Install / Use
/learn @nex-agi/NexA4AREADME
Agent4Agent 🤖✨
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.
🎯 What is Agent4Agent?
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
📋 Current Capabilities
✅ Level 1: Intelligent Prompt Generation
- Agent Creatation: Create Agents follow nexau standard.
- LLM-Powered Prompt Creation: Uses LLM to generate comprehensive system prompts
✅ Level 2: Intelligent Tool Creation & Selection
- 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
✅ Level 3: Data Collection & Processing
- 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
▶️ ...
<!-- ## 🎯 Roadmap (Future Levels) ### 🎯 **Level 5: "Eliminate **"** (Planned) - **Meta-Meta Intelligence**: Self-bootstrapping agent creation systems - **Universal Problem Solving**: Agents that can create other agents for any conceivable task - **Autonomous Agent Ecosystems**: Self-managing, self-improving agent networks -->🏗️ Architecture
Project Structure
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)
🛠️ Installation & Setup
Prerequisites
- Python 3.12+ (required for modern syntax features)
- UV Package Manager (modern Python package management)
- Git (for cloning with submodules)
1. Clone Repository 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
2. Install Dependencies
# Install all dependencies including nexau framework
uv sync
3. Environment Configuration
Copy the example environment file and configure your settings:
cp .env.example .env
4. Verify Installation
uv run agent4agent.py
🎮 Usage Guide
Interactive Mode (Recommended)
Start Agent4Agent in interactive mode for the best user experience:
uv run agent4agent.py interactive
This 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]:
💡 Example Use Cases
All examples use Interactive Mode with multi-turn conversations:
🤗 Creating a Hugging Face Model Downloader
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'.
🚀 Using the Created Agent
→ 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
💻 Command Usage
1. Agent Commands
For power users who prefer command-line operations (all commands now support multi-turn interactions):
🔨 Create Specialized Agents
uv run agent4agent.py create \
--requirements "..." \
--name "..."
🚀 Use Created Agents
uv run agent4agent.py use \
--agent data_analyst \
--query "..."
📋 Manage Agents
# 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 --complete
2. Session Commands
Manage your multi-turn conversation sessions:
📚 Session Management
# 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
⚙️ Advanced Configuration
LLM Configuration Options
# 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: 16000
Dynamic Context Injection
Agents automatically receive runtime context:
**📍 RUNTIME CONTEXT**:
🏠 PROJECT ROOT: /path/to/agent4agent
📅 CURRENT DATE: 2025-08-12
