convex-agents

Builds stateful AI agents on Convex with threads, tools, streaming, and RAG.

1|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/kausthubh-coder/kriyan-web --skill convex-agents-kausthubh-coder
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-agents
Source: https://github.com/kausthubh-coder/kriyan-web/tree/main/.cursor/skills/convex-agents
Command: npx skills add https://github.com/kausthubh-coder/kriyan-web --skill convex-agents-kausthubh-coder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @convex-dev/agent, ai, openai.

What problem does it solve? Building AI agents that remember conversations, call tools, and stream responses requires stitching together state management, vector search, and real-time delivery. This Skill provides working patterns for implementing persistent, tool-using agents on the Convex backend platform. ## Core Features & Use Cases - Thread Management: Create, list, and query persistent conversation threads that survive restarts using the @convex-dev/agent component. - Tool Integration: Define Convex functions as agent tools (knowledge search, task creation, external API calls) with typed parameters. - Streaming & RAG: Stream tokens to clients in real time and perform vector search over embedded documents for retrieval-augmented generation. - Workflow Orchestration: Coordinate multi-step agent workflows such as research pipelines with status tracking. - Use Case: You are building a chat assistant in a Next.js app backed by Convex. Use this Skill to set up the agent component, persist threads, attach tools, and stream responses to a React chat interface. ## Quick Start Set up a Convex agent with thread management, tool calling, and streaming chat responses in my project.

Frequently Asked Questions about convex-agents

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an AI agent with Convex?▼

Install @convex-dev/agent, create an Agent instance with chat and embedding models, then use agent.createThread and agent.chat inside Convex mutations and actions. Threads persist conversation history automatically in Convex storage.

How do I add tools to a Convex agent?▼

Define tools with the tool() helper from @convex-dev/agent, specifying a name, description, typed parameters, and a handler that runs Convex queries or mutations. Pass the tools array to agent.chat so the model can invoke them.

Does the Convex Agent component support streaming responses?▼

Yes, agent.chat accepts a stream option with an onToken callback. Each token can be written to the client via a mutation, giving real-time streaming updates through Convex's reactive queries.

How do I implement RAG with Convex agents?▼

Generate embeddings with agent.embed when inserting documents, store them in a table with a vectorIndex, then call agent.search with a query and table name. Results include relevance scores for retrieval-augmented prompts.

Why do agent conversations disappear after refresh?▼

Conversations vanish when messages are kept only in client state instead of Convex. Persist threads and messages with agent.createThread and agent.getMessages so history survives restarts and page reloads.