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

  1. Clone this repository
  2. 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:

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"

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_agent call
  • Configure subagents or other DeepAgents features

Testing

Run the test script:

python test_agent.py

License

MIT

S
Description
LangCode Agent - AI Agent harness configurabile basato su LangChain Deep Agents
Readme
859 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 81.9%
HTML 16.6%
Shell 1.4%
Dockerfile 0.1%