Expert guidance for working with OpenManus AI agent framework and enhanced research capabilities through DSPy and MCP integration. Handles multi-modal agents, browser automation, structured reasoning, and tool orchestration.
Expert guidance for developing with OpenManus AI agent framework and enhanced research capabilities through DSPy and MCP integration.
This skill provides comprehensive instructions for working with a multi-project repository containing:
**For initial setup:**
```bash
make install
./scripts/dev.sh setup
```
**For OpenManus-specific work:**
```bash
cd OpenManus
uv venv --python 3.12
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt
cp config/config.example.toml config/config.toml
```
**For Enhanced Agent work:**
```bash
cd enhanced_agent
pip install -e .
pip install dspy-ai>=2.0.0
export OPENAI_API_KEY="your_key" # Optional, for DSPy
```
**LLM Provider Configuration (`OpenManus/config/config.toml`):**
```toml
[llm]
model = "claude-3-7-sonnet-20250219"
base_url = "https://api.anthropic.com/v1/"
api_key = "YOUR_API_KEY"
max_tokens = 8192
temperature = 0.0
[llm.vision]
model = "claude-3-7-sonnet-20250219"
base_url = "https://api.anthropic.com/v1/"
api_key = "YOUR_API_KEY"
```
**Supported providers:** OpenAI, Anthropic (recommended), Azure OpenAI, Ollama
**MCP Configuration (`enhanced_agent/config/mcp.json`):**
```json
{
"servers": {
"llama-mcp": {
"url": "http://localhost:11434",
"model": "gemma2:2b",
"context_length": 4096,
"temperature": 0.7
}
},
"default_server": "llama-mcp"
}
```
**OpenManus Agent:**
```bash
python OpenManus/main.py # Basic agent with terminal input
python OpenManus/run_flow.py # Planning flows with timeout (recommended)
```
**Enhanced Agent:**
```bash
./run_streamlit.sh # Web interface (recommended)
python enhanced_agent/main.py # Full integration
python test_dspy_standalone.py # Test components independently
```
**Code formatting and linting:**
```bash
make format # Auto-format with black + isort
make lint # Check with flake8
```
**Testing:**
```bash
make test # All tests
make test-unit # Unit tests only
make test-integration # Integration tests only
make test-fast # Exclude slow tests
make test-coverage # With coverage reporting
pytest OpenManus/tests/
pytest enhanced_agent/tests/
pytest -m "not slow" # Fast tests only
```
**Running individual modules:**
```bash
./scripts/dev.sh run [module]
```
When creating new agents in OpenManus:
1. Extend `BaseAgent` (`OpenManus/app/agent/base.py`)
2. Implement required methods: `_execute()`, `_plan()`
3. Use state management: IDLE → RUNNING → FINISHED/ERROR
4. Handle async/await properly with timeout handling
5. Implement memory management via message-based conversation history
6. Add tests in `OpenManus/tests/`
**Example agent pattern:**
```python
from app.agent.base import BaseAgent
class CustomAgent(BaseAgent):
async def _execute(self):
# Implementation
pass
async def _plan(self):
# Planning logic
pass
```
When creating new tools:
1. Extend `BaseTool` (`OpenManus/app/tool/base.py`)
2. Implement `execute()` method with standardized return format
3. Return `ToolResult` with output, errors, images, system_messages
4. Use async/await for non-blocking operations
5. Add to tool collections for domain organization
6. Add tests in `OpenManus/tests/`
**DSPy signatures** define structured reasoning tasks:
**Integration pattern:**
```python
from enhanced_agent.src.dspy_mcp_integration import DSPyMCPIntegration
integration = DSPyMCPIntegration()
result = await integration.process_query("your query")
```
**Best practices:**
**External Dependencies:**
**Environment Variables:**
```bash
export OPENAI_API_KEY="your-key" # For DSPy
```
**Virtual Environment:**
```bash
uv venv --python 3.12 && source .venv/bin/activate
python -m venv venv && source venv/bin/activate
```
Agents transition through states:
Tools return standardized `ToolResult` objects:
```python
{
"output": "result text",
"errors": [],
"images": [],
"system_messages": []
}
```
Message-based conversation memory with role-based handling (user, assistant, system)
**Core commands:**
**Lock files:**
1. **Enhanced Agent as OpenManus Tool**: Available in `OpenManus/app/tool/enhanced_agent_tool.py`
2. **Streamlit Interface**: `./run_streamlit.sh` provides unified web interface
3. **Multi-server MCP**: Configure multiple information sources in `mcp.json`
**Basic agent execution:**
```bash
python OpenManus/run_flow.py
```
**Research with DSPy+MCP:**
```bash
./run_streamlit.sh
python enhanced_agent/main.py
```
**Development cycle:**
```bash
make format && make lint && make test-fast
```
**Project-specific testing:**
```bash
pytest OpenManus/tests/ -v
pytest enhanced_agent/tests/ --cov
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/openmanus-development-guide/raw