Agent Skillszzatpku/AgentFactory › local_search

local_search

GitHub

在本地知识库中搜索相关文档,返回包含相关性分数的截断文本片段。适用于信息检索场景,需配合open_page获取完整内容。

skills/tools/mask/local_search/SKILL.md zzatpku/AgentFactory

Trigger Scenarios

用户需要查询本地知识库中的文档信息 需要根据关键词检索相关文档片段

Install

npx skills add zzatpku/AgentFactory --skill local_search -g -y
More Options

Non-standard path

npx skills add https://github.com/zzatpku/AgentFactory/tree/master/skills/tools/mask/local_search -g -y

Use without installing

npx skills use zzatpku/AgentFactory@local_search

指定 Agent (Claude Code)

npx skills add zzatpku/AgentFactory --skill local_search -a claude-code -g -y

安装 repo 全部 skill

npx skills add zzatpku/AgentFactory --all -g -y

预览 repo 内 skill

npx skills add zzatpku/AgentFactory --list

SKILL.md

Frontmatter
{
    "name": "local_search",
    "description": "Search for relevant documents in the local knowledge base. Returns incomplete\/truncated text snippets with relevance scores. Use open_page to get full document content."
}

Search Tool

Search for documents matching a query in the local knowledge base.

Usage

from tools import local_search

results = local_search(query, topk=10)

Parameters

Parameter Type Default Description
query str required The search query string
topk int 10 Number of top results to return

Returns

{
    "results": [
        {
            "docid": "document_id_string",
            "url": "https://example.com/page",
            "text": "incomplete/truncated document snippet...",
            "score": 0.95
        },
        ...
    ],
    "took_ms": 12.5
}

Or on error:

{"error": "error message"}

Note: The text field returned by local_search contains incomplete/truncated content, NOT the full document. It may cut off at arbitrary points, causing you to miss critical information. Always use open_page to retrieve the full document content for any result that is relevant to your query.

Example

from tools import local_search

# local_search for information about a topic
results = local_search("capital of France", topk=3)

# Process results
for doc in results.get("results", []):
    print(f"DocID: {doc['docid']}")
    print(f"Score: {doc['score']}")
    print(f"Text: {doc['text'][:200]}...")
    print("---")

Tips

  • Use specific, descriptive queries for better results
  • Start with topk around 10 and adjust if needed
  • Check the score to gauge relevance
  • The text field from local_search is incomplete/truncated - it may cut off mid-sentence at arbitrary points
  • Always use open_page to get the full document content for any relevant result - do NOT rely solely on the truncated text from local_search
  • When using open_page, remember the text is in results[0]["text"], not at the top level

Version History

  • df92287 Current 2026-07-25 08:38

Same Skill Collection

skills/meta/create_subagent/SKILL.md
skills/meta/finish/SKILL.md
skills/meta/list_saved_subagents/SKILL.md
skills/meta/modify_subagent/SKILL.md
skills/meta/run_subagent/SKILL.md
skills/meta/view_subagent_code/SKILL.md
skills/tools/google_search/SKILL.md
skills/tools/jina_reader/SKILL.md
skills/tools/mask/open_page/SKILL.md
skills/tools/playwright/SKILL.md
skills/tools/shell_command/SKILL.md

Metadata

Files
0
Version
df92287
Hash
7d8df2bd
Indexed
2026-07-25 08:38

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 05:25
浙ICP备14020137号-1 $mapa de visitantes$