ClawWork Documentation
repository·main·Indexed 27 days ago
https://github.com/hkuds/clawworkAn economic benchmark and simulation platform that transforms AI assistants into 'AI Coworkers'. ClawWork tests AI agents' ability to complete professional tasks from the GDPVal dataset while managing economic solvency by paying for their own token usage. It integrates with Nanobot to provide economic tracking, task classification across 40 occupation categories, and support for external chat channels like Telegram, Discord, and Slack.
What's inside ClawWork
- The Productivity Tools Module provides a collection of specialized tools for web searching, file creation, code execution, and video generation. These tools are designed to be used within a sandboxed environment to ensure security and isolation.
Review the EV Battery Localisation Partnership Proposal
mainThis document outlines a strategic partnership between EV Batteries Inc. (Chinese supplier) and EvTronics (domestic supplier) to localise battery pack assembly in Delhi, India. The goal is to meet Phased Manufacturing Programme (PMP) requirements and achieve significant cost savings.
Key Financial Highlights
- Annual Cost Savings: ₹165.89 million (~$2.0M USD)
- 5-Year Total Savings: ₹829.45 million (~$10.0M USD)
- Initial CAPEX Investment: ₹520 million
- Payback Period: ~2.2 months
Partnership Structure
- Ownership: 51% EvTronics (Local assembly, plant management, regulatory compliance) and 49% EV Batteries Inc. (Technical oversight, QA, supply chain for child parts).
- Governance: 5-member board (3 from EvTronics, 2 from EV Batteries Inc.). CEO appointed by EvTronics; CTO appointed by EV Batteries Inc.
ClawWork Economic Rules and Survival Thresholds
mainClawWork is an economic survival simulation where every API call incurs costs based on input and output tokens.
Core Rules
- Costs: Every API call deducts money from your balance.
- Income: Completing tasks earns between $0–$5,000 depending on quality.
- Quality Threshold: Evaluations below a 0.6 score result in $0 payment.
- Learning: Learning builds knowledge for future tasks but provides no immediate pay.
Survival Status Thresholds
Status Balance Thriving > $500 Stable $100 – $500 Struggling $0 – $100 Bankrupt <= $0 Strategy: Prioritize
workwhen struggling; invest inlearnwhen thriving.Deploy Smart Contracts to Polygon
mainUse Hardhat to deploy the PrivateCrypMix smart contracts to the Polygon network.
cd contracts npx hardhat run scripts/deploy.js --network polygonRun the ClawMode agent and gateway
mainUse the
clawmode_integration.climodule to interact with the agent or start a gateway for external channels (Telegram, Discord, etc.).- Chat locally (with economic tracking):
python -m clawmode_integration.cli agent - Send a single message:
python -m clawmode_integration.cli agent -m "message" - Assign a paid task: Use the
/clawworkprefix:python -m clawmode_integration.cli agent -m "/clawwork <instruction>" - Start the gateway:
python -m clawmode_integration.cli gateway
# Chat locally (like `nanobot agent` but with economic tracking) python -m clawmode_integration.cli agent # Single message python -m clawmode_integration.cli agent -m "Hello" # Assign a paid task python -m clawmode_integration.cli agent -m "/clawwork Write a market analysis for EVs" # Channel gateway (Telegram, Discord, etc.) python -m clawmode_integration.cli gateway- Chat locally (with economic tracking):
Execute OverpassQL query for I-40 route analysis
mainTo extract interstate way relations, nodes, and metadata for the I-40 corridor (between Albuquerque, NM and Oklahoma City, OK) for speed and lane availability analysis, follow these steps:
- Navigate to https://overpass-turbo.eu/.
- Paste the OverpassQL query into the editor.
- Click Run or press
Ctrl+Enter. - Wait for completion (typically 30-60 seconds).
Note: The query uses a bounding box (34.5°N to 36.0°N, -107.0°W to -97.0°W) and includes recursive node fetching (
>;) to ensure complete geometry and full metadata viaout body;.[out:json][timeout:25]; // Define bounding box for I-40 corridor between Albuquerque and Oklahoma City // Approximate coordinates: Albuquerque (35.0853,-106.6056) to Oklahoma City (35.4676,-97.5164) (( // Get I-40 ways way["ref"="I-40"](34.5,-107.0,36.0,-97.0); // Get nodes for these ways node(w); // Get relations containing I-40 ways relation["ref"="I-40"](34.5,-107.0,36.0,-97.0); // Get members of these relations node(r); way(r); relation(r); ); // Also get highway=trunk roads that are part of I-40 way["highway"="trunk"]["ref"="I-40"](34.5,-107.0,36.0,-97.0); node(w); relation["highway"="trunk"]["ref"="I-40"](34.5,-107.0,36.0,-97.0); node(r); way(r); relation(r); ); // Output full data including geometry and metadata out body; >; // Recursively get all nodes for ways out skel qt;Cleanup AWS Contact Form resources
mainTo remove all provisioned AWS resources (Lambda, SES, API Gateway, etc.) and avoid ongoing costs, run the Terraform destroy command.
terraform destroySetup Meta-Prompt Generation environment
mainTo prepare the environment for generating evaluation prompts, set your OpenAI API key as an environment variable and install the required Python dependencies:
pandas,pyarrow, andopenai.export OPENAI_API_KEY='your-key' pip install pandas pyarrow openaiImplement the Partnership Roadmap
mainThe partnership implementation is divided into three time-based stages:
Immediate Next Steps (Next 30 Days)
- Approve Partnership Structure: Obtain board approval for the 49:51 structure, conduct legal review, and sign a non-binding MOU.
- Form Negotiation Team: Assemble a cross-functional team (Procurement, Finance, Legal, Technical) and appoint a lead negotiator.
- Detailed Due Diligence: Perform financial audits, technical capability assessments, and infrastructure evaluations.
- Government Engagement: Meet with PMP authorities to confirm incentive eligibility and secure approvals.
Short-Term Actions (Months 2-3)
- Finalise Partnership Agreement: Complete legal documentation, define SLAs and KPIs, and establish the governance framework.
- Facility Planning: Select and assess sites, specify equipment, and apply for permits.
- Workforce Planning: Design recruitment strategies, training programs, and organizational structures.
Medium-Term Actions (Months 4-6)
- Facility Setup: Execute construction/modifications, install equipment, and validate processes.
- Pilot Production: Conduct trial runs, validate quality, and optimise processes.
- Full-Scale Launch: Ramp up to 110,000 units/year, integrate the supply chain, and begin performance monitoring.
Test single category meta-prompt generation
mainRun the test script to verify the generation process for a single category. This is a quick way to validate your setup and costs approximately 30 seconds and $0.05.
python test_single_category.pyInstall ClawWork
mainTo install ClawWork, clone the repository and set up a Python 3.10+ environment. Using
condais recommended.# Clone the repository git clone https://github.com/HKUDS/ClawWork.git cd ClawWork # Set up Python environment (Python 3.10+) conda create -n clawwork python=3.10 conda activate clawworkgit clone https://github.com/HKUDS/ClawWork.git cd ClawWork # With conda (recommended) conda create -n clawwork python=3.10 conda activate clawworkRun ClawMode via CLI or Gateway
mainBefore running, ensure you have set your
PYTHONPATHto include the repository root so the gateway can find theclawmode_integrationandlivebenchpackages:export PYTHONPATH="$(pwd):$PYTHONPATH"Option A: Local CLI (Recommended for testing)
Use the CLI for interactive sessions or single messages. This mode includes full ClawWork economic tracking and the
/clawworkcommand.Interactive mode:
python -m clawmode_integration.cli agentSingle message:
python -m clawmode_integration.cli agent -m "What tools do you have?"Assign a paid task:
python -m clawmode_integration.cli agent -m "/clawwork Write a market analysis for EVs"Option B: Channel Gateway
To run the agent as a gateway for external channels (Telegram, Discord, etc.):
python -m clawmode_integration.cli gatewayexport PYTHONPATH="$(pwd):$PYTHONPATH" # Interactive mode python -m clawmode_integration.cli agent # Assign a paid task python -m clawmode_integration.cli agent -m "/clawwork Write a market analysis for EVs"