← Back to Skills Marketplace
tvaloki

DualAgentDebate

by tvaloki · GitHub ↗ · v0.3.0
cross-platform ✓ Security Clean
294
Downloads
0
Stars
0
Active Installs
4
Versions
Install in OpenClaw
/install dual-agent-debate
Description
Run a structured 2-agent debate loop between ChatGPT (OpenAI API) and the user's own thoughts retrieved from Supabase Open Brain via MCP, iterating up to 3 r...
README (SKILL.md)

DualAgentDebate

Execute scripts/dual_agent_debate.py to run the debate loop.

Setup

Set required environment variables:

export OPENBRAIN_MCP_URL="http://127.0.0.1:54321/mcp"
# optional if MCP is protected
export OPENBRAIN_MCP_TOKEN="..."

Optional: if you want direct OpenAI API mode, set:

export OPENAI_API_KEY="..."

If OPENAI_API_KEY is not set, the script uses openclaw agent (OAuth-backed local setup) for debate responses.

Optional tool/model overrides (defaults shown):

export OPENBRAIN_CONTEXT_TOOL="search_docs"
export OPENBRAIN_SQL_TOOL="execute_sql"
export DEBATE_MODEL="gpt-4o-mini"

Run

python3 skills/dual-agent-debate/scripts/dual_agent_debate.py \
  --query "Should I migrate this service to Supabase edge functions?"

Optional explicit thoughts:

python3 skills/dual-agent-debate/scripts/dual_agent_debate.py \
  --query "Should we launch this feature now?" \
  --thoughts "My concern is reliability and on-call burden." \
  --rounds 3 \
  --agreement-threshold 0.9

Behavior

  1. Pull context from Open Brain MCP (OPENBRAIN_CONTEXT_TOOL).
  2. Pull related prior thoughts from public.thoughts via MCP execute_sql unless --thoughts is provided.
  3. Ask ChatGPT to debate the query using context and thoughts.
  4. Compute semantic similarity (OpenAI embeddings) between ChatGPT reply and thoughts.
  5. Repeat up to 3 rounds or stop early on agreement threshold.
  6. Persist full outcome into public.memories via MCP execute_sql.

Notes

  • If your Open Brain MCP uses different tool names or argument schemas, set the tool env vars accordingly.
  • The script uses MCP tools/call JSON-RPC shape; point OPENBRAIN_MCP_URL at your MCP HTTP endpoint.
Usage Guidance
Before installing/running: 1) Confirm OPENBRAIN_MCP_URL points to a trusted Open Brain MCP endpoint (do not point it at an unknown public URL). 2) If you provide OPENBRAIN_MCP_TOKEN, ensure the token has least privilege (read and an intentionally scoped write permission) since the script will INSERT into public.memories. 3) Review the SQL statements in the script to ensure they match your schema and don't unintentionally expose or overwrite data; run against a staging/dev instance first. 4) If you do not want data sent to OpenAI, omit OPENAI_API_KEY — note the script will call your local openclaw agent instead, which may use local configuration/credentials. 5) The registry metadata incorrectly lists no required env vars — treat the SKILL.md and script as the source of truth and ask the publisher to correct the metadata. 6) If you have sensitive content, audit the actual SQL insert and decide whether to sanitize or redact before running. If any of the above are unacceptable, do not run the skill or run it in an isolated/test environment first.
Capability Analysis
Type: OpenClaw Skill Name: dual-agent-debate Version: 0.3.0 The skill implements a structured debate loop between an LLM and a local knowledge base (Supabase/Open Brain) via Model Context Protocol (MCP). It uses standard subprocess calls to the local 'openclaw' CLI and authenticated requests to OpenAI for embeddings and chat completions. While it performs dynamic SQL operations (including table creation and data insertion into 'public.memories'), it employs dollar-quoting mitigations to handle string safety and limits its scope to the documented purpose of managing 'thoughts' and 'memories'. No evidence of data exfiltration, unauthorized persistence, or malicious intent was found in scripts/dual_agent_debate.py or the associated documentation.
Capability Assessment
Purpose & Capability
The script uses an MCP HTTP endpoint (OPENBRAIN_MCP_URL / optional OPENBRAIN_MCP_TOKEN) and OpenAI (or a local openclaw agent) to implement the described debate loop; those capabilities are coherent with the stated purpose. However the registry metadata declares no required env vars while SKILL.md and the script do require/expect OPENBRAIN_MCP_URL and optionally OPENBRAIN_MCP_TOKEN and OPENAI_API_KEY — this metadata mismatch should be corrected or called out to users.
Instruction Scope
SKILL.md and the script stick to the declared task: they fetch context and prior thoughts via MCP tools, call an LLM for debate rounds, compute embeddings to measure semantic agreement, and persist the outcome back to the user's Open Brain. The script only contacts the MCP endpoint you point it to and (optionally) OpenAI or local openclaw; it does not try to read unrelated system files or external endpoints beyond those.
Install Mechanism
This is an instruction-only skill with an included Python script; there is no install spec that downloads arbitrary code or packages from external URLs. Risk from installation is low — running the script executes local Python and may spawn the openclaw CLI if no OpenAI key is provided.
Credentials
Requested environment variables (OPENBRAIN_MCP_URL, optional OPENBRAIN_MCP_TOKEN, optional OPENAI_API_KEY, and a few tool override vars) are proportionate to the functionality. Important caveat: the script issues SQL calls via the MCP 'execute_sql' tool and will persist debate outcomes into public.memories; this requires the MCP token (or the MCP service pointed at by URL) to allow writes. Verify the token has least privilege and that you expect the skill to write into public.memories. Also note the registry metadata omits these env requirements, which is misleading.
Persistence & Privilege
The skill does not set always:true and does not modify other skills or global agent settings. Its main privileged action is writing the debate outcome into the user's Open Brain via execute_sql — that is consistent with its purpose but is a sensitive write operation you should authorize.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install dual-agent-debate
  3. After installation, invoke the skill by name or use /dual-agent-debate
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.3.0
OAuth-friendly mode via openclaw agent fallback, lexical embedding fallback, and auto-create/retry for public.memories
v0.2.0
Hardened retries, semantic thought retrieval, schema-aware memory inserts, and safer SQL quoting
v0.1.1
Use execute_sql with public.thoughts retrieval and public.memories persistence
v0.1.0
Initial release: OpenAI+Open Brain MCP multi-round semantic debate with outcome persistence
Metadata
Slug dual-agent-debate
Version 0.3.0
License
All-time Installs 0
Active Installs 0
Total Versions 4
Frequently Asked Questions

What is DualAgentDebate?

Run a structured 2-agent debate loop between ChatGPT (OpenAI API) and the user's own thoughts retrieved from Supabase Open Brain via MCP, iterating up to 3 r... It is an AI Agent Skill for Claude Code / OpenClaw, with 294 downloads so far.

How do I install DualAgentDebate?

Run "/install dual-agent-debate" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is DualAgentDebate free?

Yes, DualAgentDebate is completely free (open-source). You can download, install and use it at no cost.

Which platforms does DualAgentDebate support?

DualAgentDebate is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created DualAgentDebate?

It is built and maintained by tvaloki (@tvaloki); the current version is v0.3.0.

💬 Comments