Introducing CrewDefine: Design Multi-Agent Crews Through Conversation
An interactive CLI that turns natural conversation into production-ready agent configurations for LabZ.
The Multi-Agent Authoring Problem
Building multi-agent systems requires careful orchestration. You need to define roles, allocate tools, establish delegation patterns, and craft detailed system prompts for each agent. Do it by hand and you’re juggling YAML files, making sure agent IDs match delegation targets, validating tool references, and hoping the prompts follow consistent conventions.
What if you could just describe what you want and have the system figure out the structure?
Enter CrewDefine
CrewDefine is an interactive CLI that helps you author agent crews for LabZ through a guided, LLM-driven conversation. It produces production-ready YAML configurations, validates everything, and even generates Python stubs for custom tools.
You start with nothing. You answer questions. You walk away with a complete, validated crew.
How It Works
CrewDefine uses a constrained, tool-based approach to keep the LLM focused:
1. Interview. An Anthropic Claude model conducts an adaptive conversation, but it can only act through a constrained tool interface: ask_user, record_agent, record_custom_tool, and finalize_crew. No free-form generation, no wandering off-task. Just structured questions with a hard cap on turns.
2. Draft. After you’ve defined the crew structure, CrewDefine prompts Claude to write each agent’s system_prompt, grounded in LabZ’s conventions: numbered responsibilities, tool-usage guidance, delegation rules, output format expectations.
3. Validate. Every generated YAML is loaded back through Pydantic, cross-checked against LabZ’s AgentConfig schema, and the delegation graph is analyzed for unknown agent IDs, cycles, and unused custom tools.
4. Emit. Files are written only after validation passes. You get:
- One YAML per agent in
agents/ - Python stubs for custom tools in
tools/ - A crew-level README explaining what the crew does and how to install it
Key Features
Guided Crew Design
No more staring at blank YAML files. CrewDefine asks questions: What’s this crew for? What specialists do you need? Which tools should each agent have? Who can delegate to whom?
Built-In Tool Catalog
CrewDefine knows about LabZ’s built-in tools (web_search, calculator, document, knowledge_base, etc.) and surfaces them during the interview. Need something custom? Define it inline and get a Python stub to implement later.
Incremental Authoring
Already have a crew? Use crewdefine add-agent to add a new specialist or crewdefine update-agent to revise an existing one. The interview picks up where you left off.
Validation First
Validation happens before anything hits disk:
- Schema compliance with LabZ’s
AgentConfig - Delegation graph sanity (no references to unknown agents)
- Tool reference checking (every tool ID must be known or defined)
- Round-trip YAML stability
Commands at a Glance
crewdefine new # Create a crew from scratch
crewdefine add-agent <dir> # Add an agent to existing crew
crewdefine update-agent <dir> <id> # Revise an agent
crewdefine validate <dir> # Run validation checks
crewdefine list-tools # Show built-in LabZ tools
Example Workflow
export ANTHROPIC_API_KEY=sk-ant-...
crewdefine new
The interview begins:
What does this crew do?
”Competitive intelligence for strategy teams.”
What specialists do you need?
”A director to coordinate, a market researcher, and a financial analyst.”
Which tools should the market researcher have?
“web_search, news_search, and scrape_website.”
CrewDefine validates the structure, drafts system prompts, and outputs:
crews/competitive-intel/
├── README.md
├── agents/
│ ├── director.yaml
│ ├── market_researcher.yaml
│ └── financial_analyst.yaml
└── tools/
└── competitor_lookup.py # stub for any custom tool
Copy the agents into LabZ, implement the tool stubs, and you’re running.
Open Source Philosophy
CrewDefine is released under the MIT License because well-designed agent systems shouldn’t require proprietary tooling.
You can:
- ✅ Use it for commercial projects
- ✅ Fork and customize
- ✅ Contribute improvements
- ✅ Self-host and extend
Repository: github.com/lab-zee/CrewDefine
Why This Matters
Multi-agent systems are powerful but hard to author correctly. The coordination logic, tool allocation, and prompt conventions require deep understanding of the framework. CrewDefine encodes that understanding into an interactive workflow.
You think in terms of roles and responsibilities. CrewDefine handles the YAML, validation, and conventions.
Installation
pip install crewdefine
Or from source:
git clone https://github.com/lab-zee/CrewDefine
cd CrewDefine
pip install -e ".[dev]"
Current Status
Alpha. The core loop is solid: create crews, add agents, validate structures. But expect rough edges as we refine the interview prompts and expand the tool catalog.
Issues and PRs welcome. See CONTRIBUTING.md for guidelines.
What’s Next
- Template crews (research, analysis, content creation)
- Visualization of delegation graphs
- Integration with LabZ’s crew runtime for live testing
- Support for more multi-agent frameworks beyond LabZ
Try it: github.com/lab-zee/CrewDefine
Need agent crews for strategy, research, or analysis? Start with a conversation.