Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计异常

localbrain-collect本地脑收集

Agent Skill

localbrain-collect 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

192

周安装

8

GitHub Stars

57

下载量

64
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:localbrain-collect(本地脑收集)
来源仓库:https://github.com/agent-creativity/agentic-local-brain
仓库路径:skills/localbrain-collect
安装命令:
npx skills add https://github.com/agent-creativity/agentic-local-brain --skill localbrain-collect
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/agent-creativity/agentic-local-brain --skill localbrain-collect

简介

localbrain-collect 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于需要根据关键词或任务场景从本地资源中获取信息的场景。
  • 通过安装命令添加到宿主环境后,可结合原始 README 核验具体用法。
  • 安装前需确认权限范围、维护状态,避免触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Knowledge Collect (LocalBrain) v0.6.1

Overview

This skill enables AI agents to collect, save, and archive knowledge from various sources into a local knowledge base. It supports automatic extraction of tags and summaries using a 3-tier fallback system, making knowledge management effortless.

Supported Sources:

  • Files (PDF, Markdown, text)
  • Webpages
  • Academic papers (arXiv or URLs)
  • Emails (.eml or.mbox)
  • Bookmarks
  • Quick notes

Key Features:

  • Automatic tag extraction and summarization
  • Duplicate detection and skip-existing support
  • Web interface for browsing collected knowledge
  • Statistics dashboard

Prerequisites

  1. Check if localbrain is installed First, try to find localbrain in PATH: # macOS/Linux which localbrain # Windows (PowerShell) Get-Command localbrain -ErrorAction SilentlyContinue

- If found: localbrain is available. Skip to step 3. - If not found in PATH: Check the default installation location: # macOS/Linux test -x "$HOME/.localbrain/bin/localbrain" && echo "found" || echo "not found" # Windows (PowerShell) Test-Path "$env:USERPROFILE\.localbrain\bin\localbrain.exe" - If found: Add it to PATH for the current session and verify: # macOS/Linux export PATH="$HOME/.localbrain/bin:$PATH" localbrain --version # Windows (PowerShell) $env:PATH = "$env:USERPROFILE\.localbrain\bin;$env:PATH" localbrain --version Note: This is a common issue with desktop AI agents (OpenClaw, Cursor, etc.) whose subprocess doesn't inherit shell profile PATH settings (~/.zshrc on macOS/Linux, User PATH on Windows). The installation exists, but PATH needs to be set manually for this session. - If not found: Proceed to step 2 to install.

  1. Install localbrain (if not installed) Recommended: Python one-liner installer (requires Python 3.8+): # macOS/Linux curl -fsSL http://localbrain.oss-cn-shanghai.aliyuncs.com/python_installer/install.sh | sh # Windows (PowerShell) irm http://localbrain.oss-cn-shanghai.aliyuncs.com/python_installer/install.ps1 | iex This creates a virtual environment at ~/.localbrain/venv and installs localbrain there. Alternative: Binary installer (macOS/Linux only, for systems without Python): curl -fsSL http://localbrain.oss-cn-shanghai.aliyuncs.com/binary_installer/install.sh | sh After installation, add to PATH and verify: # macOS/Linux export PATH="$HOME/.localbrain/bin:$PATH" localbrain --version # Windows (PowerShell) $env:PATH = "$env:USERPROFILE\.localbrain\bin;$env:PATH" localbrain --version
  2. First-time setup (run once): localbrain init setup Options:

- --no-sample - Skip sample data creation

Trigger Conditions

Activate this skill when users express intent to:

  • Save/collect/archive a file, webpage, article, paper, email, or note
  • Save bookmarks to their knowledge base
  • Check knowledge base statistics or status
  • Start/stop the knowledge base web interface
  • Initialize the knowledge base for first-time use
  • Save/collect content to their knowledge base (知识库)

Trigger Keywords/Phrases:

  • "save to knowledge base"
  • "collect this"
  • "add to local brain"
  • "archive this"
  • "save bookmark"
  • "knowledge base stats"
  • "start knowledge base"
  • "localbrain"
  • "store this for later"
  • "保存到知识库" (save to knowledge base)
  • "收藏到知识库" (collect to knowledge base)
  • "存到知识库"
  • "加入知识库"
  • "knowledge base"
  • "save to kb"

Intent Recognition (CRITICAL)

When a user's request is ambiguous, use the following decision rules to choose the correct collection type. The order of evaluation matters — check from top to bottom and use the FIRST match.

