Skip to content

harshithpabbati/answerify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

135 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Answerify - AI-Powered Customer Support Platform

Answerify is a modern customer support platform that uses AI to automatically answer customer questions, saving your team time while maintaining quality responses.

Features

๐Ÿค– AI-Powered Auto-Replies

Answerify uses Google Gemini AI to generate intelligent, contextually relevant responses based on your knowledge base. The system:

  • Analyzes incoming customer emails using semantic search
  • Generates accurate responses with source citations
  • Learns from human feedback to improve over time

๐Ÿ“Š Intelligent Knowledge Base Management

  • Vector Embeddings: Content is chunked and embedded for semantic search
  • Multiple Data Sources: Support URLs, documentation, FAQs, and more
  • Internal Knowledge Base: Auto-learns from approved responses
  • Real-time Indexing: New content is automatically indexed when added

โœ‰๏ธ Email Thread Management

  • Unified Inbox: View all customer conversations in one place
  • Real-time Updates: New emails appear instantly via Supabase Realtime
  • Status Tracking: Open/closed ticket management
  • Rich Text Editor: Compose replies with Tiptap-powered formatting

๐ŸŽฏ Intent Detection & Tagging

The system automatically classifies incoming emails into categories:

Category Icon Description
Billing ๐Ÿ’ณ Payment and invoice questions
Bug Report ๐Ÿ› Software issues and errors
Feature Request โœจ Enhancement suggestions
General Support ๐Ÿ’ฌ Standard support queries
Account Access ๐Ÿ” Login and access issues
Account Settings โš™๏ธ Configuration questions
Account Deletion ๐Ÿ—‘๏ธ Data removal requests
Refund Request ๐Ÿ’ฐ Money return inquiries
Payment Failed โŒ Transaction failures
Subscription Change ๐Ÿ”„ Plan modifications
Invoice Request ๐Ÿ“„ Billing document requests
Performance Issue โšก Speed and responsiveness
Integration Issue ๐Ÿ”Œ Third-party connectivity
Data Export ๐Ÿ“ค Information retrieval
Upgrade Inquiry ๐Ÿš€ Product upgrades
Demo Request ๐ŸŽฏ Product demonstrations
Onboarding Help ๐ŸŽ“ Getting started assistance
How-To Question โ“ Usage instructions
Security Concern ๐Ÿ›ก๏ธ Safety and privacy
Abuse Report ๐Ÿšซ Policy violations
Privacy Request ๐Ÿ”’ GDPR and data requests
Complaint ๐Ÿ˜ค Dissatisfaction
Compliment ๐ŸŒŸ Positive feedback
Spam / Irrelevant ๐Ÿšฎ Noise filtering

๐Ÿ”„ Workflow Automation

Create automated rules to handle common scenarios:

Trigger Types:

  • subject_contains - Match emails by keyword in subject
  • sender_domain - Match emails from specific domains
  • has_tag - Match emails with specific intent tags
  • any_email - Trigger on all incoming emails

Automation Steps:

  • Add Tag: Automatically categorize emails
  • Auto Reply: Send predefined responses
  • Escalate: Flag high-priority items
  • Call Webhook: Integrate with external systems

๐Ÿ›ก๏ธ Autopilot Mode

Smart automation with human oversight:

  • High Confidence (โ‰ฅ65%): Auto-sends AI-generated replies
  • Low Confidence: Creates drafts for human review
  • Configurable Threshold: Adjust sensitivity per organization
  • Safety Guards: Never sends empty or unclear responses

๐Ÿ“ Learning Loop

Continuous improvement from human feedback:

  1. Agent edits an AI draft
  2. System tracks the human response
  3. If approved, the response is chunked and embedded
  4. Future similar queries use this learned content
  5. Reply quality improves over time

๐Ÿ‘ฅ Team Collaboration

  • Role-Based Access: Member, Admin, and Owner roles
  • Invite System: Add team members by email
  • Organization Management: Multiple workspaces supported

Architecture

Database Schema

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  organization   โ”‚โ”€โ”€โ”€โ”€<โ”‚    member       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ”œโ”€โ”€โ”€โ”€<โ”‚    thread        โ”‚
        โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚            โ”‚
        โ”‚            โ”‚
        โ”œโ”€โ”€โ”€โ”€<โ”‚    email         โ”‚
        โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ”œโ”€โ”€โ”€โ”€<โ”‚    reply         โ”‚
        โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ”œโ”€โ”€โ”€โ”€<โ”‚  datasource      โ”‚
        โ”‚            โ”‚
        โ”‚            โ”‚
        โ”‚            โ””โ”€โ”€โ”€โ”€<โ”‚    section      โ”‚
        โ”‚                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ”œโ”€โ”€โ”€โ”€<โ”‚   workflow      โ”‚
        โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ””โ”€โ”€โ”€โ”€<โ”‚   mcp_server    โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Tables

Table Description
organization Tenant workspace with settings
member User membership with roles
thread Email conversation thread
email Individual messages
reply AI-generated or human drafts
datasource Content sources (URLs)
section Chunked content with embeddings
workflow Automation rules
mcp_server MCP tool integrations

API Flow

Inbound Email
      โ”‚
      โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Webhook Handler โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Intent Detectionโ”‚ โ”€โ”€โ”€โ–บ Tags added to thread
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Vector Search   โ”‚โ”€โ”€โ”€โ”€>โ”‚ Match Sections  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Generate Reply  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Workflow Runner โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”
    โ”‚         โ”‚
    โ–ผ         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Auto โ”‚ โ”‚ Draft  โ”‚
โ”‚ Send โ”‚ โ”‚ Review โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Environment Variables

Required

Variable Description
NEXT_PUBLIC_SUPABASE_URL Supabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase anonymous key
SUPABASE_SERVICE_KEY Supabase service role key
NEXT_PUBLIC_BASE_URL Application base URL
RESEND_API_KEY Resend email API key
GOOGLE_GENERATIVE_AI_API_KEY Google Gemini API key

Optional - Cloudflare AI Gateway

Variable Description
CLOUDFLARE_ACCOUNT_ID Cloudflare account ID
CLOUDFLARE_GATEWAY_NAME AI Gateway identifier
CF_AIG_TOKEN AI Gateway auth token

Development

Setup

# Install dependencies
pnpm install

# Copy environment variables
cp .env.example .env.local

# Start development server
pnpm dev

Database Migrations

Apply migrations via Supabase CLI or dashboard:

supabase db push

Key Scripts

Command Description
pnpm dev Start development server
pnpm build Build for production
pnpm lint Run ESLint
pnpm tsc TypeScript type check

Configuration

Autopilot Settings

-- Disable autopilot
UPDATE organization
SET autopilot_enabled = false
WHERE id = '<org-id>';

-- Adjust confidence threshold
UPDATE organization
SET autopilot_threshold = 0.75
WHERE id = '<org-id>';

Tone Policy

Customize AI response tone:

UPDATE organization
SET tone_policy = 'friendly'
WHERE id = '<org-id>';

Security

  • Row-Level Security (RLS): All tables enforce organization-based access
  • Service Role: Webhooks use service key for elevated access
  • Email Sanitization: All HTML content is XSS-sanitized
  • API Authentication: Demo endpoints require Bearer tokens

Support

For issues and feature requests, please open a GitHub issue.

About

AI-Powered Customer Support Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors