Senso Knowledge Search
Search your knowledge base through Senso.ai when users ask document or knowledge questions via Edith smart glasses.
When to use
Activate this skill when the user asks questions that imply searching documents, policies, knowledge bases, or stored information. Examples:
- - "What does the policy say about..."
- "Search my docs for..."
- "Find information about..."
- "What's in my knowledge base about..."
- "Look up..." (when referring to documents, not web search)
- "What did that document say about..."
- "Summarize the section on..."
Do NOT use this skill for general knowledge questions, web searches, weather, math, or anything that doesn't involve the user's own ingested documents.
Setup
The user must have a Senso.ai API key. If they haven't configured one yet, tell them:
- 1. Sign up at https://senso.ai and create a project
- Go to Settings > API Keys and generate a new key
- Tell OpenClaw: "My Senso API key is sk-..." and store it for future use
The API key should be stored in OpenClaw's memory/config as SENSO_API_KEY.
How to search
Use the exec tool to call the Senso.ai search endpoint:
CODEBLOCK0
The response is JSON with an array of results, each containing relevant text passages and metadata.
Formatting results for Edith voice output
Edith speaks responses through smart glasses speakers. Follow these rules strictly:
- 1. Be concise. Glasses users cannot read long text. Summarize the top 1-2 results into 1-3 short sentences.
- Lead with the answer. Start with the most relevant finding, not "I found 5 results..."
- No markdown, no bullet points, no URLs. The response is spoken aloud.
- Use natural speech patterns. Say "According to your documents..." or "Your policy states that..." rather than listing metadata.
- If no results match, say "I didn't find anything about that in your documents." Don't speculate or hallucinate content.
- If the API call fails, say "I couldn't reach your knowledge base right now. Please check your Senso API key."
Example
User: "Hey Edith, what does the return policy say about electronics?"
Good response: "Your return policy says electronics can be returned within 30 days with the original receipt. After 30 days, only store credit is offered."
Bad response: "I found 3 results in your knowledge base. Result 1: Section 4.2 of return-policy.pdf states that electronic items purchased from authorized retailers may be returned within a period of thirty calendar days from the date of purchase, provided that..."
Generating answers from search results
If the search results contain relevant passages but need synthesis, you can optionally use the generate endpoint to produce a grounded answer:
CODEBLOCK1
Only use this when search results need summarization across multiple passages. For simple lookups where a single passage answers the question, just summarize the passage directly.
Error handling
- - Missing API key: "You haven't set up your Senso knowledge base yet. You'll need a Senso API key. Visit senso.ai to get one, then tell me the key."
- 401 Unauthorized: "Your Senso API key seems invalid. Please check it and try again."
- Empty results: "I didn't find anything about that in your documents."
- Network/timeout error: "I couldn't reach your knowledge base right now. Try again in a moment."
Senso 知识搜索
当用户通过 Edith 智能眼镜询问文档或知识相关问题时,通过 Senso.ai 搜索您的知识库。
使用时机
当用户提出的问题暗示需要搜索文档、政策、知识库或存储信息时,激活此技能。例如:
- - 政策中关于……是怎么说的
- 在我的文档中搜索……
- 查找关于……的信息
- 我的知识库里关于……有什么内容
- 查一下……(指文档,而非网络搜索)
- 那份文档关于……是怎么说的
- 总结一下关于……的部分
请勿将此技能用于一般知识问题、网络搜索、天气、数学或任何不涉及用户自身已导入文档的内容。
设置
用户必须拥有 Senso.ai API 密钥。如果尚未配置,请告知用户:
- 1. 在 https://senso.ai 注册并创建一个项目
- 前往设置 > API 密钥,生成一个新密钥
- 告诉 OpenClaw:我的 Senso API 密钥是 sk-……,并保存以备将来使用
API 密钥应存储在 OpenClaw 的内存/配置中,作为 SENSOAPIKEY。
如何搜索
使用 exec 工具调用 Senso.ai 搜索端点:
bash
curl -s -X POST https://sdk.senso.ai/api/v1/search \
-H Content-Type: application/json \
-H X-API-Key: ${SENSOAPIKEY} \
-d {query: <用户的问题>, top_k: 5}
响应为 JSON 格式,包含一个结果数组,每个结果包含相关文本段落和元数据。
为 Edith 语音输出格式化结果
Edith 通过智能眼镜扬声器朗读回复。请严格遵守以下规则:
- 1. 简洁明了。 眼镜用户无法阅读长文本。将前 1-2 个结果总结为 1-3 个短句。
- 以答案开头。 从最相关的发现开始,而不是我找到了 5 个结果……
- 不使用 Markdown、项目符号或 URL。 回复是朗读出来的。
- 使用自然的语言表达。 说根据您的文档……或您的政策规定……,而不是列出元数据。
- 如果没有匹配结果,请说我在您的文档中没有找到相关内容。不要推测或虚构内容。
- 如果 API 调用失败,请说我现在无法访问您的知识库。请检查您的 Senso API 密钥。
示例
用户:嘿 Edith,退货政策关于电子产品是怎么说的?
好的回复:您的退货政策规定电子产品可以在 30 天内凭原始收据退货。超过 30 天,仅提供商店信用额度。
不好的回复:我在您的知识库中找到了 3 个结果。结果 1:退货政策.pdf 的第 4.2 节规定,从授权零售商处购买的电子产品可在购买之日起三十个日历日内退货,前提是……
从搜索结果生成答案
如果搜索结果包含相关段落但需要综合整理,您可以选择使用生成端点来生成有依据的答案:
bash
curl -s -X POST https://sdk.senso.ai/api/v1/generate \
-H Content-Type: application/json \
-H X-API-Key: ${SENSOAPIKEY} \
-d {query: <用户问题>, context: <拼接的搜索结果段落>}
仅在搜索结果需要在多个段落间进行总结时使用。对于单个段落即可回答问题的简单查询,直接总结该段落即可。
错误处理
- - 缺少 API 密钥:您还没有设置 Senso 知识库。您需要一个 Senso API 密钥。请访问 senso.ai 获取一个,然后告诉我密钥。
- 401 未授权:您的 Senso API 密钥似乎无效。请检查后重试。
- 结果为空:我在您的文档中没有找到相关内容。
- 网络/超时错误:我现在无法访问您的知识库。请稍后再试。