Skip to content
@Langclaw-AI

Langclaw AI

Langclaw

Autonomous AI research platform for verifiable trend intelligence on 0G.

Langclaw is a wallet-authenticated agent platform: chat, memory, API keys, prepaid usage billing, scheduled automation, and an OpenAI-compatible proxy to 0G Compute Router. Enter one topic and Langclaw turns it into live X, GitHub, Docs, and HackQuest signals through coordinated agents, stores evidence on 0G Storage, and anchors brief hashes on 0G Chain.

Two on-chain contracts on 0G mainnet: LangclawUsageVault (prepaid deposits) and LangclawRegistry (research proof; Solidity artifact: SignalGraphRegistry).

Repositories

Organization: Langclaw-AI

Repository Stack Port README
frontend Next.js 16, React 19, RainbowKit, AI SDK 3000 README
backend Node HTTP API, TypeScript, Supabase 3001 README
contracts Foundry, LangclawUsageVault README

This workspace can be a monorepo with frontend/, backend/, and contracts/ as sibling folders, or three separate clones from the org above.

For judges / reviewers

Fastest path (no local backend): open the deployed app if your team shared a URL, connect an EVM wallet on 0G mainnet (chain ID 16661), sign the Langclaw login message, open Chat in agent/research mode, and run a short topic (e.g. 0G decentralized storage trends). Watch for 0G Compute, 0G Storage, and 0G Chain badges in the agent trace when those envs are enabled on the server.

5-minute local smoke test

  1. curl http://localhost:3001/health{"ok":true,"service":"signalgraph-backend"} (legacy service name in JSON)
  2. Open http://localhost:3000 → connect wallet → sign in
  3. Chat or POST /api/discover with a one-line topic (wallet session or Authorization: Bearer lck_live_...)
  4. Optional billing: send native 0G to the vault below → POST /api/usage/deposit/verify

Deployed contracts (0G mainnet, chain ID 16661)

Contract Address Explorer
LangclawUsageVault 0xd6a6773d653049bc4076aac820f98bd48308596a ChainScan
LangclawRegistry Deploy with npm run deploy:registry in backend Set SIGNALGRAPH_REGISTRY_ADDRESS in backend .env (env name is legacy; contract = research proof)

Getting 0G tokens

  • Native 0G (gas + vault deposits): buy on CEX and withdraw to 0G mainnet, bridge via XSwap, or swap on 0G Hub. See How to get 0G.
  • Compute Router billing: create an API key and fund usage at pc.0g.ai (OG_COMPUTE_API_KEY in backend .env).

Minimum vs full local setup