Decision Flow

User Input → Is it a local file path?
               ├─ YES → FILE collection
               └─ NO → Is it a URL/link?
                          ├─ NO → Is it short text (note/thought/idea)?
                          │         ├─ YES → NOTE collection
                          │         └─ NO → Ask user to clarify
                          └─ YES → Is the URL an academic paper?
                                     (arXiv, scholar, .edu papers, etc.)
                                     ├─ YES → PAPER collection
                                     └─ NO → Does user explicitly say "bookmark"?
                                                ├─ YES → BOOKMARK collection
                                                └─ NO → WEBPAGE collection (default for URLs)

Detailed Rules

1. FILE — Local filesystem paths

  • Trigger: Any local filesystem path (absolute or relative), including files generated by the agent during the conversation
  • Examples: /Users/me/doc.pdf, ./output.md, ~/Downloads/report.txt, agent-generated files like /tmp/analysis.md
  • Key signal: The source is a path on disk, NOT a URL

2. WEBPAGE — Default for URLs (extract & save content)

  • Trigger: Any URL/link where the user wants to save/collect/archive the content
  • This is the DEFAULT for all URLs unless a more specific type applies
  • Behavior: Fetches the page, extracts content, saves as markdown file
  • Examples:

- "save this article" + URL → WEBPAGE - "collect this" + URL → WEBPAGE - "archive this page" + URL → WEBPAGE - "extract content from this link" → WEBPAGE - Any URL without further qualification → WEBPAGE

Restricted URL Fallback Strategy

Some URLs (e.g., WeChat/微信公众号 articles, Twitter/X posts, pages behind authentication or anti-scraping walls) may fail when localbrain collect webpage add tries to fetch them directly. When this happens, the agent SHOULD attempt alternative methods to obtain the page content before giving up:

  1. Use the agent's own browser/fetch capabilities first: If the agent has access to a browser tool or fetch tool (e.g., mcp_fetch_fetch, agent-browser, or similar), use it to retrieve the page content directly.
  2. Save the fetched content as a local file, then collect as FILE:

- Fetch/render the page content using the agent's tools - Save the content to a temporary markdown file (e.g., /tmp/webpage_title.md) - Use localbrain collect file add /tmp/webpage_title.md --title "Original Page Title" to collect it

  1. Ask the user to provide the content: If all automated methods fail, ask the user to paste the article text, then save it as a note or file.

Example workflow for a restricted WeChat article:

# Step 1: Agent tries localbrain directly (may fail)
localbrain collect webpage add https://mp.weixin.qq.com/s/xxxxx

# Step 2: If failed, agent uses its own fetch tool to get content
# (agent fetches content via mcp_fetch_fetch or browser tool)

# Step 3: Agent saves fetched content to a temp file
# (agent writes content to /tmp/wechat_article.md)

# Step 4: Collect the local file instead
localbrain collect file add /tmp/wechat_article.md --title "WeChat Article Title"

Key principle: The goal is to get the content into the knowledge base. If the primary webpage add command fails due to access restrictions, fall back to fetching content through the agent's own capabilities and collecting it as a file.

3. PAPER — Academic papers only

  • Trigger: URL is clearly an academic paper source
  • Key signals: arXiv URLs (arxiv.org), arXiv IDs (arxiv:2301.12345), Google Scholar links, .edu paper pages, user says "paper" or "论文"
  • Examples:

- https://arxiv.org/abs/2301.12345 → PAPER - https://arxiv.org/pdf/1706.03762 → PAPER - "save this paper" + academic URL → PAPER - "收藏这篇论文" → PAPER

  • Note: If unsure whether a URL is a paper, default to WEBPAGE

4. NOTE — Short text, explicit intent only

  • Trigger: User explicitly says they want to save a "note", "thought" (想法), "idea" (点子), or "memo"
  • Content: Must be plain text, relatively short (similar to a tweet/weibo post — a few sentences, not a full article)
  • NOT a note if: Content is long (multiple paragraphs), contains a URL to collect, or is a file path
  • Examples:

- "记一个想法:Python的列表推导式比for循环快" → NOTE - "save this note: always use type hints in Python" → NOTE - "I had an idea: we should refactor the auth module" → NOTE

  • Counter-examples (NOT notes):

