跳到正文
Skillpedia
智能体9.5k · #12233

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-agent/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请为我的 Convex 应用添加一个 AI 助手,让它根据我们的帮助文章回答问题。”

每周 5 个新技能,1 分钟读完。

工作原理

这个技能会安装智能体组件,用其工具和指令定义智能体,并把线程和消息保存在 Convex 中。对于文档搜索,它会把文档转换为嵌入(embedding)并存入向量索引。模型调用通过 Convex AI 网关进行,因此你通常不需要自己的模型密钥。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

<!-- GENERATED from convex-agents content/capabilities/agent.json — do not edit by hand. -->

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

  1. Install @convex-dev/agent + @convex-dev/ai-sdk-provider; add the agent component to convex.config.ts.
  2. 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).
  3. Create threads + stream messages; persist history in Convex.
  4. 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 env micro power.
  5. Only if the gateway is unavailable (free plan, self-hosted, local backend): call the provider SDK with a key stored via the env micro power.

Rules

  • Default to the Convex AI Gateway (convexGateway from @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 env micro 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 环境设置中,因为网关目前还不提供嵌入服务。

什么情况下需要服务商密钥?

只有在网关不可用时才需要,例如免费套餐、自托管或本地后端。

详情

作者的原始描述

Add an AI agent / RAG backend (@convex-dev/agent) to the Convex app.

repo: openclaw/clawhub

热度

GitHub 星标
9.5k
排名
#12233
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能