Goal Required env / tools
Chat + /v1/* 0G proxy SUPABASE_*, LANGCLAW_API_KEY_PEPPER, OG_COMPUTE_API_KEY
Full research (/api/discover) Above + OpenClaw CLI + provider keys (Brave/GitHub/Tavily, etc.)
On-chain proof (storage + registry) OG_STORAGE_*, OG_CHAIN_*, SIGNALGRAPH_REGISTRY_ADDRESS, funded wallets
Prepaid usage vault LANGCLAW_USAGE_VAULT_ADDRESS = deployed vault above

Video walkthrough: DEMO_SCRIPT.md.

0G integration

0G module Where Langclaw uses it How it supports the product
0G Compute Router GET/POST /v1/*, chat stream, research final answer OpenAI-compatible inference on 0G models; primary writer for user-facing conclusions when configured
0G Storage Research evidence bundles after /api/discover Durable, decentralized proof artifacts linked from each brief
0G Chain LangclawRegistry.registerBrief, LangclawUsageVault On-chain brief hash + storage URI anchor; native 0G prepaid deposits for usage billing

Docs: 0G overview · Compute Router · Storage · 0G Chain · Mainnet

Quick start

Option A — monorepo (this layout)

# 1. Backend
cd backend && cp .env.example .env
# Set SUPABASE_*, LANGCLAW_API_KEY_PEPPER, OG_COMPUTE_API_KEY at minimum
# Optional: LANGCLAW_USAGE_VAULT_ADDRESS=0xd6a6773d653049bc4076aac820f98bd48308596a
npm install
# Apply Supabase migrations (see backend/supabase/migrations)
npm run dev

# 2. Frontend (new terminal)
cd frontend && cp .env.example .env.local
pnpm install && pnpm dev

Option B — three org repos (sibling folders)

git clone https://github.com/Langclaw-AI/backend.git
git clone https://github.com/Langclaw-AI/frontend.git
git clone https://github.com/Langclaw-AI/contracts.git

Then follow the same backend / frontend steps as above.

curl http://localhost:3001/health
# {"ok":true,"service":"signalgraph-backend"}

Open http://localhost:3000. Connect a wallet and sign the Langclaw login message.

Architecture

User → Frontend (:3000) → Backend API (:3001)
                              ├─ Supabase (sessions, memory, keys, usage ledger)
                              ├─ OpenClaw CLI (Planner, Trend, Evidence, Verifier, Conclusion)
                              ├─ Providers (X/Brave, GitHub, Tavily, HackQuest)
                              ├─ 0G Compute Router (/v1/*)
                              ├─ 0G Storage (evidence bundles)
                              ├─ LangclawRegistry (brief hash)
                              └─ LangclawUsageVault (prepaid 0G deposits)

Research workflow

Entry: runSignalGraphWorkflow(topic) (internal name) → POST /api/discover or /api/discover/stream (NDJSON).

Step Runtime Responsibility
Planner OpenClaw Search plan for X, GitHub, Docs, HackQuest
Discovery TypeScript Live source fetch (API keys server-side)
Source normalizer TypeScript Source cards and excerpts
Trend scorer OpenClaw Rank trends
Evidence packager OpenClaw Claim map, bundle summary
Verifier OpenClaw Unsupported claims, brief hash input
Final conclusion 0G Compute → OpenClaw → fallback User-facing answer
0G Storage / Chain TypeScript Upload bundle; registerBrief on registry

OpenClaw skills: backend/openclaw/skills. Install: OpenClaw docs.

Product features

Feature UI API
Chat /chat POST /api/chat/stream, /api/chat/sessions
Research Chat (agent mode) POST /api/discover, /api/discover/stream
Memory /memory POST /api/memory
API keys /key POST /api/api-keys
Usage / billing /usage POST /api/usage/*
Automation /task, /settings POST /api/automation/*
0G models GET/POST /v1/* (alias /api/0g/*)

Authentication

Wallet session — sign:

Login to Langclaw
Address: 0x...
Time: 2026-05-16T12:00:00.000Z

Required for API key management, deposits, withdrawals.

API keyAuthorization: Bearer lck_live_... for runtime APIs. Cannot manage keys or withdraw.

Full spec: API_REFERENCE.md.

Smart contracts (0G mainnet, chain ID 16661)

Contract Repository / source Purpose
LangclawUsageVault contracts Native 0G deposits; backend-authorized withdrawals
LangclawRegistry backend/contracts/SignalGraphRegistry.sol registerBrief(hash, storageUri) for research proof

Deployed (mainnet)

  • LangclawUsageVault: 0xd6a6773d653049bc4076aac820f98bd48308596aChainScan

Billing flow: user deposits 0G to vault → POST /api/usage/deposit/verify credits off-chain neuron balance → usage charges deduct ledger. Router (OG_COMPUTE_API_KEY) is funded separately on pc.0g.ai.

Withdrawal: backend calls authorizeWithdrawal on vault (TBD: full automation); user calls withdraw(amount).

Deploy vault (if not using the address above):

git clone https://github.com/Langclaw-AI/contracts.git && cd contracts
export LANGCLAW_USAGE_VAULT_OWNER=0x...
export LANGCLAW_USAGE_VAULT_WITHDRAWAL_AUTHORITY=0x...
forge script script/DeployLangclawUsageVault.s.sol:DeployLangclawUsageVaultScript \
  --rpc-url https://evmrpc.0g.ai --broadcast

Deploy registry (in the backend repo):

git clone https://github.com/Langclaw-AI/backend.git && cd backend
npm run deploy:registry

Set LANGCLAW_USAGE_VAULT_ADDRESS and SIGNALGRAPH_REGISTRY_ADDRESS in backend .env.

Deployment

Service Notes
Frontend Set NEXT_PUBLIC_SIGNALGRAPH_API_URL to public API (env name is legacy)
Backend npm run build && npm start; PORT default 3001
Supabase Apply backend migrations
0G OG_COMPUTE_API_KEY, storage/chain keys as needed

Smoke tests after deploy

  1. GET /health
  2. GET /v1/models with API key
  3. Wallet connect + chat stream
  4. POST /api/discover with short topic
  5. Deposit to vault + POST /api/usage/deposit/verify

See env templates: backend, frontend, contracts (see deploy section in contracts README).

Security

  • Provider keys, Supabase service role, pepper, and OG_*_PRIVATE_KEY stay on the server only.
  • API keys stored as HMAC hashes (LANGCLAW_API_KEY_PEPPER).
  • Vault withdrawalAuthority is a hot wallet — use multisig for owner in production.
  • Never commit .env files.

Spec for vault requirements: SMART_CONTRACT_TEAM_NOTES.md.

Prerequisites

  • Node.js 20+, pnpm (frontend), npm (backend)
  • Supabase project + applied migrations
  • Optional: OpenClaw CLI, Foundry, 0G API keys and funded wallets

Additional docs (backend)

Document Description
API_REFERENCE.md Full HTTP API
SIGNALGRAPH_BLUEPRINT.md Hackathon blueprint (legacy filename)
DEMO_SCRIPT.md 3-minute demo script
openclaw/README.md OpenClaw workspace

Links

License

TBD

Popular repositories Loading

  1. backend backend Public

    TypeScript

  2. frontend frontend Public

    Forked from zakyirsyaad/langclaw

    TypeScript

  3. contracts contracts Public

    Solidity

  4. .github .github Public

Repositories

Showing 4 of 4 repositories

Top languages

Loading…

Most used topics

Loading…