d4d6aafea979acfd76e1af83821fdff8886bcbeb
MaxClaw Agent
A configurable agent harness using DeepAgents that supports multiple LLM providers.
Features
- Provider Agnostic: Works with OpenAI, Ollama, OpenRouter, and any other provider supported by LangChain's
init_chat_model - Built on DeepAgents: Includes planning, filesystem access, subagents, and context management out of the box
- Easy Configuration: Set environment variables to choose your provider and model
- Persistent Configuration: Store and manage configurations via CLI or TUI
- Extensible: Add custom tools, modify prompts, and configure subagents as needed
Installation
- Clone this repository
- Install the required packages:
pip install -r requirements.txt
Configuration
You can configure MaxClaw Agent in several ways:
1. Environment Variables (Quick Start)
Set the following environment variables to configure your LLM provider:
MODEL_PROVIDER: The provider to use (e.g., "openai", "ollama", "openrouter")MODEL_NAME: The specific model name (e.g., "gpt-4o", "gemma2:9b")- Provider-specific variables:
- For OpenAI:
OPENAI_API_KEY - For Ollama:
OLLAMA_BASE_URL(defaults to http://localhost:11434) - For OpenRouter:
OPENROUTER_API_KEYand optionallyOPENROUTER_BASE_URL(defaults to https://openrouter.ai/api/v1)
- For OpenAI:
Example Configurations
OpenAI
export MODEL_PROVIDER="openai"
export MODEL_NAME="gpt-4o"
export OPENAI_API_KEY="your-openai-api-key"
Ollama (local)
export MODEL_PROVIDER="ollama"
export MODEL_NAME="gemma2:9b"
export OLLAMA_BASE_URL="http://localhost:11434"
OpenRouter
export MODEL_PROVIDER="openrouter"
export MODEL_NAME="anthropic/claude-3.5-sonnet"
export OPENROUTER_API_KEY="your-openrouter-api-key"
2. Persistent Configuration (Recommended)
Use the CLI or TUI to manage configurations that persist across sessions.
CLI Usage
# List configurations
python config_cli.py list
# Add a new configuration interactively
python config_cli.py add
# Add a new configuration non-interactively
python config_cli.py add --name "my-ollama" --provider "ollama" --model "gemma2:9b" --base-url "https://ollama.solarpi.net" --set-active
# Remove a configuration
python config_cli.py remove "my-ollama"
# Set active configuration
python config_cli.py set-active "my-ollama"
# Show active configuration
python config_cli.py active
TUI Usage
# Launch the Text User Interface
python config_tui.py
Navigate using arrow keys, press Enter to select, and 'q' to quit.
Usage
Run the agent:
python main.py
You can then interact with the agent in the terminal. Type 'exit' to quit.
Customization
To customize the agent, edit main.py:
- Change the default system prompt in
create_maxclaw_agent - Add custom tools to the
create_deep_agentcall - Configure subagents or other DeepAgents features
Testing
Run the test script:
python test_agent.py
License
MIT
Description
MaxClaw Agent - configurable agent harness using DeepAgents
334 KiB
0 Stars
1 Watchers
0 Forks
Languages
Python
74.5%
HTML
24.1%
Shell
1.2%
Dockerfile
0.2%