convex-agent
この Skill は @convex-dev/agent を使って Convex アプリに AI エージェントと RAG バックエンドを追加します。ツールと指示を持つエージェント定義、永続スレッド、メッセージのストリーミング、履歴の保存、ベクトル検索による取得を一通り扱います。モデル呼び出しは既定で Convex AI Gateway 経由のため、LLM の API キーを取得・保管・ローテーションする必要がありません。アプリ内チャットや文書検索、ツール呼び出し型エージェントを堅牢に実装したいチームに適しています。
npx skills add https://github.com/convex/agent-skills --skill convex-agentBefore / After 効果比較
1 组開発者はモデル SDK の選定、API キーの取得と保管、スレッドとメッセージの保存、ストリーミングの実装、さらに別途ベクトル検索の構築まで自力で行い、接続だけで数日かかっていました。
この Skill はインストール、エージェント定義、スレッド作成、ストリーミング、ベクトル検索までの手順を示し、認証情報はサーバー側で管理されるため、半日で堅牢なエージェント兼 RAG 基盤が動きます。
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.
ユーザーレビュー (0)
レビューを書く
レビューなし
統計データ
ユーザー評価
この Skill を評価