# Openclaw Expert Brain

Adopt this skill: https://proskills.md/skills/other/openclaw-expert-brain

Page: https://proskills.md/skills/other/openclaw-expert-brain
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: LICENSE
upstream: https://github.com/radelqui/openclaw-expert-brain/blob/HEAD/LICENSE

Content is not inlined in the catalog. Read the upstream file: https://github.com/radelqui/openclaw-expert-brain/blob/HEAD/LICENSE

## File: README.md
upstream: https://github.com/radelqui/openclaw-expert-brain/blob/HEAD/README.md

````text
# openclaw-expert-brain

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![OpenClaw 2.x](https://img.shields.io/badge/OpenClaw-2.x-green.svg)](https://openclaw.dev)
[![ClawHub](https://img.shields.io/badge/ClawHub-published-orange.svg)](https://clawhub.ai/radelqui/openclaw-expert-brain)

> Query 185 curated OpenClaw sources via NotebookLM — 40 lines of Python, no Chromium, 5-10s response.

---

## What it does

A skill for Claude Code / OpenClaw that queries a NotebookLM notebook backed by 185 curated sources. Returns grounded answers with **real citations** — no hallucinations, no vague summaries.

Covers: Boris methodology, SYNAPSE architecture, GSD orchestration, MCP configuration, agent patterns, and deployment workflows.

---

## Before vs After

| | Before | After |
|---|---|---|
| **Lines of code** | 300+ | ~40 |
| **Dependencies** | Playwright + Chromium | `nlm-cli` only |
| **Headless support** | Fragile / broken | Native |
| **Response time** | 30-60 seconds | **5-10 seconds** |
| **Citations** | None | Real source citations |
| **Maintenance** | Breaks on UI changes | Stable API |

---

## Install

**Via ClawHub (recommended):**
```bash
clawhub install radelqui/openclaw-expert-brain
```

**Manual:**
```bash
pip install nlm-cli
# Copy skill.py to your OpenClaw skills directory
cp skill.py ~/.openclaw/skills/openclaw-expert-brain/
```

---

## Usage

```bash
/openclaw-expert-brain "how do I configure Boris integration"
/openclaw-expert-brain "what is the SYNAPSE method"
/openclaw-expert-brain "GSD wave execution pattern"
```

Returns the answer plus the source documents it drew from.

---

## How it works

```
User query
    │
    ▼
skill.py (40 lines)
    │
    ▼
nlm CLI
    │
    ▼
NotebookLM API
    │
    ▼
185 curated sources
    │
    ▼
Answer + citations → User
```

NotebookLM handles the retrieval and grounding. The skill is just the thin layer that wires your agent's query to the notebook and surfaces the response.

---

## The core code

```python
import subprocess, sys, json

NOTEBOOK_ID = "your-notebook-id-here"

def query_notebook(question: str) -> dict:
    result = subprocess.run(
        ["nlm", "query", NOTEBOOK_ID, "--question", question, "--json"],
        capture_output=True, text=True, timeout=30
    )
    if result.returncode != 0:
        raise RuntimeError(f"nlm error: {result.stderr}")
    return json.loads(result.stdout)

def run(params: dict) -> str:
    question = params.get("question", "").strip()
    if not question:
        return "Provide a question."
    response = query_notebook(question)
    answer = response.get("answer", "No answer returned.")
    citations = response.get("citations", [])
    formatted = f"{answer}\n\n**Sources:**\n"
    formatted += "\n".join(f"- {c}" for c in citations) if citations else "- (no citations)"
    return formatted

if __name__ == "__main__":
    print(run({"question": " ".join(sys.argv[1:])}))
```

---

## The pattern — reuse for your own docs

This is a general pattern. Fork it for any documentation corpus.

1. Feed your docs into NotebookLM (PDFs, URLs, text files)
2. Get the notebook ID from the NotebookLM URL
3. Fork this skill, swap `NOTEBOOK_ID`
4. Your agents now have a knowledge backend with real citations

Works for: internal wikis, API docs, runbooks, research papers, product specs.

---

## Requirements

- Python 3.10+
- `nlm-cli` (`pip install nlm-cli`)
- OpenClaw 2.x **or** Claude Code (skill runs in both)
- A NotebookLM account with your notebook configured

---

## Published on ClawHub

[clawhub.ai/radelqui/openclaw-expert-brain](https://clawhub.ai/radelqui/openclaw-expert-brain)

---

## License

MIT — do whatever you want, attribution appreciated.

---

## Author

**Carlos De La Torre**
IA Orquestador — Arquitecto de Infraestructura e IA

- Email: carlos@huyghusrl.com
- Portfolio: [app.huyghusrl.com/ai-portfolio](https://app.huyghusrl.com/ai-portfolio)
- SYNAPSE Method — AI orchestration without the bloat
````

## File: SKILL.md
upstream: https://github.com/radelqui/openclaw-expert-brain/blob/HEAD/SKILL.md

Content is not inlined in the catalog. Read the upstream file: https://github.com/radelqui/openclaw-expert-brain/blob/HEAD/SKILL.md

## File: scripts
upstream: https://github.com/radelqui/openclaw-expert-brain/blob/HEAD/scripts

Content is not inlined in the catalog. Read the upstream file: https://github.com/radelqui/openclaw-expert-brain/blob/HEAD/scripts
