convex-agent
它能做什么
这个技能会为 Convex 应用添加 AI 智能体后端,保存对话记录,并搜索你的文档以获取答案。适合构建应用内 AI 助手的开发者。
适用场景
- ✓当你想为 Convex 应用添加 AI 聊天助手时。
- ✓当你需要助手能在持久的聊天线程中记住过去的消息时。
- ✓当你想让助手搜索你自己的文档来回答问题时。
技能链接
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-agent/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为我的 Convex 应用添加一个 AI 助手,让它根据我们的帮助文章回答问题。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能会安装智能体组件,用其工具和指令定义智能体,并把线程和消息保存在 Convex 中。对于文档搜索,它会把文档转换为嵌入(embedding)并存入向量索引。模型调用通过 Convex AI 网关进行,因此你通常不需要自己的模型密钥。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Add an AI agent / RAG backend
Install @convex-dev/agent for durable threads, message history, tool-calls, and vector search/RAG — the backend for an in-app AI agent. Call models through the Convex AI Gateway by default: Convex holds the provider credentials, so there is no LLM key to obtain, store, or rotate.
Workflow
- Install @convex-dev/agent + @convex-dev/ai-sdk-provider; add the agent component to convex.config.ts.
- Define the agent (tools, instructions) with
languageModel: convexGateway("provider/model")— no API key needed (needs convex 1.45+ on a Convex Cloud deployment, paid plan). - Create threads + stream messages; persist history in Convex.
- For RAG: embed docs into a vector index and retrieve in the tool. The gateway does not serve embeddings yet, so store the embedding provider's key via the
envmicro power. - Only if the gateway is unavailable (free plan, self-hosted, local backend): call the provider SDK with a key stored via the
envmicro power.
Rules
- Default to the Convex AI Gateway (
convexGatewayfrom @convex-dev/ai-sdk-provider) for model calls; fall back to a provider key in Convex env only where the gateway is unavailable (free plan, self-hosted, local backend). - Never expose a provider API key client-side; when one is needed (embeddings, gateway fallback), keep it in Convex env via the
envmicro power. - Run model calls in actions ('use node' if the SDK needs it).
- Persist threads/messages in Convex for durability + reactivity.
常见问题
我需要模型 API 密钥吗?
通常不需要。当 AI 网关可用时,Convex 会保管服务商的凭据。
文档搜索需要什么?
需要一个嵌入(embedding)服务商的密钥,保存在 Convex 环境设置中,因为网关目前还不提供嵌入服务。
什么情况下需要服务商密钥?
只有在网关不可用时才需要,例如免费套餐、自托管或本地后端。
详情
热度
- GitHub 星标
- 9.5k
- 排名
- #12233
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
axiom-alerting
9.5k帮你的智能体通过 Axiom API 创建和管理监控器与通知路由,并检查告警是否按预期运行。
axiom-sre
9.5k帮你的智能体逐步调查生产事故和缺陷,在得出结论之前,用 Axiom 日志验证每一个猜测。
building-dashboards
9.5k帮你的智能体从仪表盘必须支持的决策出发,设计配有合适图表、查询和筛选器的 Axiom 仪表盘。
controlling-costs
9.5k帮你的智能体在 Axiom 中找出未被使用的数据,并构建用于追踪和削减日志成本的仪表盘与监控器。