zotero-mcp-code

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Zotero MCP Code Execution Skill

Zotero MCP 代码执行技能

Search your Zotero library using code execution for safe, efficient, comprehensive searches.
通过代码执行安全、高效、全面地搜索你的Zotero库。

🎯 Core Concept

🎯 核心理念

Instead of calling MCP tools directly (which loads all results into context and risks crashes), write Python code that:
  1. Fetches large datasets (50-100+ items per strategy)
  2. Filters and ranks in code execution environment
  3. Returns only top N results to context
Benefits:
  • ✅ No crash risk (large data stays in code)
  • ✅ Automatic multi-strategy search
  • ✅ Automatic deduplication
  • ✅ Automatic ranking
  • ✅ One function call instead of 5-10
不同于直接调用MCP工具(会将所有结果加载到上下文环境中,存在崩溃风险),编写Python代码来完成以下操作:
  1. 获取大型数据集(每种策略获取50-100+条条目)
  2. 在代码执行环境中进行过滤和排序
  3. 仅将排名前N的结果返回至上下文环境
优势:
  • ✅ 无崩溃风险(大型数据仅在代码中处理)
  • ✅ 自动执行多策略搜索
  • ✅ 自动去重
  • ✅ 自动排序
  • ✅ 一次函数调用替代5-10次调用

🚀 Basic Usage

🚀 基本用法

For 90% of Zotero searches, use this simple pattern:
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths

from zotero_lib import SearchOrchestrator, format_results
对于90%的Zotero搜索场景,可使用以下简单模式:
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths

from zotero_lib import SearchOrchestrator, format_results

Single comprehensive search

单次全面搜索

