AI Lead Chatbot

    by Zeeonix Digital

    1

    Convert site visitors into qualified leads with an embeddable AI chatbot, Prisma integration, and security guardrails.

    $9.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    AI Lead Chatbot

    Example session with this skill installed

    Implement a lead qualification chatbot for a web development agency. We use Prisma and want to store leads with a source tag. Use OpenAI as the provider.

    • Read your context and instructions
    • Compiled the ai lead chatbot

    I have implemented the AI sales chatbot system, including the provider-agnostic adapter, the streaming API route with Zod validation, and the Prisma-backed lead extraction logic.

    Implementation Details

    Provider Adapter

    // src/lib/ai/provider.ts
    import { OpenAI } from 'openai';
    
    const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
    
    export async function generateChatReply(messages: any[], systemPrompt: string) {
      const response = await openai.chat.completions.create({
        model: 'gpt-4-turbo-preview',
        stream: true,
        messages: [{ role: 'system', content: systemPrompt }, ...messages],
        max_tokens: 500,
      });
      return response;
    }
    

    Lead Capture API

    // src/app/api/chat/route.ts
    import { db } from '@/lib/db';
    import { z } from 'zod';
    
    const ChatSchema = z.object({
      visitorId: z.string(),
      messages: z.array(z.object({
        role: z.enum(['user', 'assistant']),
        content: z.string().max(1000)
      })).max(15)
    });
    
    export async function POST(req: Request) {
      const body = await req.json();
      const { visitorId, messages } = ChatSchema.parse(body);
      
      // Logic to extract LeadPayload and upsert to Prisma
      const lead = await db.lead.upsert({
        where: { email: extractedEmail },
        update: { lastInteraction: new Date() },
        create: {
          email: extractedEmail,
          source: 'AI_CHATBOT',
          score: calculateScore(extractedData)
        }
      });
    
      return new Response(stream);
    }
    

    Next steps

    1. Add LLM_PROVIDER="openai" and OPENAI_API_KEY to your .env file.
    2. Run npx prisma generate to ensure the Lead and ChatSession models are synced.
    3. Import <LeadChatWidget /> into your root layout file.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Static contact forms fail to engage high-intent visitors before they bounce. This skill builds a production-ready AI sales assistant that qualifies leads through conversation and syncs them to your database.

    What it does

    • Multi-provider support via an LLM adapter for OpenAI, Anthropic, or Gemini.
    • Automated qualification by extracting name, email, budget, and timeline from chat.
    • Database integration using Prisma/PostgreSQL to persist sessions and leads.
    • Security guardrails to prevent prompt injection and keep keys server-side.
    • Lead scoring that calculates a 0-100 priority score for every captured lead.
    • Accessible UI featuring a floating React widget with keyboard shortcuts and ARIA support.

    How it works

    1. Initialize the adapter in src/lib/ai/provider.ts using server-side environment variables.
    2. Configure the system prompt with strict business-only scope and injection defenses.
    3. Deploy the chat route at /api/chat with Zod validation and IP-based rate limiting.
    4. Embed the widget using LeadChatWidget.tsx with quick-reply starter chips.

    Frameworks & tools

    Built for TypeScript environments using Prisma ORM, Zod for schema validation, and React for the frontend. Works with any standard LLM provider via a unified adapter pattern.

    Why this beats prompting it yourself

    Prompting alone doesn't handle session persistence, rate limiting, or data extraction into a relational database. This skill provides the architectural plumbing required to run a sales bot in production without exposing your API keys or leaking system instructions.

    Use cases

    • Qualify inbound agency leads before they book a discovery call.
    • Provide 24/7 pricing and feature support for a SaaS landing page.
    • Capture visitor intent and store it directly in a custom CRM.
    • Reduce form abandonment by offering a conversational alternative.

    Known limitations

    Requires an existing Prisma schema or PostgreSQL database for lead storage. Message history is capped at the last 15 turns to maintain performance.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 8 days ago

    Software
    tscNode.jstyprscriptprisma

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Environment Variables
    Listed8 days ago

    What's inside

    Frequently Asked Questions

    This skill replaces static contact forms with a conversational AI that qualifies leads in real-time, extracts structured data like budget and timeline, and stores it directly in your database.

    The skill includes a unified LLM adapter, making it compatible with major providers including OpenAI, Anthropic, and Google Gemini via server-side environment variables.

    You will receive the complete TypeScript source code for the React widget, the server-side API routes with Zod validation, the Prisma integration layer, and the security guardrail configurations.

    Yes, while it is optimized for Prisma and PostgreSQL, the clean architecture allows you to swap the data persistence layer to any CRM or database with minimal effort.

    The skill features built-in security guardrails and server-side key management to prevent prompt injection attacks and ensure your system instructions remain private.

    Setting up involves configuring your LLM API key, running your Prisma migrations, and embedding the React widget into your site; full documentation for these steps is provided.

    New in Sales & Lead Gen

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Sales & Lead Gen.