Hackathon Project

LangClaw-Fix

LangGraph-powered AI agents for OpenClaw — bringing stateful, multi-model workflows to Telegram with code-enforced safety and autonomous tool use.

ZhipuAI GLM LangGraph OpenClaw Telegram Python 3.11+

What Traditional Skills Can't Do

LangGraph agents as OpenClaw skill backends unlock a class of scenarios that prompt-only and script-based skills structurally cannot handle.

Medical Triage
Multi-turn state tracking + safety gates — must confirm allergy history before proceeding, track which checks are complete across a long conversation.
State Tracking Human-in-the-Loop
Vehicle Diagnostics
Autonomous decisions — agent judges whether this is a DIY fix or requires a mechanic, based on severity, user skill level, and part availability.
Autonomous Decisions Multi-Model
IT Helpdesk
Multi-turn state + dynamic decisions — remember which troubleshooting steps were already tried, adapt the next suggestion based on what failed.
State Tracking Autonomous Decisions
Home Inspection
Multi-model orchestration — vision model assesses damage from photos, reasoning model estimates repair cost, search model finds local contractors.
Multi-Model Tool Orchestration
LangGraph enables: Multi-Turn State → Human-in-the-Loop Gates → Autonomous Decisions → Multi-Model Orchestration

Universal Appliance Repair

A single conversation, multiple AI capabilities — from photo identification to guided repair to automatic escalation.

1
Identify appliance make, model, and error code from photo
Vision
2
Safety gate — "Have you checked for gas smell?"
Human-in-the-loop
3
Validate safety response — is it genuinely safe?
LLM Judgment
4
Diagnose root cause from symptoms and error codes
Reasoning
5
Search for model-specific repair manuals (only when needed)
Autonomous Tool
6
Walk user through fix step by step, adapting to feedback
Agent Loop
7
Escalate with formal report if repair fails after 3 attempts
Enforced Policy

LangGraph Agents for OpenClaw

Stateful
SQLite checkpoint survives restarts, tracks every attempt precisely
Safe
LLM judge with ambiguity handling + code-level injection detection
Observable
Every model call logged with real-time tracing — no black boxes
Autonomous
Agent decides when to instruct, ask, search, or escalate based on context
Multi-Model
4 ZhipuAI GLM models, each chosen for its specific strength
Deployed
Runs on Telegram via OpenClaw with async polling (no timeouts)

Architecture

Telegram
OpenClaw Gateway
HTTP Daemon :19292
LangGraph StateGraph
vision_triage
GLM-4.6V
safety_gate
interrupt
safety_classify
GLM-4-Plus
diagnosis
GLM-4-Plus
agent_decide
GLM-4-Plus
manual_search
GLM-5
escalation
GLM-4.5-Air
complete
Async polling: daemon returns {status:"processing"} immediately. OpenClaw polls /poll_result/{SID}. Avoids timeouts on slow vision calls (30–60s). Request deduplication via description + photo hash.

ZhipuAI Model Allocation

4 models, each chosen for its specific strength

TaskModelWhy
Photo analysisGLM-4.6VMultimodal vision — identifies appliance from photo
Safety classificationGLM-4-PlusReliable LLM judge with ambiguity handling
Root cause diagnosisGLM-4-PlusReasoning over symptoms and error codes
Repair guidanceGLM-4-PlusAutonomous decision-making (instruct/ask/search/escalate)
Manual searchGLM-5Built-in web search tool support
Escalation reportGLM-4.5-AirStructured, professional writing

Benchmark Comparison

Same repair scenario, three approaches

MetricLangGraph AgentScript WrapperPrompt-Only
Total time55.5 s81.0 sN/A
Backend tokens1,6641,5100
Total tokens4,0643,61011,100
Safety enforcementLLM judge + ambiguityLLM YES/NOPrompt (bypassable)
State persistenceSQLite checkpointJSON fileNone
Agent autonomyFull ✓None ✗Prompt ✗
Process startup0 s (daemon)~3 s / callN/A
vs Script Wrapper: 31% faster with comparable token cost.  vs Prompt-Only: 63% fewer tokens. The only approach with real safety enforcement and agent autonomy.

Tech Stack

AI Models
ZhipuAI GLM-4.6V · GLM-4-Plus · GLM-5 · GLM-4.5-Air
Agent Framework
LangGraph
Platform
OpenClaw → Telegram via SKILL.md
Runtime
Python 3.11+ · asyncio · httpx
Deployment
Async HTTP daemon
Safety
LLM judge · ambiguity handling · injection detection

Quick Start

# Clone and setup
git clone https://github.com/nyang01/LangClaw_FIX.git
cd LangClaw_FIX && chmod +x setup.sh && ./setup.sh

# Configure API key (.env)
ZAI_API_KEY=your-zhipuai-api-key

# Start daemon
cd agent && python daemon.py