AI Chatbot & Agents
The AI-powered chatbot with streaming responses, tool use, and conversation history.
VibeFast ships with an AI assistant that streams replies, invokes tools, and stores conversation history for both mobile and web. The CLI command installs every piece at once:
vf add chatbotRAG (Knowledge Retrieval) is available only with the Convex backend via
@convex-dev/agent and ragKnowledge.ts. The Supabase chatbot includes all
other AI features: streaming, tool use, history, and attachments.
Frontend
The feature is identical for both backends. The Expo route lives at apps/native/src/app/(root)/(protected)/chatbot/index.tsx and delegates to apps/native/src/features/chatbot/app.
The feature folder contains:
- Hooks (
use-chat-handlers,use-conversation,use-chat-config) that bridge UI to your backend - UI components (input bar, message list, status chips) using the shared VibeFast design system
- API client that abstracts backend differences
Backend
Convex Implementation
packages/backend/convex/chatbotAgent.ts— orchestrates@convex-dev/agentsessions with streaming responsespackages/backend/convex/chatbotHistory.ts— stores conversations and attachmentspackages/backend/convex/agents.ts— prompt instructions, tone, and model configspackages/backend/convex/tools/— Tavily web search, user profile lookups, knowledge base routingpackages/backend/convex/ragKnowledge.ts— RAG document management
Environment Variables
CONVEX_DEPLOYMENT=xxx
CONVEX_URL=https://xxx.convex.cloud
OPENAI_API_KEY=sk-xxx
TAVILY_API_KEY=xxx # for web searchRun pnpm native:setup:convex after editing.
Supabase Implementation
packages/backend/supabase/functions/chat-stream/— Edge Function for streaming AI responses (SSE)packages/backend/src/services/conversations.ts— conversation managementpackages/backend/src/services/messages.ts— message storage and retrieval
Environment Variables
SUPABASE_URL=https://xxx.supabase.co
SUPABASE_PUBLISHABLE_KEY=xxx
OPENAI_API_KEY=sk-xxx
TAVILY_API_KEY=xxx # for web searchPush secrets with pnpm secrets:push.
Customization
- Change personality: Edit the prompt instructions in your backend's agent configuration
- Add knowledge files (Convex only): Use
ragKnowledge.tshelpers (addKnowledgeFile,askKnowledge) - Modify UI: Edit components in
apps/native/src/features/chatbot/components - Remove feature: Use
vf remove chatbotto drop it cleanly
Found an issue or bug in the docs?
Help me improve! If you spot any errors, typos, or have suggestions, please let me know.
Reach out on X/Twitter @zafarbuildzz