بنقرة واحدة
kb-research
Agentic research loop that deeply investigates a topic via web search and saves findings as atomic notes
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Agentic research loop that deeply investigates a topic via web search and saves findings as atomic notes
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Find near-duplicate notes and merge them safely. Use when the user asks to "dedupe the KB", "find duplicate notes", "merge these notes", or after large research sessions that may have re-covered existing ground.
Re-verify time-sensitive claims in KB notes against live sources and apply visible corrections. Use when the user asks to "refresh the KB", "re-verify notes", "check what's gone stale", or on a schedule. Distinct from /kb-review (structural quality) — this checks whether the facts are still true.
Synthesize a coherent narrative explanation of a topic from multiple KB notes. Use when the user asks to "explain X from the KB", wants a structured overview/briefing woven from existing notes, or asks "what's the full picture on X".
Answer a single question and save the answer as an atomic note in the knowledge base. Use when the user poses a discrete factual/conceptual question they want captured for later, says "look this up and save it", "add this to the KB", or "note down the answer to X".
Audit the knowledge base for quality issues (orphans, broken links, missing citations, stale notes, tag drift) and suggest improvements. Use when the user asks to "review the KB", "check note quality", "find orphans/broken links/duplicates", or "what needs cleanup".
Search the knowledge base and synthesize a grounded answer from matching notes. Use when the user asks a question the KB likely covers, says "what do we know about X", "search the KB", "search my notes", or "answer from the KB".
| name | kb-research |
| description | Agentic research loop that deeply investigates a topic via web search and saves findings as atomic notes |
| user_invocable | true |
| arguments | Topic to research. Flags: --depth shallow/medium/deep, --checkpoint plan/each/end, --kb name |
Agentic research loop. Given a topic, plan a research agenda, iteratively search the web, follow leads, fill gaps, and produce comprehensive atomic notes.
Extract from $ARGUMENTS:
shallow | medium | deep. When not given, use research_depth_default from .kb/config.yaml (default: deep).kbs.yaml. Save notes to kbs/<kb_name>/.plan+end)
plan — pause after planning, then run autonomously until synthesiseach — pause after each sub-question to show findings and ask to continue/redirectend — no pauses, full autonomy, show everything at the end+: plan+end (default), plan+each, etc.| Depth | Follow-up rounds per question | Behavior |
|---|---|---|
shallow | 1 | One round of search per question, follow up on gaps once |
medium | 2 | Follow up on gaps twice per question |
deep | Until diminishing returns, max 10 | Keep researching until new searches add little value, hard cap at 10 rounds total across all questions |
If --kb was not specified, infer the target KB before planning:
kbs.yaml to get all non-private KBs with their descriptions.python3 .kb/kb-index.py search "TOPIC" --kb <name> for each non-private KB to see which has the most relevant existing notes.<kb-name> (strongest match: N related notes). Change? (or specify a different KB)"general.This inference happens once before Phase 1 and is confirmed by the user during the plan checkpoint.
Check existing KB — Search all KBs (kbs/*/) for what the KB already knows about this topic. Read any relevant notes.
Break topic into research questions — Decompose the topic into 3-7 specific, answerable sub-questions. Consider:
Present research plan to the user (if plan checkpoint is active):
## Research Plan: [Topic]
Already in KB:
- [[existing-note-1]] — covers X
- [[existing-note-2]] — covers Y
Research questions:
1. [question 1] — why this matters
2. [question 2] — why this matters
...
Depth: <resolved depth> (e.g. deep — research until diminishing returns, max 10 rounds)
Checkpoints: after plan + at end
Proceed? (yes / adjust questions / change depth)
Wait for user approval if checkpoint is active. User can adjust questions, depth, or add/remove topics.
For each research question, run the research loop:
Search — Use WebSearch to find relevant sources for the question.
Read & evaluate — Use WebFetch to read promising results. Assess:
Save useful sources — Write fetched content to references/ as markdown files with slugified names. Format:
# Title
Source: https://original-url
Fetched: YYYY-MM-DD
Source-Type: primary | secondary | opinion | unverified
## Key Content
(structured summary of findings)
Classify each source:
Only save sources that are substantive and worth citing. These files become the citation targets for notes.
Extract findings — Note key facts, claims, frameworks, and insights. Track which source each finding comes from.
Identify gaps — What's still unclear? What follow-up questions emerged?
Follow up — If depth budget allows, search for gap-filling information. Decrement the follow-up counter.
Checkpoint — If each checkpoint is active, pause after each question:
## Question 1: [question]
Findings so far:
- [key finding 1] (source: ...)
- [key finding 2] (source: ...)
Gaps remaining:
- [gap 1]
Continue to question 2? (yes / redirect / add question / stop here)
Claude decides whether to research sub-questions concurrently or sequentially:
State the choice and reasoning in the plan.
After all questions are researched:
Compile findings — Organize all findings across all questions. Identify:
Present proposed notes — Show the user a numbered list of proposed notes:
## Research Complete: [Topic]
Sources saved to references/:
- references/source-1.md
- references/source-2.md
Proposed notes:
0. [reference] Research Hub: [Topic] — hub linking all notes from this research
1. [concept] [Title] — [one-line summary]
2. [concept] [Title] — [one-line summary]
3. [insight] [Title] — [one-line summary]
...
Gaps not fully resolved:
- [gap] — couldn't find definitive answer
Save all by default — Read save_all_by_default from .kb/config.yaml (default true). When true, proceed to create all proposed notes without waiting for a selection — the list above is shown for transparency, not as a gate. The user may still prune by replying (e.g. "skip 3" / "only 1,2") before or as creation proceeds. When false, instead append "Which notes to save? (all / 1,3,5 / none)" and wait for the user's selection.
Create notes — For each selected note:
a. Contradiction check: Run python3 .kb/kb-index.py search "NOTE_TITLE" --kb <kb_name> to find similar existing notes. If the score is at or above similarity.contradiction_overlap in .kb/config.yaml, read those notes and check for conflicting claims. If contradictions found, ask user: reconcile, update existing, or create separate with link?
b. Dedup check: If the similar-note score is at or above similarity.dedup_threshold in .kb/config.yaml, it likely covers the same concept — suggest updating the existing note instead of creating a duplicate.
c. Create/update following CLAUDE.md format. Assign epistemic_status based on source quality:
verified if backed by primary sources (original data, official post-mortems, academic papers)likely if backed by credible secondary sourcesspeculative if based on inference or extrapolationdisputed if conflicting claims existopinion if the note contains the author's judgment
d. Cite all sources inline via local reference files — every claim must trace back to [display text](../../references/filename.md) (two levels up from kbs/<kb_name>/). The reference file contains the external URL. Never cite external URLs directly in notes if a reference file exists for that source.
e. Add [[wikilinks]] to the research hub and related notes, in both directions
f. Define terms inline — on first use of a technical term not commonly known, add a brief parenthetical definition. Link to a concept note via wikilink only if one exists.
g. Rebuild index: After creating all notes, run python3 .kb/kb-index.py build --incremental --kb <kb_name> to update the search index (only re-indexes changed notes).Create research hub note — A reference-type note that:
sources frontmatter[[wikilinks]]gaps: list to the YAML frontmatter with each unresolved gap as a string. This makes gaps machine-readable and queryable via python3 .kb/kb-index.py gaps research. Example:
gaps:
- "Topic X: specific unanswered question"
- "Topic Y: needs deeper investigation"
## Research Gaps section for human readabilityUpdate taxonomy — Add new tags to .kb/taxonomy.yaml.
Final summary:
references/ — only write new files$ARGUMENTS