Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

docs: fix broken commands, dead links, and stale claims; add README drift pre-commit check (#4950)

LearningCircuitd77b12bb851d
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 3e7d21ef30..a5800982e9 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -325,6 +325,16 @@ repos:
files: ^src/local_deep_research/defaults/.*\.json$
pass_filenames: false
description: "Ensure golden master settings are updated when defaults change"
+ - id: check-readme-links
+ name: Check README links and examples
+ entry: .pre-commit-hooks/check-readme-links.py
+ language: script
+ pass_filenames: false
+ files: ^(README\.md|SECURITY\.md|CONTRIBUTING\.md|docs/.*\.md|src/local_deep_research/web_search_engines/engine_registry\.py)$
+ description: "Validate README.md relative links, heading anchors,
+ python -m examples, and engine=... names against the repo, so
+ renamed docs/headings or removed modules/engines can't silently
+ break the project storefront"
- id: check-layer-imports
name: Check infrastructure packages don't import from web/
entry: .pre-commit-hooks/check-layer-imports.py
diff --git a/.pre-commit-hooks/check-readme-links.py b/.pre-commit-hooks/check-readme-links.py
new file mode 100755
index 0000000000..a5c5c41024
--- /dev/null
+++ b/.pre-commit-hooks/check-readme-links.py
@@ -0,0 +1,219 @@
+#!/usr/bin/env python3
+"""Pre-commit hook: keep README.md claims verifiable against the repo.
+
+README.md is the project storefront, and it drifts: files move, headings
+get renamed, CLI entry points change, and example snippets keep naming
+things that no longer exist. A 2026-07 audit found a benchmark command
+that had never been runnable, a `reset` example missing its required
+flag, and an MCP example querying a search engine that was never
+implemented. This hook catches those drift classes at commit time:
+
+1. Relative markdown links must point at files/directories that exist.
+2. Anchor fragments (``docs/faq.md#some-heading`` or same-file
+ ``#-benchmarks``) must match a real heading in the target file,
+ using GitHub's slug rules. ``#L10``/``#L10-L20`` line anchors must
+ be within the target file's line count.
+3. ``python -m local_deep_research...`` examples must reference a real,
+ runnable module: a ``<module>.py`` file or a package directory
+ containing ``__main__.py`` under ``src/``.
+4. ``engine="<name>"`` examples must name an engine registered in
+ ``ENGINE_REGISTRY`` (parsed from engine_registry.py).
+
+External (http/https/mailto) links are not checked -- no network access
+at commit time.
+"""
+
+import argparse
+import re
+import sys
+from pathlib import Path
+from urllib.parse import unquote, urlparse
+
+REPO_ROOT = Path(__file__).resolve().parent.parent
+
+# Files whose internal references this hook validates.
+CHECKED_FILES = ["README.md"]
+
+ENGINE_REGISTRY_PATH = Path(
+ "src/local_deep_research/web_search_engines/engine_registry.py"
+)
+
+# Inline markdown links/images: [text](target) / ![alt](target "title").
+# The target group stops at whitespace or ')' so optional "title" parts
+# are excluded.
+MARKDOWN_LINK = re.compile(r"!?\[[^\]]*\]\(\s*<?([^)<>\s]+)>?[^)]*\)")
+
+# Relative href/src in inline HTML.
+HTML_REF = re.compile(r"""(?:href|src)=["']([^"']+)["']""")
+
+# `python -m some.module` (also matches python3).
+PYTHON_M = re.compile(r"python3?\s+-m\s+([A-Za-z_][\w.]*)")
+
+# engine="name" in example snippets.
+ENGINE_KWARG = re.compile(r"""engine=["']([\w\-]+)["']""")
+
+# GitHub file line anchors: #L10 or #L10-L20.
+LINE_ANCHOR = re.compile(r"^L(\d+)(?:-L(\d+))?$")
+
+# Registry entries: ` "name": EngineEntry(`.
+REGISTRY_KEY = re.compile(r"^\s+\"([\w\-]+)\":\s*EngineEntry\(", re.M)
+
+FENCE = re.compile(r"^\s*(```|~~~)")
+
+
+def github_slug(heading: str) -> str:
+ """Approximate GitHub's heading-to-anchor slug algorithm.
+
+ Lowercase, strip markdown link syntax, drop everything that is not a
+ letter/digit/space/hyphen/underscore (this removes emoji and other
+ punctuation), then turn spaces into hyphens.
+ """
+ text = re.sub(r"\[([^\]]*)\]\([^)]*\)", r"\1", heading).strip().lower()
+ kept = [c for c in text if c.isalnum() or c in "-_ "]
+ return "".join(kept).replace(" ", "-")
+
+
+def iter_headings(md_text: str):
+ """Yield ATX heading texts, skipping fenced code blocks."""
+ in_fence = False
+ for line in md_text.splitlines():
+ if FENCE.match(line):
+ in_fence = not in_fence
+ continue
+ if in_fence:
+ continue
+ match = re.match(r"^#{1,6}\s+(.*)$", line)
+ if match:
+ yield match.group(1)
+
+
+def heading_slugs(md_text: str) -> set:
+ return {github_slug(h) for h in iter_headings(md_text)}
+
+
+def check_anchor(target: Path, fragment: str) -> str:
+ """Return an error message for a bad anchor, or '' if it resolves."""
+ line_match = LINE_ANCHOR.match(fragment)
+ if line_match:
+ last = int(line_match.group(2) or line_match.group(1))
+ lines = len(target.read_text(encoding="utf-8").splitlines())
+ if last > lines:
+ return (
+ f"line anchor #{fragment} exceeds file length ({lines} lines)"
+ )
+ return ""
+ if target.suffix.lower() not in (".md", ".markdown"):
+ # GitHub only generates heading anchors for rendered markdown.
+ return f"anchor #{fragment} on non-markdown file cannot be verified"
+ slugs = heading_slugs(target.read_text(encoding="utf-8"))
+ slug = fragment.lower()
+ if slug in slugs:
+ return ""
+ # GitHub dedupes duplicate headings by appending -1, -2, ...
+ base = re.sub(r"-\d+$", "", slug)
+ if base != slug and base in slugs:
+ return ""
+ return f"no heading matches anchor #{fragment}"
+
+
+def check_links(md_path: Path, text: str) -> list:
+ errors = []
+ targets = MARKDOWN_LINK.findall(text) + HTML_REF.findall(text)
+ for raw_target in targets:
+ parsed = urlparse(raw_target)
+ if parsed.scheme or raw_target.startswith("//"):
+ continue # external; not checkable offline
+ rel_path, fragment = unquote(parsed.path), parsed.fragment
+ target = (md_path.parent / rel_path if rel_path else md_path).resolve()
+ if not target.exists():
+ errors.append(f"broken link: {raw_target} (file not found)")
+ continue
+ if fragment and target.is_file():
+ anchor_error = check_anchor(target, fragment)
+ if anchor_error:
+ errors.append(f"broken link: {raw_target} ({anchor_error})")
+ return errors
+
+
+def check_python_modules(root: Path, text: str) -> list:
+ errors = []
+ for module in PYTHON_M.findall(text):
+ if not module.startswith("local_deep_research"):
+ continue
+ base = root / "src" / Path(*module.split("."))
+ if base.with_suffix(".py").is_file():
+ continue
+ if (base / "__main__.py").is_file():
+ continue
+ errors.append(
+ f"`python -m {module}` is not runnable: expected "
+ f"src/{'/'.join(module.split('.'))}.py or .../__main__.py"
+ )
+ return errors
+
+
+def check_engine_names(root: Path, text: str) -> list:
+ engines = ENGINE_KWARG.findall(text)
+ if not engines:
+ return []
+ registry_file = root / ENGINE_REGISTRY_PATH
+ if not registry_file.is_file():
+ return [f"cannot verify engine names: {ENGINE_REGISTRY_PATH} missing"]
+ registered = set(
+ REGISTRY_KEY.findall(registry_file.read_text(encoding="utf-8"))
+ )
+ if not registered:
+ # The registry format changed; failing loudly beats silently
+ # skipping the check.
+ return [
+ f"could not parse any engine names from {ENGINE_REGISTRY_PATH}; "
+ "update REGISTRY_KEY in this hook"
+ ]
+ return [
+ f'engine="{name}" is not a registered search engine '
+ f"(see {ENGINE_REGISTRY_PATH})"
+ for name in engines
+ if name not in registered
+ ]
+
+
+def main() -> int:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument(
+ "--root",
+ type=Path,
+ default=REPO_ROOT,
+ help="Repository root to check against (test seam)",
+ )
+ args = parser.parse_args()
+ root = args.root.resolve()
+
+ all_errors = []
+ for name in CHECKED_FILES:
+ md_path = root / name
+ if not md_path.is_file():
+ all_errors.append((name, "file is missing"))
+ continue
+ text = md_path.read_text(encoding="utf-8")
+ for error in (
+ check_links(md_path, text)
+ + check_python_modules(root, text)
+ + check_engine_names(root, text)
+ ):
+ all_errors.append((name, error))
+
+ if all_errors:
+ print("❌ README REFERENCES SOMETHING THAT DOES NOT EXIST")
+ print("=" * 60)
+ for name, error in all_errors:
+ print(f"📄 {name}: {error}")
+ print("=" * 60)
+ print("FIX: update the link/example to match the repo, or fix the")
+ print("hook if GitHub's anchor rules are approximated incorrectly")
+ print("(.pre-commit-hooks/check-readme-links.py).")
+ return 1
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/README.md b/README.md
index 6c19f96472..9be77c29e6 100644
--- a/README.md
+++ b/README.md
@@ -59,7 +59,7 @@ docker exec ollama ollama pull gpt-oss:20b
docker run -d -p 8080:8080 --name searxng searxng/searxng
# Step 3: Pull and run Local Deep Research
-docker run -d -p 5000:5000 --network host \
+docker run -d --network host \
--name local-deep-research \
--volume "deep-research:/data" \
-e LDR_DATA_DIR=/data \
@@ -105,7 +105,7 @@ You ask a complex question. LDR:
- Searches across web, academic papers, and your own documents
- Synthesizes everything into a report with proper citations
-Choose from 20+ research strategies for quick facts, deep analysis, or academic research.
+Choose the research strategy that fits: quick pipeline modes for fast facts, or fully agentic deep research for complex analysis and academic work.
**LangGraph Agent Strategy** — An autonomous agentic research mode where the LLM decides what to search, which specialized engines to use (arXiv, PubMed, Semantic Scholar, etc.), and when to synthesize. It adaptively switches between search engines based on what it finds and collects significantly more sources than pipeline-based strategies — this is the strategy behind the ~95% SimpleQA result above. Select `langgraph-agent` in Settings.
@@ -156,41 +156,11 @@ flowchart LR
Your data stays yours. Each user gets their own isolated SQLCipher database encrypted with AES-256, with the key derived from your password. Your password is never stored — login works by attempting to decrypt your database, so the database files on their own are unusable to anyone who obtains them. Per-user LLM API keys live encrypted inside the same personal database rather than in a shared server-level store.
-The [Docker setup](docker-compose.yml) ships with `cap_drop: ALL`, `no-new-privileges`, and a non-root runtime, with images pinned by digest. Or run fully local with Ollama + SearXNG and nothing ever leaves your machine.
+The [Docker setup](docker-compose.yml) ships with `cap_drop: ALL`, `no-new-privileges`, and a non-root runtime, with the bundled Ollama and SearXNG images pinned by digest. Or run fully local with Ollama + SearXNG and nothing ever leaves your machine.
**In-memory credentials**: Like all applications that use secrets at runtime — including [password managers](https://www.ise.io/casestudies/password-manager-hacking/), browsers, and API clients — credentials are held in plain text in process memory during active sessions. This is an [industry-wide accepted reality](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html), not specific to LDR: if an attacker can read process memory, they can also read any in-process decryption key. We mitigate this with session-scoped credential lifetimes and core dump exclusion. Ideas for further improvements are always welcome via [GitHub Issues](https://github.com/LearningCircuit/local-deep-research/issues). See our [Security Policy](SECURITY.md) for details.
-**Supply Chain Security**: Docker images are signed with [Cosign](https://github.com/sigstore/cosign) using GitHub's keyless OIDC flow, include SLSA provenance attestations, and ship with attested SPDX SBOMs. Verify the image and its SBOM before running:
-
-```bash
-# 1. Verify image signature
-cosign verify \
- --certificate-identity-regexp "^https://github\.com/LearningCircuit/local-deep-research/\.github/workflows/prerelease-docker\.yml@.*$" \
- --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
- --certificate-github-workflow-repository "LearningCircuit/local-deep-research" \
- localdeepresearch/local-deep-research:latest
-
-# 2. Verify SBOM attestation (SPDX JSON) for YOUR platform
-# SBOM attestations are stored per-architecture (amd64, arm64) on the
-# per-arch image digest, not on the multi-arch manifest list. Resolve to
-# your platform's digest first.
-ARCH=$(uname -m | sed -e 's/^x86_64$/amd64/' -e 's/^aarch64$/arm64/')
-PLATFORM_DIGEST=$(docker buildx imagetools inspect localdeepresearch/local-deep-research:latest --raw \
- | jq -r --arg arch "$ARCH" '.manifests[] | select(.platform.architecture==$arch) | .digest')
-if [ -z "$PLATFORM_DIGEST" ]; then
- echo "No per-arch digest found for $ARCH — image may be single-arch or" \
- "from a pre-build-once-promote release. Skip step 2 in that case."
- exit 1
-fi
-cosign verify-attestation \
- --type spdxjson \
- --certificate-identity-regexp "^https://github\.com/LearningCircuit/local-deep-research/\.github/workflows/prerelease-docker\.yml@.*$" \
- --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
- --certificate-github-workflow-repository "LearningCircuit/local-deep-research" \
- "localdeepresearch/local-deep-research@${PLATFORM_DIGEST}"
-```
-
-The image-signature check confirms the image was built by the official `prerelease-docker.yml` workflow in `LearningCircuit/local-deep-research` — not by a forked repo or a leaked credential. The per-platform SBOM verification ensures you're inspecting the actual package set you're going to run, not the SBOM of a different architecture. Requires [cosign v2.0+](https://docs.sigstore.dev/cosign/installation/), [`jq`](https://jqlang.github.io/jq/), and `docker buildx` (bundled with Docker Desktop and Docker Engine ≥ 23.0; install the standalone plugin on older installs). Releases before the build-once-promote refactor were signed by `docker-publish.yml` and carried a single manifest-level SBOM rather than per-arch ones; for those, substitute `docker-publish.yml` for `prerelease-docker.yml` in the regex on both steps and skip the per-platform digest lookup (use the manifest list tag directly).
+**Supply Chain Security**: Docker images are signed with [Cosign](https://github.com/sigstore/cosign) using GitHub's keyless OIDC flow, include SLSA provenance attestations, and ship with attested SPDX SBOMs. See [Verifying images and SBOMs](SECURITY.md#verifying-images-and-sboms) for the step-by-step verification commands.
**Security Transparency**: Scanner suppressions are documented with justifications in [Security Alerts Assessment](.github/SECURITY_ALERTS.md), [Scorecard Compliance](.github/SECURITY_SCORECARD.md), [Container CVE Suppressions](.trivyignore), and [SAST Rule Rationale](bearer.yml). Some alerts (Dependabot, code scanning) can only be dismissed or are very difficult to suppress outside the [GitHub Security tab](https://docs.github.com/en/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts), so the files above do not cover every dismissed finding.
@@ -206,8 +176,6 @@ Since we don't collect any usage data, we rely on you to tell us what works, wha
## 📊 Benchmarks
-### Benchmark Results
-
Headline results from the [community benchmarks](https://huggingface.co/datasets/local-deep-research/ldr-benchmarks) using the `langgraph-agent` strategy with Serper search, fully local via Ollama:
| Model | SimpleQA | xbench-DeepSearch |
@@ -216,18 +184,11 @@ Headline results from the [community benchmarks](https://huggingface.co/datasets
| Qwen3.5-9B | 91.2% (182/200) | 59.0% (59/100) |
| gpt-oss-20B | 85.4% (295/346) | – |
-Caveats: small samples, LLM-grader noise, and SimpleQA contamination risk on newer base models. See the [HF dataset card](https://huggingface.co/datasets/local-deep-research/ldr-benchmarks) for the full leaderboard, or [run your own benchmarks →](docs/BENCHMARKING.md).
-
-### 🧭 Picking a model? Use the community benchmarks
-
-Not sure which local model to run with LDR? The community-maintained **[LDR Benchmarks dataset on Hugging Face](https://huggingface.co/datasets/local-deep-research/ldr-benchmarks)** tracks accuracy across models, search engines, and research strategies — it's the fastest way to see which Ollama / LM Studio / llama.cpp models actually work well for deep research before you download multi-GB weights.
-
-- **[Browse leaderboards & download CSVs on Hugging Face →](https://huggingface.co/datasets/local-deep-research/ldr-benchmarks)**
-- **[Submit your own results on GitHub →](https://github.com/LearningCircuit/ldr-benchmarks)**
+Caveats: small samples, LLM-grader noise, and SimpleQA contamination risk on newer base models.
-### Benchmark Contributors
+Picking a local model? The same community-maintained dataset tracks accuracy across models, search engines, and research strategies — the fastest way to see which Ollama / LM Studio / llama.cpp models actually work well for deep research before you download multi-GB weights. **[Browse the full leaderboard on Hugging Face →](https://huggingface.co/datasets/local-deep-research/ldr-benchmarks)**
-Community members who have contributed benchmark runs are listed in [CONTRIBUTORS.md](https://github.com/LearningCircuit/ldr-benchmarks/blob/main/CONTRIBUTORS.md). [Submit your own results →](https://github.com/LearningCircuit/ldr-benchmarks)
+[Submit your own results →](https://github.com/LearningCircuit/ldr-benchmarks) (contributors are listed in [CONTRIBUTORS.md](https://github.com/LearningCircuit/ldr-benchmarks/blob/main/CONTRIBUTORS.md)), or [run benchmarks locally →](docs/BENCHMARKING.md).
## ✨ Key Features
@@ -248,7 +209,7 @@ Community members who have contributed benchmark runs are listed in [CONTRIBUTOR
- **Export Options** - Download results as PDF or Markdown
- **Research History** - Save, search, and revisit past research
- **Adaptive Rate Limiting** - Intelligent retry system that learns optimal wait times
-- **Keyboard Shortcuts** - Navigate efficiently (ESC, Ctrl+Shift+1-5)
+- **Keyboard Shortcuts** - Navigate efficiently (ESC, Ctrl+Shift+1-4)
- **Per-User Encrypted Databases** - Secure, isolated data storage for each user
### 📰 News & Research Subscriptions
@@ -333,11 +294,11 @@ response = session.post("http://localhost:5000/api/start_research",
```bash
# Run benchmarks from CLI
-python -m local_deep_research.benchmarks --dataset simpleqa --examples 50
+python -m local_deep_research.benchmarks.cli.benchmark_commands simpleqa --examples 50
# Manage rate limiting
python -m local_deep_research.web_search_engines.rate_limiting status
-python -m local_deep_research.web_search_engines.rate_limiting reset
+python -m local_deep_research.web_search_engines.rate_limiting reset --engine SearXNGSearchEngine
```
See the [Command Line Tools guide](docs/cli-tools.md) for the full reference.
@@ -365,7 +326,7 @@ Works with: FAISS, Chroma, Pinecone, Weaviate, Elasticsearch, and any LangChain-
LDR provides an MCP (Model Context Protocol) server that allows AI assistants like Claude Desktop and Claude Code to perform deep research. Full setup details in the [MCP Server guide](docs/mcp-server.md).
-> ⚠️ **Security Note**: This MCP server is designed for **local use only** via STDIO transport (e.g., Claude Desktop). It has no built-in authentication or rate limiting. Do not expose over a network without implementing proper security controls. See the [MCP Security Guide](https://modelcontextprotocol.io/docs/concepts/security) for network deployment requirements.
+> ⚠️ **Security Note**: This MCP server is designed for **local use only** via STDIO transport (e.g., Claude Desktop). It has no built-in authentication or rate limiting. Do not expose over a network without implementing proper security controls. See the [MCP Security Best Practices](https://modelcontextprotocol.io/docs/tutorials/security/security_best_practices) for network deployment requirements.
### Installation
@@ -437,8 +398,8 @@ search(query="CRISPR clinical trials 2024", engine="pubmed")
# Search Wikipedia for quick facts
search(query="quantum error correction", engine="wikipedia")
-# Search OpenClaw for legal case law
-search(query="copyright fair use precedents", engine="openclaw")
+# Search GitHub for code and repositories
+search(query="agentic research frameworks", engine="github")
# Use list_search_engines() to see all available engines
```
@@ -461,12 +422,12 @@ search(query="copyright fair use precedents", engine="openclaw")
- Common models: Llama 3, Mistral, Gemma, DeepSeek, Qwen
- LLM processing stays local (search queries still go to web). No API costs.
-> 💡 **Which local model should I pick?** Check the **[LDR Benchmarks dataset on Hugging Face](https://huggingface.co/datasets/local-deep-research/ldr-benchmarks)** — community-submitted accuracy numbers across local and cloud models, so you can compare before downloading. Also on [GitHub](https://github.com/LearningCircuit/ldr-benchmarks) if you want to submit your own runs.
+> 💡 **Which local model should I pick?** See the [community benchmarks](#-benchmarks) — community-submitted accuracy numbers across local and cloud models, so you can compare before downloading.
### Cloud Models
-- OpenAI (GPT-4, GPT-3.5)
-- Anthropic (Claude 3)
-- Google (Gemini)
+- OpenAI
+- Anthropic Claude
+- Google Gemini
- 100+ models via OpenRouter
### Custom Endpoints
@@ -619,4 +580,4 @@ These projects run on donations and grants, not paywalls. If Local Deep Research
MIT License - see [LICENSE](LICENSE) file.
-**Dependencies:** All third-party packages use permissive licenses (MIT, Apache-2.0, BSD, etc.) - see [allowlist](.github/workflows/dependency-review.yml#L50-L68)
+**Dependencies:** All third-party packages use permissive licenses (MIT, Apache-2.0, BSD, etc.) - see [allowlist](.github/workflows/dependency-review.yml)
diff --git a/SECURITY.md b/SECURITY.md
index 7612b17eab..7c24a1ba5e 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -300,6 +300,40 @@ We maintain comprehensive automated security scanning across the entire developm
| **SBOM Attachments** | SBOMs attached to container images and releases |
| **Keyless Signing** | Uses GitHub OIDC for Sigstore keyless signing |
+#### Verifying images and SBOMs
+
+Verify the image and its SBOM before running:
+
+```bash
+# 1. Verify image signature
+cosign verify \
+ --certificate-identity-regexp "^https://github\.com/LearningCircuit/local-deep-research/\.github/workflows/prerelease-docker\.yml@.*$" \
+ --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
+ --certificate-github-workflow-repository "LearningCircuit/local-deep-research" \
+ localdeepresearch/local-deep-research:latest
+
+# 2. Verify SBOM attestation (SPDX JSON) for YOUR platform
+# SBOM attestations are stored per-architecture (amd64, arm64) on the
+# per-arch image digest, not on the multi-arch manifest list. Resolve to
+# your platform's digest first.
+ARCH=$(uname -m | sed -e 's/^x86_64$/amd64/' -e 's/^aarch64$/arm64/')
+PLATFORM_DIGEST=$(docker buildx imagetools inspect localdeepresearch/local-deep-research:latest --raw \
+ | jq -r --arg arch "$ARCH" '.manifests[] | select(.platform.architecture==$arch) | .digest')
+if [ -z "$PLATFORM_DIGEST" ]; then
+ echo "No per-arch digest found for $ARCH — image may be single-arch or" \
+ "from a pre-build-once-promote release. Skip step 2 in that case."
+ exit 1
+fi
+cosign verify-attestation \
+ --type spdxjson \
+ --certificate-identity-regexp "^https://github\.com/LearningCircuit/local-deep-research/\.github/workflows/prerelease-docker\.yml@.*$" \
+ --certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
+ --certificate-github-workflow-repository "LearningCircuit/local-deep-research" \
+ "localdeepresearch/local-deep-research@${PLATFORM_DIGEST}"
+```
+
+The image-signature check confirms the image was built by the official `prerelease-docker.yml` workflow in `LearningCircuit/local-deep-research` — not by a forked repo or a leaked credential. The per-platform SBOM verification ensures you're inspecting the actual package set you're going to run, not the SBOM of a different architecture. Requires [cosign v2.0+](https://docs.sigstore.dev/cosign/system_config/installation/), [`jq`](https://jqlang.github.io/jq/), and `docker buildx` (bundled with Docker Desktop and Docker Engine ≥ 23.0; install the standalone plugin on older installs). Releases before the build-once-promote refactor were signed by `docker-publish.yml` and carried a single manifest-level SBOM rather than per-arch ones; for those, substitute `docker-publish.yml` for `prerelease-docker.yml` in the regex on both steps and skip the per-platform digest lookup (use the manifest list tag directly).
+
### Security Best Practices
All workflows follow security best practices:
diff --git a/changelog.d/4950.misc.md b/changelog.d/4950.misc.md
new file mode 100644
index 0000000000..4d64f21e5f
--- /dev/null
+++ b/changelog.d/4950.misc.md
@@ -0,0 +1,5 @@
+Fixed broken copy-paste examples in the README and docs (benchmark CLI
+module path, `rate_limiting reset --engine`, nonexistent `openclaw`
+search engine) plus two dead external links, and added a pre-commit
+check that keeps README links, anchors, and examples in sync with the
+codebase.
diff --git a/docs/architecture.md b/docs/architecture.md
index 6ef228467f..7d4d61d49f 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -17,7 +17,7 @@ flowchart TB
end
subgraph RESEARCH["🔬 Research Engine"]
- STRAT[Strategy Selector<br/>20+ strategies]
+ STRAT[Strategy Selector]
QGEN[Question Generator]
EXEC[Search Executor]
SYNTH[Report Synthesizer]
@@ -178,7 +178,7 @@ mindmap
Quick Summary
Detailed Reports
Follow-up Questions
- 20+ Strategies
+ Research Strategies
Search Sources
Web Search
SearXNG
@@ -345,7 +345,7 @@ This section provides a comprehensive technical analysis of the codebase, includ
| Test Classes | 809+ |
| Search Engine Implementations | 25 |
| LLM Provider Implementations | 9 |
-| Search Strategies | 20+ |
+| Search Strategies | 5 |
| Abstract Base Classes | 26 |
| CI/CD Workflows | 57 |
| Security Scanners in CI | 22+ |
@@ -561,7 +561,7 @@ While the project scores highly overall, these areas have room for growth:
| Component | Location | Purpose |
|-----------|----------|---------|
| Research Engine | `src/local_deep_research/search_system.py` | Main `AdvancedSearchSystem` class |
-| Strategies | `src/local_deep_research/advanced_search_system/strategies/` | 20+ research strategies |
+| Strategies | `src/local_deep_research/advanced_search_system/strategies/` | Research strategy implementations |
| Search Engines | `src/local_deep_research/web_search_engines/engines/` | 25 search engine implementations |
| Report Generation | `src/local_deep_research/report_generator.py` | `IntegratedReportGenerator` |
| Web API | `src/local_deep_research/web/routes/` | Flask routes and WebSocket handlers |
diff --git a/docs/features.md b/docs/features.md
index 62fd93aaea..d49a1162e3 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -308,10 +308,9 @@ result = client.research(
**Usage:**
```bash
-python -m local_deep_research.benchmarks \
- --dataset simpleqa \
+python -m local_deep_research.benchmarks.cli.benchmark_commands simpleqa \
--examples 100 \
- --config your_config.json
+ --search-tool searxng
```
@@ -319,11 +318,11 @@ python -m local_deep_research.benchmarks \
```bash
# Run benchmarks from CLI
-python -m local_deep_research.benchmarks --dataset simpleqa --examples 50
+python -m local_deep_research.benchmarks.cli.benchmark_commands simpleqa --examples 50
# Manage rate limiting
python -m local_deep_research.web_search_engines.rate_limiting status
-python -m local_deep_research.web_search_engines.rate_limiting reset
+python -m local_deep_research.web_search_engines.rate_limiting reset --engine SearXNGSearchEngine
```
## Performance Features
diff --git a/docs/mcp-server.md b/docs/mcp-server.md
index 1f741a6060..2d9b6dbbaf 100644
--- a/docs/mcp-server.md
+++ b/docs/mcp-server.md
@@ -325,7 +325,7 @@ Raw search results without LLM processing. Typically takes **5-30 seconds**. No
}
```
-Common engines: `arxiv` (academic papers), `pubmed` (medical literature), `wikipedia` (encyclopedic), `searxng` (meta-search), `openclaw` (legal case law), `github` (code/repos), `semantic_scholar` (citations). Use `list_search_engines()` for the full list.
+Common engines: `arxiv` (academic papers), `pubmed` (medical literature), `wikipedia` (encyclopedic), `searxng` (meta-search), `github` (code/repos), `semantic_scholar` (citations). Use `list_search_engines()` for the full list.
Best for: raw search results for your own analysis, quick lookups, checking what sources are available before running full research. Especially useful for **monitoring and subscriptions** — check for new content regularly without LLM cost.
@@ -424,7 +424,7 @@ Search collection 'research-papers' for: machine learning optimization technique
**Agentic research:**
```
-Use the mcp strategy to research the environmental impact of cryptocurrency mining,
+Use the langgraph-agent strategy to research the environmental impact of cryptocurrency mining,
considering both proof-of-work and proof-of-stake systems
```
@@ -433,7 +433,7 @@ considering both proof-of-work and proof-of-stake systems
Search arxiv for recent papers on diffusion models
Search pubmed for CRISPR clinical trials 2024
Search wikipedia for quantum error correction
-Search openclaw for copyright fair use precedents
+Search github for agentic research frameworks
```
The `search` tool is especially useful for **monitoring and subscriptions** — check for new content on a topic regularly without burning LLM tokens. An AI agent can call `search` to get raw results, then decide whether to run a full `detailed_research` only when something interesting appears.
diff --git a/src/local_deep_research/benchmarks/README.md b/src/local_deep_research/benchmarks/README.md
index deca3446a5..917f490c97 100644
--- a/src/local_deep_research/benchmarks/README.md
+++ b/src/local_deep_research/benchmarks/README.md
@@ -44,13 +44,13 @@ print(f"Accuracy: {result['metrics']['accuracy']:.3f}")
```bash
# Run SimpleQA benchmark
-python -m local_deep_research.cli.benchmark_commands simpleqa --examples 20 --iterations 3
+python -m local_deep_research.benchmarks.cli.benchmark_commands simpleqa --examples 20 --iterations 3
# Run BrowseComp benchmark
-python -m local_deep_research.cli.benchmark_commands browsecomp --examples 10 --search-tool wikipedia
+python -m local_deep_research.benchmarks.cli.benchmark_commands browsecomp --examples 10 --search-tool wikipedia
# Compare configurations
-python -m local_deep_research.cli.benchmark_commands compare --dataset simpleqa --examples 5
+python -m local_deep_research.benchmarks.cli.benchmark_commands compare --dataset simpleqa --examples 5
```
### Web Interface
diff --git a/tests/hooks/test_check_readme_links.py b/tests/hooks/test_check_readme_links.py
new file mode 100644
index 0000000000..c1fba51e21
--- /dev/null
+++ b/tests/hooks/test_check_readme_links.py
@@ -0,0 +1,141 @@
+"""Tests for the check-readme-links pre-commit hook.
+
+Verifies that the hook flags broken relative links, dangling heading
+anchors, non-runnable ``python -m`` examples, and unregistered
+``engine="..."`` names in README.md, while accepting a README whose
+references all resolve — including GitHub-style anchors for headings
+that contain emoji.
+"""
+
+import subprocess
+import sys
+from pathlib import Path
+
+HOOK_SCRIPT = (
+ Path(__file__).parent.parent.parent
+ / ".pre-commit-hooks"
+ / "check-readme-links.py"
+)
+
+REGISTRY_REL = Path("src/local_deep_research/web_search_engines")
+
+VALID_README = """# Test Project
+
+[a doc](docs/real.md)
+[an anchor](docs/real.md#real-heading)
+[emoji same-file anchor](#-benchmarks)
+[line anchor](docs/real.md#L1)
+
+## 📊 Benchmarks
+
+```bash
+python -m local_deep_research.pkg
+python -m local_deep_research.tool.cli run --flag
+```
+
+`search(query="x", engine="arxiv")`
+"""
+
+
+def _make_repo(tmp_path: Path, readme: str) -> Path:
+ """Build a minimal fake repo the hook can be pointed at via --root."""
+ (tmp_path / "README.md").write_text(readme, encoding="utf-8")
+ docs = tmp_path / "docs"
+ docs.mkdir()
+ (docs / "real.md").write_text("## Real Heading\n", encoding="utf-8")
+
+ pkg = tmp_path / "src" / "local_deep_research" / "pkg"
+ pkg.mkdir(parents=True)
+ (pkg / "__main__.py").write_text("", encoding="utf-8")
+ tool = tmp_path / "src" / "local_deep_research" / "tool"
+ tool.mkdir()
+ (tool / "cli.py").write_text("", encoding="utf-8")
+
+ registry_dir = tmp_path / REGISTRY_REL
+ registry_dir.mkdir(parents=True)
+ (registry_dir / "engine_registry.py").write_text(
+ 'ENGINE_REGISTRY = {\n "arxiv": EngineEntry(\n', encoding="utf-8"
+ )
+ return tmp_path
+
+
+def _run_hook(root: Path):
+ return subprocess.run(
+ [sys.executable, str(HOOK_SCRIPT), "--root", str(root)],
+ capture_output=True,
+ text=True,
+ )
+
+
+class TestAcceptsValidReadme:
+ def test_all_references_resolve(self, tmp_path):
+ result = _run_hook(_make_repo(tmp_path, VALID_README))
+ assert result.returncode == 0, result.stdout
+
+ def test_external_links_are_ignored(self, tmp_path):
+ readme = "[ext](https://example.com/gone) [m](mailto:[email protected])\n"
+ result = _run_hook(_make_repo(tmp_path, readme))
+ assert result.returncode == 0, result.stdout
+
+ def test_non_ldr_modules_are_ignored(self, tmp_path):
+ result = _run_hook(_make_repo(tmp_path, "`python -m http.server`\n"))
+ assert result.returncode == 0, result.stdout
+
+
+class TestFlagsBrokenReferences:
+ def test_missing_link_target(self, tmp_path):
+ result = _run_hook(_make_repo(tmp_path, "[x](docs/nope.md)\n"))
+ assert result.returncode == 1
+ assert "docs/nope.md" in result.stdout
+
+ def test_dangling_heading_anchor(self, tmp_path):
+ result = _run_hook(_make_repo(tmp_path, "[x](docs/real.md#gone)\n"))
+ assert result.returncode == 1
+ assert "#gone" in result.stdout
+
+ def test_dangling_same_file_anchor(self, tmp_path):
+ result = _run_hook(_make_repo(tmp_path, "# T\n[x](#missing)\n"))
+ assert result.returncode == 1
+ assert "#missing" in result.stdout
+
+ def test_line_anchor_beyond_eof(self, tmp_path):
+ result = _run_hook(_make_repo(tmp_path, "[x](docs/real.md#L999)\n"))
+ assert result.returncode == 1
+ assert "L999" in result.stdout
+
+ def test_unrunnable_python_module(self, tmp_path):
+ readme = "`python -m local_deep_research.missing.mod`\n"
+ result = _run_hook(_make_repo(tmp_path, readme))
+ assert result.returncode == 1
+ assert "local_deep_research.missing.mod" in result.stdout
+
+ def test_package_without_dunder_main(self, tmp_path):
+ # src/local_deep_research/pkg exists but we point one level up,
+ # at a directory that has no __main__.py.
+ readme = "`python -m local_deep_research`\n"
+ result = _run_hook(_make_repo(tmp_path, readme))
+ assert result.returncode == 1
+
+ def test_unregistered_engine_name(self, tmp_path):
+ readme = 'search(query="x", engine="ghost")\n'
+ result = _run_hook(_make_repo(tmp_path, readme))
+ assert result.returncode == 1
+ assert 'engine="ghost"' in result.stdout
+
+ def test_missing_registry_fails_loudly(self, tmp_path):
+ root = _make_repo(tmp_path, 'search(query="x", engine="arxiv")\n')
+ (root / REGISTRY_REL / "engine_registry.py").unlink()
+ result = _run_hook(root)
+ assert result.returncode == 1
+ assert "cannot verify engine names" in result.stdout
+
+
+class TestRealRepo:
+ def test_actual_readme_passes(self):
+ """The repo's own README must satisfy its own storefront check."""
+ result = subprocess.run(
+ [sys.executable, str(HOOK_SCRIPT)],
+ capture_output=True,
+ text=True,
+ )
+ assert result.returncode == 0, result.stdout