- "save this" + URL → WEBPAGE (not a note) - "remember this article" + URL → WEBPAGE (not a note) - Long multi-paragraph text without "note/thought/idea" keyword → Ask user or default to FILE

5. BOOKMARK — Explicit request only, saves link not content

  • Trigger: User EXPLICITLY says "bookmark" (书签/收藏夹) and wants to save just the link reference, NOT extract page content
  • This is a rare case — most URL saves should use WEBPAGE
  • Key difference: Bookmark saves the URL as a reference; Webpage extracts and saves the full page content
  • Examples:

- "bookmark this link" → BOOKMARK - "add to my bookmarks" → BOOKMARK - "加个书签" → BOOKMARK

  • Counter-examples (use WEBPAGE instead):

- "save this page" + URL → WEBPAGE - "collect this article" + URL → WEBPAGE - "archive this" + URL → WEBPAGE

Ambiguity Resolution

User saysCorrect typeReasoning
"save this" + URLWEBPAGEDefault for URLs is content extraction
"collect this" + URLWEBPAGEDefault for URLs
"save this" + file pathFILELocal path = file
"save this paper" + arXiv URLPAPERAcademic paper signal
"save this" + arXiv URL (no "paper" keyword)PAPERarXiv domain is strong paper signal
"remember this: short text"NOTEShort text + "remember"
"save a note: short text"NOTEExplicit "note" keyword
"save this article" + URLWEBPAGE"article" = web content
"bookmark this" + URLBOOKMARKExplicit "bookmark"
"save this link" + URLWEBPAGE"save link" ≠ "bookmark", extract content
"add to bookmarks" + URLBOOKMARKExplicit "bookmarks"
Agent generated /tmp/report.mdFILELocal file path
"保存到知识库" + URLWEBPAGE"知识库" triggers skill, URL defaults to webpage
"收藏这个到知识库" + file pathFILE"知识库" triggers skill, local path = file
"把这篇文章存到知识库" + URLWEBPAGEArticle + URL = webpage content extraction

Tags and Summary Strategy (CRITICAL)

This skill uses a hybrid 3-tier approach for tags and summaries. Understanding this is essential for correct usage.

Default Behavior: Let Auto-Extraction Handle It

DO NOT pass --tags or --summary flags by default. The system has built-in smart extraction:

  1. Tier 1: If user explicitly provided tags/summary → use them
  2. Tier 2: If LLM service (DashScope) is configured → use LLM extraction
  3. Tier 3: If LLM unavailable → use built-in TF-IDF keyword extraction and extractive summarization

When to Pass Tags/Summary

Only pass these flags when the user explicitly provides specific tags or a summary:

User RequestAction
"save this with tags AI, research"Pass --tags AI --tags research
"add this article, tag it as python tutorial"Pass --tags python --tags tutorial
"save this with summary: A guide to async Python"Pass --summary "A guide to async Python"
"save this webpage" (no tags mentioned)DO NOT pass --tags, let auto-extract handle it
"archive this paper"DO NOT pass --tags or --summary

Disabling Auto-Extraction

Use --no-auto-extract only when the user explicitly wants NO tags/summary:

localbrain collect file add document.pdf --no-auto-extract

Command Reference

Initialization

# First-time setup
localbrain init setup

# Setup without sample data
localbrain init setup --no-sample

File Collection

Add local files (PDF, Markdown, text, code files).

# Basic usage - let auto-extraction handle tags/summary
localbrain collect file add /path/to/document.pdf

# With explicit tags (only when user provides them)
localbrain collect file add /path/to/document.pdf --tags AI --tags research

# With explicit title and summary
localbrain collect file add /path/to/document.pdf --title "My Document" --summary "A summary"

# Skip if already exists
localbrain collect file add /path/to/document.pdf --skip-existing

# Disable auto-extraction
localbrain collect file add /path/to/document.pdf --no-auto-extract

Options:

  • --tags/-t (multiple) - Explicit tags (only if user provides)
  • --title - Custom title
  • --summary/-s - Explicit summary (only if user provides)
  • --auto-extract/--no-auto-extract - Enable/disable auto-extraction (default: enabled)
  • --skip-existing - Skip if item already exists

Webpage Collection

Add webpages by URL.

# Basic usage
localbrain collect webpage add https://example.com/article

# With explicit tags
localbrain collect webpage add https://example.com/article --tags tutorial --tags python

# With custom title
localbrain collect webpage add https://example.com/article --title "Python Tutorial"

