Senso Content Ingestion
Ingest documents and content into the user's Senso.ai knowledge base so it becomes searchable through Edith smart glasses.
When to use
Activate this skill when the user wants to add, upload, or ingest content into their knowledge base. Examples:
- - "Add this to my knowledge base..."
- "Ingest this document..."
- "Store this information..."
- "Remember this for later..." (when referring to document-scale content, not short notes)
- "Upload this to Senso..."
- "Index this content..."
Do NOT use this skill for simple note-taking or reminders. This is for ingesting substantial content that should be searchable later.
Setup
The user must have a Senso.ai API key configured. If not, 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 ingest content
Use the exec tool to call the Senso.ai content ingestion endpoint:
CODEBLOCK0
Ingesting from a file
If the user provides a file path, read it first and then send the content:
CODEBLOCK1
For large files, consider chunking the content into logical sections before ingesting.
Formatting responses for Edith voice output
Edith speaks responses through smart glasses speakers. Keep confirmations brief:
- 1. Confirm success simply. Say "Done, I've added that to your knowledge base" or "Got it, that's been indexed."
- Mention what was ingested. Say "I've added the return policy document to your knowledge base" so the user knows what happened.
- No technical details. Don't mention API responses, document IDs, chunk counts, or byte sizes.
- If it fails, be clear. Say what went wrong in plain language.
Example
User: "Hey Edith, add this meeting summary to my knowledge base: We decided to launch the new product line in Q3 and increase the marketing budget by 20 percent."
Good response: "Done, I've added your meeting summary to your knowledge base."
Bad response: "I have successfully ingested 1 document containing 147 characters into your Senso.ai knowledge base. The document ID is doc_abc123 and it was chunked into 1 segment."
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."
- Content too large: Split the content into smaller pieces and ingest each separately. Confirm with "I've added your document in multiple parts to your knowledge base."
- Network/timeout error: "I couldn't reach your knowledge base right now. Try again in a moment."
- Empty content: "There's no content to add. Tell me what you'd like to store in your knowledge base."
Senso 内容导入
将文档和内容导入用户的 Senso.ai 知识库,使其可通过 Edith 智能眼镜进行搜索。
使用场景
当用户想要添加、上传或导入内容到其知识库时,激活此技能。例如:
- - 把这个添加到我的知识库...
- 导入这份文档...
- 存储这些信息...
- 稍后记住这个...(指文档级别的内容,而非简短笔记)
- 把这个上传到 Senso...
- 索引这些内容...
请勿将此技能用于简单的记笔记或提醒事项。它仅用于导入日后需要可搜索的实质性内容。
设置
用户必须配置 Senso.ai API 密钥。如果没有,请告知他们:
- 1. 在 https://senso.ai 注册并创建一个项目
- 前往设置 > API 密钥,生成一个新密钥
- 告诉 OpenClaw:我的 Senso API 密钥是 sk-...,并将其存储以供将来使用
API 密钥应作为 SENSOAPIKEY 存储在 OpenClaw 的内存/配置中。
如何导入内容
使用 exec 工具调用 Senso.ai 内容导入接口:
bash
curl -s -X POST https://sdk.senso.ai/api/v1/content/raw \
-H Content-Type: application/json \
-H X-API-Key: ${SENSOAPIKEY} \
-d {content: <要导入的文本内容>, metadata: {title: <可选标题>, source: <可选来源>}}
从文件导入
如果用户提供文件路径,先读取文件再发送内容:
bash
curl -s -X POST https://sdk.senso.ai/api/v1/content/raw \
-H Content-Type: application/json \
-H X-API-Key: ${SENSOAPIKEY} \
-d @- <
{
content: <文件内容>,
metadata: {
title: <文件名>,
source: file
}
}
BODY
对于大文件,考虑在导入前将内容分块为逻辑段落。
为 Edith 语音输出格式化响应
Edith 通过智能眼镜扬声器播报响应。保持确认信息简洁:
- 1. 简单确认成功。 说已完成,我已将其添加到您的知识库或收到,已索引完成。
- 提及已导入的内容。 说我已将退货政策文档添加到您的知识库,让用户知道发生了什么。
- 不涉及技术细节。 不要提及 API 响应、文档 ID、分块数量或字节大小。
- 如果失败,要清晰说明。 用通俗语言说明问题所在。
示例
用户:嘿 Edith,把这个会议纪要添加到我的知识库:我们决定在第三季度推出新产品线,并将营销预算增加20%。
好的响应:已完成,我已将您的会议纪要添加到知识库。
不好的响应:我已成功将包含147个字符的1个文档导入您的 Senso.ai 知识库。文档 ID 为 doc_abc123,已分块为1个段落。
错误处理
- - 缺少 API 密钥:您尚未设置 Senso 知识库。您需要一个 Senso API 密钥。请访问 senso.ai 获取一个,然后告诉我密钥。
- 401 未授权:您的 Senso API 密钥似乎无效。请检查后重试。
- 内容过大:将内容拆分为更小的部分,分别导入。确认时回复我已将您的文档分多个部分添加到知识库。
- 网络/超时错误:我现在无法连接到您的知识库。请稍后再试。
- 内容为空:没有要添加的内容。请告诉我您想存储什么到知识库。