Tools
Deepclaw
Evidence-driven research agent for OpenClaw: every claim traced to a source excerpt, every stage checked by a quality gate
README
<p align="center">
<img src="docs/assets/social-preview.png" alt="DeepClaw: a research agent that has to show its sources" width="100%">
</p>
<h3 align="center">An OpenClaw research agent where every claim must point back to a stored source excerpt</h3>
<p align="center">
<a href="https://github.com/YihangHu2004/openclaw-deepclaw/actions/workflows/ci.yml"><img src="https://github.com/YihangHu2004/openclaw-deepclaw/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://openclaw.ai"><img src="https://img.shields.io/badge/OpenClaw-community_extension-10b981" alt="OpenClaw community extension"></a>
<img src="https://img.shields.io/badge/python-3.9%2B-3776ab" alt="Python 3.9+">
<img src="https://img.shields.io/badge/Next.js-16-black" alt="Next.js 16">
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a>
</p>
<p align="center">
<a href="#at-a-glance">At a glance</a> ·
<a href="#see-it-in-action">Screenshots</a> ·
<a href="#pilot-result">Pilot result</a> ·
<a href="#how-it-works">How it works</a> ·
<a href="#quick-start">Quick start</a> ·
<a href="docs/ARCHITECTURE.md">Architecture</a>
</p>
DeepClaw turns a research question or a set of papers into a literature review, a research plan, an audited report, and an optional slide deck. Every material claim is linked to a stored source excerpt. Deterministic quality gates check the actual files before a stage may pass, and the whole run can be resumed after an interruption.
> DeepClaw is an independent community project for the OpenClaw ecosystem. It is not an official OpenClaw Foundation product.
## At a glance
| | |
|---|---|
| **Problem** | LLM research assistants write fluent reviews whose claims often cannot be traced to a source, and "quality checks" usually live only inside the prompt. |
| **Approach** | A 9-stage pipeline (search → reading → synthesis → plan → report → claim audit → peer review) where evidence is a first-class record (`EV-xxx`) and each stage ends in a Python gate that reads the artifacts and records PASS/FAIL. |
| **What is built** | An OpenClaw scientist agent, 11 research workflow skills, deterministic gate and evidence tools, MCP tool servers (Semantic Scholar, math, Wolfram) plus arXiv search, and a local Next.js workspace for inspecting projects, evidence, and agent activity. |
| **Engineering** | Append-only trajectory memory, SHA-256 artifact passports, resumable project state, a loopback proxy that keeps gateway credentials out of the browser, and CI that runs pipeline tests, proxy tests, and a production build. |
| **Early signal** | In a 5-paper pilot, claims extracted through DeepClaw's evidence protocol had a 4.2% drift/unsupported rate versus 10.1% for a plain LLM reading the same papers ([details and caveats](#pilot-result)). |
## See it in action
Screenshots of the local workspace, captured from a demo project on reducing hallucination in retrieval-augmented generation (RAG). The demo is replayed offline, so the chat panel shows no live session.
<p align="center">
<img src="docs/assets/03-evidence.png" alt="Evidence panel: each EV record shows the claim, paper ID, source excerpt, and where the claim is used" width="100%">
<br><sub><b>Evidence ledger.</b> Each <code>EV-xxx</code> record stores the claim, the paper it came from, the verbatim source excerpt, and where the claim is used. The header shows which stage gate last passed.</sub>
</p>
<table>
<tr>
<td width="50%"><img src="docs/assets/04-activity.png" alt="Activity panel with trajectory memory and pipeline state"><br><sub><b>Activity and state.</b> Every agent action is logged to append-only trajectory memory; <code>pipeline_state.json</code> holds stage status and gate results.</sub></td>
<td width="50%"><img src="docs/assets/02-workbench.png" alt="Workbench for starting a research project"><br><sub><b>Workbench.</b> Start from a question or local PDFs; recent projects and gateway status are shown alongside.</sub></td>
</tr>
</table>
## Pilot result
We compared two ways of extracting claims from the same 5 papers (LIMA, MUPPET, UnifiedQA, and two LLM data papers):
| | Claims audited | Drifted | Unsupported | Drift + unsupported rate |
|---|---:|---:|---:|---:|
| DeepClaw evidence protocol | 72 | 3 | 0 | **4.2%** |
| Plain LLM (DeepSeek) reading the paper | 69 | 6 | 1 | 10.1% |
DeepClaw had a lower rate on 4 of the 5 papers. The raw evidence files, per-paper reports, and scripts are in [`example_contrast/`](example_contrast/).
**Caveats.** This is a small exploratory pilot, not a benchmark. The two sets of labels were produced by different audit procedures (DeepSeek's claims were judged by an LLM judge), and the sample is too small for a significance claim. A fixture-based evaluation with a single shared auditor is on the [roadmap](ROADMAP.md).
## The problem it solves
Most research agents optimize for a fluent final answer. DeepClaw optimizes for a defensible process.
| Common failure | DeepClaw's response |
|---|---|
| A polished claim cannot be traced to a source passage | Claims reference persistent `EV-xxx` evidence records |
| An agent silently skips weak or unavailable material | Missing support is marked as `[MATERIAL GAP]` |
| A long research run is lost after interruption | Project state, trajectory logs, hashes, and checkpoints are persisted |
| “Quality review” exists only in the prompt | Python gates compute and store PASS/FAIL results from actual artifacts |
| One model drafts and approves its own work | Claim audit, multi-reviewer critique, and a Devil's Advocate are separate stages |
| The user sees chat but not the research workspace | The local UI exposes projects, sources, evidence, reports, and runtime activity |
## What makes DeepClaw different
### Evidence is a first-class artifact
DeepClaw does not treat citations as decoration. An evidence record preserves the source identifier, verbatim passage, derived claim, source type, confidence, report location, and audit status.
```text
EV-001
Source passage "Our model achieves 94.2% accuracy ..."
Paper 2603.08874
Derived claim "The model reports 94.2% accuracy [EV-001]."
Audit status faithful
```
The example above illustrates the record format; it is not a benchmark result for DeepClaw.
### The workflow can fail visibly
Each stage has an executable acceptance gate. If the literature set is too narrow, evidence is incomplete, a report lacks required sections, or citations drift from their sources, the workflow stops or records a degraded result. Passing a minimum count is never presented as proof of scientific correctness.
### Research remains inspectable and recoverable
The agent's work is stored as ordinary local files instead of disappearing into a chat transcript. A project can be resumed from its last stage, audited manually, compared across revisions, or handed to another contributor without exposing private credentials.
## How it works
```mermaid
flowchart LR
I[Question or PDFs] --> S1[S1 Search]
S1 --> S2[S2 Citation discovery]
S2 --> S3[S3 Full-text reading]
S3 --> S4[S4 Literature synthesis]
S4 --> S5[S5 Research planning]
S5 --> S6[S6 Report generation]
S6 --> S7[S7 Claim audit]
S7 --> S8[S8 Peer review]
S8 --> S9[S9 Slides optional]
```
| Stage | Responsibility | Persistent output |
|---|---|---|
| S1–S2 | Search, citation discovery, deduplication, and triage | Search cache and ranked paper library |
| S3 | Read selected full texts and extract source-grounded evidence | Structured notes and `evidence.json` |
| S4 | Compare methods, findings, disagreements, and open gaps | Related work and gap analysis |
| S5 | Convert gaps into falsifiable hypotheses and an executable plan | Named datasets, baselines, metrics, and feasibility checks |
| S6 | Produce a structured research report | `report.md` and sandboxed `report.html` |
| S7 | Check coverage, source fidelity, and hypothesis support | Claim-level audit results |
| S8 | Run independent reviews and adversarial criticism | Reviewer reports and revision decisions |
| S9 | Generate an optional proposal presentation | Editable `.pptx` deck |
Two execution modes use the same artifacts and gates:
| Mode | Intended use |
|---|---|
| `AUTO` | Runs stages sequentially and pauses only where user judgment is required |
| `INTERACTIVE` | Exposes every stage for approval, revision, or pause |
Interactive checkpoints adapt between full reviews, compact confirmations, and mandatory integrity checks. Evidence audit, report completion, and peer review cannot be silently skipped.
## Quality is part of the workflow
The default gate policy checks more than file existence:
| Gate | Selected requirements |
|---|---|
| Literature coverage | Seminal work, recent work, methods, challenges, and sufficient candidates must be represented |
| Reading completeness | Multiple full texts, structured notes, and evidence records; abstract-only evidence cannot satisfy the gate alone |
| Synthesis quality | Substantive related work, at least three evidence-backed gaps, and a comparison table |
| Plan feasibility | Falsifiable hypothesis, named datasets and baselines, measurable outcomes, and explicit feasibility checks |
| Report integrity | Required sections, method subsections, at least 80% evidence coverage, and bounded material gaps |
| Citation fidelity | High-confidence evidence reviewed; at least 90% faithful after corrections |
| Peer review | Four standard reviewers plus a Devil's Advocate; critical findings must be resolved or documented |
The citation audit has five layers:
1. conflict detection when new evidence is recorded;
2. report-level evidence coverage;
3. claim-to-source fidelity classification;
4. report sentence reconciliation to detect missing or “ghost” evidence IDs;
5. green/yellow/red hypothesis support checks with correction history preserved.
See [the evidence and quali
... (truncated)
tools
Comments
Sign in to leave a comment