Options: Same as file collection

Paper Collection

Add academic papers from arXiv or direct URLs.

# From arXiv ID
localbrain collect paper add arxiv:2401.12345

# From arXiv URL
localbrain collect paper add https://arxiv.org/abs/2401.12345

# From PDF URL
localbrain collect paper add https://example.com/paper.pdf

# With tags
localbrain collect paper add arxiv:2401.12345 --tags deep-learning --tags nlp

Options: Same as file collection

Email Collection

Add emails from.eml or.mbox files.

# Single .eml file
localbrain collect email add /path/to/email.eml

# Mbox file (multiple emails)
localbrain collect email add /path/to/mailbox.mbox

# With tags
localbrain collect email add /path/to/email.eml --tags work --tags important

Options: Same as file collection

Bookmark Collection

Add single bookmarks by URL.

# Basic usage
localbrain collect bookmark add https://example.com

# With title and tags
localbrain collect bookmark add https://example.com --title "Example Site" --tags reference

Options: Same as file collection

Note Collection

Add quick text notes.

# Basic note
localbrain collect note add "This is a quick note"

# With title
localbrain collect note add "Meeting notes from today" --title "Meeting Notes"

# With tags (note: uppercase -T for tags in note command)
localbrain collect note add "Python tips" --title "Python Tips" --tags python --tags tips

# With summary
localbrain collect note add "Important concept" --summary "Key concept to remember"

Options:

  • --title/-t - Note title
  • --tags/-T (multiple) - Tags (note: uppercase T)
  • --summary/-s - Summary
  • --auto-extract/--no-auto-extract - Enable/disable auto-extraction
  • --skip-existing - Skip if note already exists

Stats and Web Interface

View Statistics

# Show knowledge base statistics
localbrain stats

Displays:

  • Total items in knowledge base
  • Items by type (file, webpage, paper, email, bookmark, note)
  • Top tags
  • Collection timeline

Web Interface

# Start web UI (foreground)
localbrain web

# Start on custom port
localbrain web --port 11201

# Start on custom host
localbrain web --host 0.0.0.0

# Start in background (daemon mode)
localbrain web --background
# or
localbrain web -b

# Check web server status
localbrain web --status

# Stop background server
localbrain web --stop

# Enable auto-reload (development)
localbrain web --reload

Access the web UI at http://127.0.0.1:11201 (or your configured port).

Web API Reference

When the web server is running, the following REST API endpoints are available:

Dashboard

MethodEndpointDescription
GET/api/statsGet knowledge base statistics
GET/api/recentGet recent items

Items

MethodEndpointDescription
GET/api/itemsList all items (supports pagination)
GET/api/items/{id}Get item by ID
PUT/api/items/{id}Update item
DELETE/api/items/{id}Delete item

Tags

MethodEndpointDescription
GET/api/tagsList all tags
GET/api/tags/{name}/itemsGet items by tag
POST/api/tags/mergeMerge tags
DELETE/api/tags/{name}Delete tag

Search

MethodEndpointDescription
GET/api/search?q=...Quick search
POST/api/search/semanticSemantic search
POST/api/ragRAG-based Q&A

Example

# Get statistics
curl http://127.0.0.1:11201/api/stats

# Search for items
curl "http://127.0.0.1:11201/api/search?q=python"

# Semantic search
curl -X POST http://127.0.0.1:11201/api/search/semantic \
  -H "Content-Type: application/json" \
  -d '{"query": "machine learning", "limit": 10}'

Error Handling

Common Errors and Solutions