orchestrator = SearchOrchestrator() results = orchestrator.comprehensive_search( "user's query here", max_results=20 # Return top 20 most relevant )
orchestrator = SearchOrchestrator() results = orchestrator.comprehensive_search( "用户查询内容", max_results=20 # 返回相关性最高的20条结果 )

Format and display

格式化并展示结果

print(format_results(results, include_abstracts=True))

**This automatically:**
- Performs semantic search (multiple variations)
- Performs keyword search (multiple variations)
- Performs tag-based search
- Fetches 100+ items total
- Deduplicates results
- Ranks by relevance
- Returns only top 20 to context
print(format_results(results, include_abstracts=True))

**该代码会自动完成:**
- 执行语义搜索(包含多种变体)
- 执行关键词搜索(包含多种变体)
- 执行基于标签的搜索
- 总共获取100+条条目
- 对结果去重
- 按相关性排序
- 仅将前20条结果返回至上下文环境

📋 Common Patterns

📋 常见使用模式

Pattern 1: Simple Search (Most Common)

模式1:简单搜索(最常用)

User asks: "Find papers about embodied cognition"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import SearchOrchestrator, format_results

orchestrator = SearchOrchestrator()
results = orchestrator.comprehensive_search("embodied cognition", max_results=20)
print(format_results(results))
用户需求: "查找关于具身认知的论文"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import SearchOrchestrator, format_results

orchestrator = SearchOrchestrator()
results = orchestrator.comprehensive_search("embodied cognition", max_results=20)
print(format_results(results))

Pattern 2: Filtered Search

模式2:过滤搜索

User asks: "Find recent journal articles about machine learning"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, SearchOrchestrator, format_results

library = ZoteroLibrary()
orchestrator = SearchOrchestrator(library)
用户需求: "查找近年关于机器学习的期刊文章"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, SearchOrchestrator, format_results

library = ZoteroLibrary()
orchestrator = SearchOrchestrator(library)

Fetch broadly (safe - filtering happens in code)

广泛获取条目(安全操作 - 过滤在代码中完成)

items = library.search_items("machine learning", limit=100)
items = library.search_items("machine learning", limit=100)

Filter in code

在代码中过滤

filtered = orchestrator.filter_by_criteria( items, item_types=["journalArticle"], date_range=(2020, 2025) )
print(format_results(filtered[:15]))
undefined
filtered = orchestrator.filter_by_criteria( items, item_types=["journalArticle"], date_range=(2020, 2025) )
print(format_results(filtered[:15]))
undefined

Pattern 3: Author Search

模式3:作者搜索

User asks: "What papers do I have by Kahneman?"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, format_results

library = ZoteroLibrary()
results = library.search_items(
    "Kahneman",
    qmode="titleCreatorYear",
    limit=50
)
用户需求: "我库中有哪些Kahneman的论文?"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, format_results

library = ZoteroLibrary()
results = library.search_items(
    "Kahneman",
    qmode="titleCreatorYear",
    limit=50
)

Sort by date

按日期排序

sorted_results = sorted(results, key=lambda x: x.date, reverse=True) print(format_results(sorted_results))
undefined
sorted_results = sorted(results, key=lambda x: x.date, reverse=True) print(format_results(sorted_results))
undefined

Pattern 4: Tag-Based Search

模式4:基于标签的搜索

User asks: "Show me papers tagged with 'learning' and 'cognition'"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, format_results

library = ZoteroLibrary()
results = library.search_by_tag(["learning", "cognition"], limit=50)
print(format_results(results[:20]))
用户需求: "展示标记为'learning'和'cognition'的论文"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, format_results

library = ZoteroLibrary()
results = library.search_by_tag(["learning", "cognition"], limit=50)
print(format_results(results[:20]))

Pattern 5: Recent Papers

模式5:最近添加的论文

User asks: "What did I recently add?"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, format_results

library = ZoteroLibrary()
results = library.get_recent(limit=20)
print(format_results(results))
用户需求: "我最近添加了哪些内容?"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, format_results

library = ZoteroLibrary()
results = library.get_recent(limit=20)
print(format_results(results))

Pattern 6: Multi-Topic Search

模式6:多主题搜索

User asks: "Find papers about both cognition and learning"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import SearchOrchestrator, format_results

orchestrator = SearchOrchestrator()
用户需求: "查找同时关于认知和学习的论文"
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import SearchOrchestrator, format_results

orchestrator = SearchOrchestrator()

Search both topics

搜索两个主题

results1 = orchestrator.comprehensive_search("cognition", max_results=30) results2 = orchestrator.comprehensive_search("learning", max_results=30)
results1 = orchestrator.comprehensive_search("cognition", max_results=30) results2 = orchestrator.comprehensive_search("learning", max_results=30)

Find intersection

查找交集

keys1 = {item.key for item in results1} keys2 = {item.key for item in results2} common_keys = keys1 & keys2
if common_keys: common_items = [item for item in results1 if item.key in common_keys] print("Papers about both topics:") print(format_results(common_items)) else: print("No papers found on both topics.") print("\nCognition results:") print(format_results(results1[:10])) print("\nLearning results:") print(format_results(results2[:10]))
undefined
keys1 = {item.key for item in results1} keys2 = {item.key for item in results2} common_keys = keys1 & keys2
if common_keys: common_items = [item for item in results1 if item.key in common_keys] print("同时涉及两个主题的论文:") print(format_results(common_items)) else: print("未找到同时涉及两个主题的论文。") print("\n认知主题结果:") print(format_results(results1[:10])) print("\n学习主题结果:") print(format_results(results2[:10]))
undefined

🔧 Advanced Usage

🔧 高级用法

Custom Filtering Logic

自定义过滤逻辑

python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, SearchOrchestrator, format_results

library = ZoteroLibrary()
orchestrator = SearchOrchestrator(library)
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, SearchOrchestrator, format_results

library = ZoteroLibrary()
orchestrator = SearchOrchestrator(library)

Fetch large dataset

获取大型数据集

items = library.search_items("neural networks", limit=100)
items = library.search_items("neural networks", limit=100)

Custom filtering

自定义过滤

recent_with_doi = [ item for item in items if item.doi and item.date and int(item.date[:4]) >= 2020 ]
print(format_results(recent_with_doi[:15]))
undefined
recent_with_doi = [ item for item in items if item.doi and item.date and int(item.date[:4]) >= 2020 ]
print(format_results(recent_with_doi[:15]))
undefined

Multi-Angle Custom Search

多角度自定义搜索

python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, SearchOrchestrator, format_results

library = ZoteroLibrary()
orchestrator = SearchOrchestrator(library)

all_results = set()
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, SearchOrchestrator, format_results

library = ZoteroLibrary()
orchestrator = SearchOrchestrator(library)

all_results = set()

Multiple search angles

多个搜索角度

queries = [ "skill transfer", "transfer of learning", "generalization of skills" ]
for query in queries: results = library.search_items(query, limit=30) all_results.update(results)
queries = [ "skill transfer", "transfer of learning", "generalization of skills" ]
for query in queries: results = library.search_items(query, limit=30) all_results.update(results)

Rank combined results

对合并结果排序

ranked = orchestrator._rank_items(list(all_results), "skill transfer") print(format_results(ranked[:20]))
undefined
ranked = orchestrator._rank_items(list(all_results), "skill transfer") print(format_results(ranked[:20]))
undefined

Iterative Refinement

迭代优化

python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, SearchOrchestrator, format_results

library = ZoteroLibrary()
orchestrator = SearchOrchestrator(library)
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import ZoteroLibrary, SearchOrchestrator, format_results

library = ZoteroLibrary()
orchestrator = SearchOrchestrator(library)

Initial search

初始搜索

initial = library.search_items("memory", limit=50)
initial = library.search_items("memory", limit=50)

Analyze tags

分析标签

tag_freq = {} for item in initial: for tag in item.tags: tag_freq[tag] = tag_freq.get(tag, 0) + 1
tag_freq = {} for item in initial: for tag in item.tags: tag_freq[tag] = tag_freq.get(tag, 0) + 1

Find most common tag

找到最常见的标签

if tag_freq: most_common_tag = max(tag_freq, key=tag_freq.get)
# Refine search
refined = orchestrator.filter_by_criteria(
    initial,
    required_tags=[most_common_tag]
)

print(f"Papers with most common tag '{most_common_tag}':")
print(format_results(refined))
undefined
if tag_freq: most_common_tag = max(tag_freq, key=tag_freq.get)
# 优化搜索
refined = orchestrator.filter_by_criteria(
    initial,
    required_tags=[most_common_tag]
)

print(f"带有最常见标签 '{most_common_tag}' 的论文:")
print(format_results(refined))
undefined

📚 API Reference

📚 API 参考

SearchOrchestrator

SearchOrchestrator

Main class for automated searching.
用于自动化搜索的主类。

comprehensive_search(query, max_results=20, use_semantic=True, use_keyword=True, use_tags=True, search_limit_per_strategy=50)

comprehensive_search(query, max_results=20, use_semantic=True, use_keyword=True, use_tags=True, search_limit_per_strategy=50)

Performs multi-strategy search with automatic deduplication and ranking.
Parameters:
  • query
    (str): Search query
  • max_results
    (int): Maximum results to return (default: 20)
  • use_semantic
    (bool): Use semantic search (default: True)
  • use_keyword
    (bool): Use keyword search (default: True)
  • use_tags
    (bool): Use tag search (default: True)
  • search_limit_per_strategy
    (int): Items to fetch per strategy (default: 50)
Returns: List of ZoteroItem objects
执行多策略搜索,自动完成去重和排序。
参数:
  • query
    (字符串):搜索查询词
  • max_results
    (整数):返回的最大结果数(默认值:20)
  • use_semantic
    (布尔值):是否使用语义搜索(默认值:True)
  • use_keyword
    (布尔值):是否使用关键词搜索(默认值:True)
  • use_tags
    (布尔值):是否使用标签搜索(默认值:True)
  • search_limit_per_strategy
    (整数):每种策略获取的条目数(默认值:50)
返回值: ZoteroItem 对象列表

filter_by_criteria(items, item_types=None, date_range=None, required_tags=None, excluded_tags=None)

filter_by_criteria(items, item_types=None, date_range=None, required_tags=None, excluded_tags=None)

Filter items by various criteria.
Parameters:
  • items
    (list): Items to filter
  • item_types
    (list): Allowed item types (e.g., ["journalArticle"])
  • date_range
    (tuple): (min_year, max_year)
  • required_tags
    (list): Tags that must be present
  • excluded_tags
    (list): Tags that must not be present
Returns: Filtered list of ZoteroItem objects
根据多种条件过滤条目。
参数:
  • items
    (列表):待过滤的条目
  • item_types
    (列表):允许的条目类型(例如:["journalArticle"])
  • date_range
    (元组):(起始年份, 结束年份)
  • required_tags
    (列表):必须包含的标签
  • excluded_tags
    (列表):必须排除的标签
返回值: 过滤后的ZoteroItem对象列表

ZoteroLibrary

ZoteroLibrary

Low-level interface to Zotero.
与Zotero交互的底层接口。

search_items(query, qmode="titleCreatorYear", item_type="-attachment", limit=100, tag=None)

search_items(query, qmode="titleCreatorYear", item_type="-attachment", limit=100, tag=None)

Basic keyword search.
基础关键词搜索。

semantic_search(query, limit=100, search_type="hybrid")

semantic_search(query, limit=100, search_type="hybrid")

Semantic/vector search.
语义/向量搜索。

search_by_tag(tags, item_type="-attachment", limit=100)

search_by_tag(tags, item_type="-attachment", limit=100)

Search by tags.
基于标签的搜索。

get_recent(limit=50)

get_recent(limit=50)

Get recently added items.
获取最近添加的条目。

get_tags()

get_tags()

Get all tags in library.
获取库中的所有标签。

format_results(items, include_abstracts=True, max_abstract_length=300)

format_results(items, include_abstracts=True, max_abstract_length=300)

Format items as markdown.
将条目格式化为Markdown格式。

⚙️ Configuration

⚙️ 配置

Default Parameters

默认参数

Good defaults for most searches:
python
orchestrator.comprehensive_search(
    query,
    max_results=20,              # Top 20 results
    search_limit_per_strategy=50 # Fetch 50 per strategy
)
适用于大多数搜索场景的默认配置:
python
orchestrator.comprehensive_search(
    query,
    max_results=20,              # 前20条结果
    search_limit_per_strategy=50 # 每种策略获取50条
)

Adjusting Search Depth

调整搜索深度

For quick searches (fewer results, faster):
python
results = orchestrator.comprehensive_search(
    query,
    max_results=10,
    search_limit_per_strategy=20
)
For thorough searches (more comprehensive):
python
results = orchestrator.comprehensive_search(
    query,
    max_results=30,
    search_limit_per_strategy=100
)
快速搜索(结果更少,速度更快):
python
results = orchestrator.comprehensive_search(
    query,
    max_results=10,
    search_limit_per_strategy=20
)
深度搜索(结果更全面):
python
results = orchestrator.comprehensive_search(
    query,
    max_results=30,
    search_limit_per_strategy=100
)

🔍 How It Works

🔍 工作原理

Behind the Scenes

幕后流程

When you call
comprehensive_search("embodied cognition", max_results=20)
:
  1. Semantic Search (if enabled):
    • Searches "embodied cognition" (hybrid mode) → 50 items
    • Searches "embodied cognition" (vector mode) → 50 items
  2. Keyword Search (if enabled):
    • Searches with qmode="everything" → 50 items
    • Searches with qmode="titleCreatorYear" → 50 items
  3. Tag Search (if enabled):
    • Extracts words from query
    • Finds matching tags in library
    • Searches by matching tags → 50 items
  4. Processing:
    • Combines all results (~250 items)
    • Deduplicates using item keys (~120 unique)
    • Ranks by relevance score
    • Returns top 20
  5. Context:
    • Only the final 20 items go to LLM context
    • All processing happens in code execution environment
当你调用
comprehensive_search("embodied cognition", max_results=20)
时:
  1. 语义搜索(若启用):
    • 搜索“embodied cognition”(混合模式)→ 50条条目
    • 搜索“embodied cognition”(向量模式)→ 50条条目
  2. 关键词搜索(若启用):
    • 使用qmode="everything"搜索 → 50条条目
    • 使用qmode="titleCreatorYear"搜索 → 50条条目
  3. 标签搜索(若启用):
    • 从查询词中提取关键词
    • 在库中查找匹配的标签
    • 按匹配标签搜索 → 50条条目
  4. 处理过程
    • 合并所有结果(约250条)
    • 通过条目键去重(约120条唯一结果)
    • 按相关性得分排序
    • 返回前20条结果
  5. 上下文处理
    • 仅最终的20条结果进入LLM上下文
    • 所有处理操作在代码执行环境中完成

Why This Is Better

优势对比

Old Approach (Direct MCP):
python
undefined
旧方法(直接调用MCP):
python
undefined

5+ function calls, all results to context

5次以上函数调用,所有结果进入上下文

results1 = zotero_semantic_search("query", limit=10) # Crash risk if > 15 results2 = zotero_search_items("query", limit=10)
results1 = zotero_semantic_search("query", limit=10) # 结果超过15条时有崩溃风险 results2 = zotero_search_items("query", limit=10)

... manual deduplication, no ranking

...手动去重,无排序

All items (50+) load into context

所有条目(50+条)加载到上下文


**New Approach (Code Execution):**
```python

**新方法(代码执行):**
```python

1 function call, only top results to context

一次函数调用,仅前N条结果进入上下文

results = orchestrator.comprehensive_search("query", max_results=20)
results = orchestrator.comprehensive_search("query", max_results=20)

Fetches 250+ items, processes in code, returns top 20

获取250+条条目,在代码中处理,返回前20条

undefined
undefined

🛠️ Error Handling

🛠️ 错误处理

Always handle potential errors:
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import SearchOrchestrator, format_results

orchestrator = SearchOrchestrator()

try:
    results = orchestrator.comprehensive_search("query", max_results=20)

    if results:
        print(format_results(results))
    else:
        print("No results found. Try a broader search term.")

except Exception as e:
    print(f"Search failed: {e}")
    print("Please check your Zotero MCP configuration.")
始终处理潜在错误:
python
import sys
sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution')
import setup_paths
from zotero_lib import SearchOrchestrator, format_results

orchestrator = SearchOrchestrator()

try:
    results = orchestrator.comprehensive_search("query", max_results=20)

    if results:
        print(format_results(results))
    else:
        print("未找到结果。请尝试更宽泛的搜索词。")

except Exception as e:
    print(f"搜索失败:{e}")
    print("请检查你的Zotero MCP配置。")

📖 Examples

📖 示例

See
/Users/niyaro/Documents/Code/zotero-code-execution/examples.py
for 8 complete working examples.
查看
/Users/niyaro/Documents/Code/zotero-code-execution/examples.py
获取8个完整的可用示例。

🎓 Quick Reference

🎓 速查参考

TaskCode
Basic search
orchestrator.comprehensive_search(query, max_results=20)
Filter by type
orchestrator.filter_by_criteria(items, item_types=["journalArticle"])
Filter by date
orchestrator.filter_by_criteria(items, date_range=(2020, 2025))
Search author
library.search_items(author, qmode="titleCreatorYear", limit=50)
Search by tag
library.search_by_tag([tags], limit=50)
Recent items
library.get_recent(limit=20)
Format output
format_results(items, include_abstracts=True)
任务代码
基础搜索
orchestrator.comprehensive_search(query, max_results=20)
按类型过滤
orchestrator.filter_by_criteria(items, item_types=["journalArticle"])
按日期过滤
orchestrator.filter_by_criteria(items, date_range=(2020, 2025))
作者搜索
library.search_items(author, qmode="titleCreatorYear", limit=50)
标签搜索
library.search_by_tag([tags], limit=50)
最近条目
library.get_recent(limit=20)
格式化输出
format_results(items, include_abstracts=True)

💡 Tips

💡 提示

  1. Start simple: Use
    comprehensive_search()
    for most queries
  2. Adjust depth: Use
    search_limit_per_strategy
    to control thoroughness
  3. Filter after: Fetch broadly, filter in code
  4. Custom logic: Use Python for complex filtering
  5. Check errors: Always wrap in try/except
  1. 从简单开始:大多数查询使用
    comprehensive_search()
    即可
  2. 调整深度:使用
    search_limit_per_strategy
    控制搜索全面性
  3. 先获取后过滤:先广泛获取条目,再在代码中过滤
  4. 自定义逻辑:使用Python实现复杂过滤
  5. 错误检查:始终将代码包裹在try/except块中

📁 Documentation

📁 文档

  • Quick Start:
    /Users/niyaro/Documents/Code/zotero-code-execution/QUICK_START.md
  • Full Docs:
    /Users/niyaro/Documents/Code/zotero-code-execution/README.md
  • Examples:
    /Users/niyaro/Documents/Code/zotero-code-execution/examples.py
  • Status:
    /Users/niyaro/Documents/Code/zotero-code-execution/HONEST_STATUS.md
  • 快速入门
    /Users/niyaro/Documents/Code/zotero-code-execution/QUICK_START.md
  • 完整文档
    /Users/niyaro/Documents/Code/zotero-code-execution/README.md
  • 示例
    /Users/niyaro/Documents/Code/zotero-code-execution/examples.py
  • 状态说明
    /Users/niyaro/Documents/Code/zotero-code-execution/HONEST_STATUS.md

⚠️ Important Notes

⚠️ 重要说明

  • This uses code execution, not direct MCP calls
  • Large datasets are processed in code, keeping context small
  • Semantic search may not be available (falls back to keyword)
  • Results are automatically deduplicated and ranked
  • Safe to use large limits (100+) because filtering happens in code
  • 本技能使用代码执行来安全处理大型搜索
  • 大型数据集在代码中处理,保持上下文数据量较小
  • 语义搜索可能不可用(会自动回退到关键词搜索)
  • 结果会自动去重和排序
  • 可安全使用较大的获取上限(100+),因为过滤在代码中完成

🔄 Migration from zotero-mcp

🔄 从zotero-mcp迁移

Old pattern:
python
undefined
旧模式:
python
undefined

Multiple manual MCP calls

多次手动调用MCP

results1 = zotero_semantic_search("query", limit=10) results2 = zotero_search_items("query", limit=10)
results1 = zotero_semantic_search("query", limit=10) results2 = zotero_search_items("query", limit=10)

Manual deduplication...

手动去重...


**New pattern:**
```python

**新模式:**
```python

One function call with code execution

一次代码执行函数调用

import sys sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution') import setup_paths from zotero_lib import SearchOrchestrator, format_results
orchestrator = SearchOrchestrator() results = orchestrator.comprehensive_search("query", max_results=20) print(format_results(results))

---

**Remember:** This skill uses code execution to safely handle large searches. The implementation is in `/Users/niyaro/Documents/Code/zotero-code-execution/`.
import sys sys.path.append('/Users/niyaro/Documents/Code/zotero-code-execution') import setup_paths from zotero_lib import SearchOrchestrator, format_results
orchestrator = SearchOrchestrator() results = orchestrator.comprehensive_search("query", max_results=20) print(format_results(results))

---

**注意:** 本技能通过代码执行来安全处理大型搜索,实现代码位于 `/Users/niyaro/Documents/Code/zotero-code-execution/`。