SuperAPI AI Directory

lx-search

General & other

View repository

Updated 10-16 08:39

About this skill

Search and Personnel Lookup

Prerequisites: Requires lx CLI to be configured and logged in.

⚡ When to use this skill?

Enter scenarios:

  • User says "search XX"/"is there any document about XX"/"find XX"
  • User says "look up colleague XX"/"who is XX"
  • User says "search the knowledge base"

Prohibited in this skill:

  • Do not edit directly after searching: after search returns entry_id , if editing is needed → immediately switch to the lx-entry or lx-block skill
  • Do not create pages in this skill: user says "create a page" → immediately switch to the lx-entry skill

Search is not the endpoint:

  • Search is only a locating tool; after finding entry_id , you must continue into the corresponding skill to perform subsequent operations

⚡ How to choose a command? (Decision tree)

识别场景 →
├── 知道精确关键词? → lx search kb-search
├── 模糊描述 / 自然语言提问? → lx search kb-embedding-search
├── 查找同事信息? → lx contact search-staff
└── 确认当前登录身份? → lx contact whoami

⚠️ High-risk operations and default preferred paths

Keyword vs semantic search:

  • User provides explicit keywords (such as product name, document title) → use lx search kb-search
  • User describes vague intent (such as "how to apply for resources") → use lx search kb-embedding-search

Default preferred paths:

  1. Exact keywords → kb-search
  2. Vague intent → kb-embedding-search
  3. Limit search scope → first get space_id, then pass to the search command

Follow-up handling of search results:

  • After search returns entry_id , if content is needed, call lx entry describe-ai-parse-content --entry-id <ID>

Available tools

Command Description Reference
lx search kb-search Keyword exact search kb-search.md
lx search kb-embedding-search Semantic vector search kb-search.md
lx contact search-staff Enterprise personnel lookup kb-search.md
lx contact whoami Get current user identity No parameters

🎯 Execution rules

  1. Keyword vs semantic search: when the user provides explicit keywords (such as product name, document title), use lx search kb-search; when the user describes vague intent (such as "how to apply for resources"), use lx search kb-embedding-search。
  2. Limit search scope: if the user specifies a knowledge base, first use lx space list-recently-spaces or lx space describe-space to get space_id, then pass to the search command's --space-id。
  3. Search titles only: when the user says "the title is...", use lx search kb-search --keyword "..." --title-only。
  4. Follow-up handling of search results: after search returns entry_id , if content is needed, call lx entry describe-ai-parse-content --entry-id <ID>。
  5. Personnel search limitation:lx contact search-staff depends on the enterprise directory visibility settings; when the API errors, tell the user it may be a permission restriction.
  6. Pagination: by default only the first page is returned. Only pass --page-token for pagination when the user explicitly requests "more results".

Typical combined workflows

Search in a specified knowledge base

# 获取最近知识库列表,确认 space_id
lx space list-recently-spaces

# 在指定知识库中搜索
lx search kb-search --keyword "API 设计" --space-id sp_xxx

Semantic search + get document content

# 语义搜索,获取匹配的 entry_id
lx search kb-embedding-search --keyword "如何配置数据库连接池"

# 获取文档 AI 可解析内容
lx entry describe-ai-parse-content --entry-id entry_xxx

Find a colleague's documents

# 查找人员信息
lx contact search-staff --staff-id "张三" --fuzzy-search

# 按创建人搜索文档
lx search kb-search --keyword "张三" --type kb_doc