ErrorCauseSolution
Command not found: localbrainlocalbrain not installed or not in PATHCheck ~/.localbrain/bin/ (macOS/Linux) or %USERPROFILE%\.localbrain\bin\ (Windows). If found, add to PATH: export PATH="$HOME/.localbrain/bin:$PATH" (macOS/Linux) or $env:PATH = "$env:USERPROFILE\.localbrain\bin;$env:PATH" (Windows). If not found, install via Prerequisites step 2.
Knowledge base not initializedFirst-time use without initRun localbrain init setup
File not foundIncorrect file pathVerify the file path is correct and accessible
Invalid URLMalformed URLCheck the URL format (must include http:// or https://)
Embedding service errorLLM/embedding service not configuredSet DASHSCOPE_API_KEY environment variable
Item already existsDuplicate contentUse --skip-existing to skip duplicates

Environment Variables

VariableDescription
DASHSCOPE_API_KEYAPI key for embeddings and LLM (required for Tier 2 extraction)
KB_CONFIG_PATHCustom config file path (optional, defaults to ~/.localbrain/config.yaml)

Troubleshooting and Maintenance

System Diagnostics

# Run system diagnostics
localbrain doctor

Checks:

  • Configuration file status
  • Service connectivity (embedding/LLM)
  • Installation integrity
  • Knowledge base health

Version Management

# Update to latest version
localbrain self-update

# Check for updates without installing
localbrain self-update --check

# Rollback to previous version
localbrain self-update --rollback

Common Workflows

Workflow 1: Save a Web Article

# User: "Save this article about Python async"
localbrain collect webpage add https://example.com/python-async

# System auto-extracts tags like: python, async, programming

Workflow 2: Archive a PDF with Custom Tags

# User: "Save this research paper with tags AI and ML"
localbrain collect file add ~/Downloads/research-paper.pdf --tags AI --tags ML

Workflow 3: Quick Note Taking

# User: "Remember this: Python list comprehensions are faster than for loops"
localbrain collect note add "Python list comprehensions are faster than for loops" --title "Python Performance Tip"

Workflow 4: Start Web Interface

# User: "Start the knowledge base web interface"
localbrain web --background

# Check it's running
localbrain web --status

Workflow 5: Collection Pipeline

# User: "Archive these resources: a PDF, a webpage, and a bookmark"

# Step 1: Initialize if needed
localbrain init setup

# Step 2: Collect file
localbrain collect file add ~/docs/important.pdf

# Step 3: Collect webpage
localbrain collect webpage add https://example.com/article

# Step 4: Add bookmark
localbrain collect bookmark add https://example.com/resource --title "Useful Resource"

# Step 5: Check stats
localbrain stats

# Step 6: Start web UI to browse
localbrain web

Related Commands

The following commands are available in localbrain but are managed by other workflows:

Search Commands

# Semantic search (requires embedding API)
localbrain search semantic "query" --limit 10

# Keyword search (always available)
localbrain search keyword "term" --limit 10

# RAG-based Q&A (requires embedding AND LLM APIs)
localbrain search rag "question"

# Tag search (always available)
localbrain search tags "python" --limit 20
localbrain search tags "python" "ai" --limit 20  # Multiple tags

Tag Management

localbrain tag list
localbrain tag merge <source> <target>
localbrain tag delete <tag>

Export

localbrain export --format json --output items.json

Service Tests

localbrain test embedding
localbrain test llm

Service Dependencies

FeatureEmbedding APILLM API
Keyword searchNot requiredNot required
Tag searchNot requiredNot required
Semantic searchRequiredNot required
RAGRequiredRequired
Auto-tag extraction (Tier 2)Not requiredRequired

Best Practices

  1. Let auto-extraction work: Don't pass --tags or --summary unless the user explicitly provides them
  2. Use --skip-existing for batch operations: Prevents duplicates when re-running imports
  3. Initialize once: Run localbrain init setup only for first-time setup
  4. Check stats periodically: Use localbrain stats to monitor knowledge base growth
  5. Use background mode for web: localbrain web -b keeps the server running without blocking the terminal

Quick Reference Card

INIT:
  localbrain init setup [--no-sample]

COLLECT:
  localbrain collect file add <path> [options]
  localbrain collect webpage add <url> [options]
  localbrain collect paper add <source> [options]
  localbrain collect email add <path> [options]
  localbrain collect bookmark add <url> [options]
  localbrain collect note add "<text>" [options]

OPTIONS (for collect commands):
  --tags/-t <tag>       # Only if user provides tags
  --title <title>       # Custom title
  --summary/-s <text>   # Only if user provides summary
  --skip-existing       # Skip duplicates
  --no-auto-extract     # Disable auto-extraction

STATS & WEB:
  localbrain stats
  localbrain web [-b/--background] [--port N] [--host X]
  localbrain web --status
  localbrain web --stop

MAINTENANCE:
  localbrain doctor                        # System diagnostics
  localbrain self-update [--check|--rollback]  # Version management

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.47%
按下载量换算22

Claude

28.7%
按下载量换算18

Cursor

20.12%
按下载量换算13

Gemini CLI

9.59%
按下载量换算6

安全审计

Gen Agent Trust Hub

未通过

Socket

可疑

Snyk

未通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills