C

convex-agent

by @convexv
4.6(120)

This Skill adds an AI agent and RAG backend to a Convex app via @convex-dev/agent, covering agent definition with tools and instructions, durable threads, streamed messages, persisted history, and vector-search retrieval. Model calls default to the Convex AI Gateway, so credentials stay server-side and there is no LLM key to obtain, store, or rotate; keys needed for embeddings or gateway fallback live in Convex env. It suits teams that want in-app chat, document question answering, or tool-calling agents on durable, reactive storage.

convexai-agentragvector-searchbackendGitHub
Installation
npx skills add https://github.com/convex/agent-skills --skill convex-agent
compare_arrows

Before / After Comparison

1 组
Before

Developers pick an LLM SDK themselves, apply for and store provider keys, hand-roll thread and message tables, glue together streaming, and bolt on a separate vector search — days of wiring, with keys scattered around.

After

This Skill lays out install, agent definition, thread creation, streamed messages and vector retrieval in one path; provider credentials stay server-side, so a durable, reactive agent plus RAG backend runs within half a day.

SKILL.md

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.

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs34.9K
Rating4.6 / 5.0
Version
Updated2026年10月23日
Comparisons1

User Rating

4.6(120)
5
37%
4
43%
3
13%
2
5%
1
2%

Rate this Skill

0.0

Compatible Platforms

🤖claude-code

Timeline

Created2026年10月17日
Last Updated2026年10月23日
🎁 Agent Knowledge Cards
Survey