Skip to content
Skillpedia
Agents9.5k · #12233

convex-agent

What it does

This skill adds an AI agent backend to a Convex app, storing conversation history and searching your documents for answers. It is for developers building an in-app AI assistant.

When to use it

  • ✓When you want to add an AI chat assistant to a Convex app.
  • ✓When you need the assistant to remember past messages in durable chat threads.
  • ✓When you want the assistant to search your own documents to answer questions.

Skill link

https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-agent/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-agent/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Add an AI assistant to my Convex app that answers questions from our help articles.”

5 new skills a week. 1 minute to read.

How it works

The skill installs the agent component, defines the agent with its tools and instructions, and stores threads and messages in Convex. For document search, it embeds the documents into a vector index. Model calls go through the Convex AI gateway, so you usually do not need your own model key.

Technical content (original SKILL.md)

Original text by the author, straight from 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.
FAQ

Do I need a model API key?

Usually not. Convex holds the provider credentials when the AI gateway is available.

What is needed for document search?

An embedding provider key, stored in Convex environment settings, since the gateway does not serve embeddings yet.

When is a provider key needed instead?

Only where the gateway is unavailable, such as a free plan, a self-hosted setup or a local backend.

Details

Original description by the author

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

repo: openclaw/clawhub

Popularity

GitHub stars
9.5k
Ranking position
#12233
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills