Skip to content

Krishiv1611/Synora

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Synora — AI-Powered Business Automation Platform

Synora is a fully-functional B2B omnichannel AI platform that lets businesses create, optimize, and manage their digital presence. Deploy an autonomous AI agent that knows your business inside and out—handling text chats, real-time voice conversations, and direct phone calls right from your website, complete with automated call summaries and secure team collaboration.


🌟 Core Value Proposition

Synora allows businesses to go beyond simple generic chatbots. By feeding the system business knowledge (websites, documents, text), Synora generates an embeddable, deeply knowledgeable widget that answers customer questions using advanced Retrieval-Augmented Generation (RAG).

Think of it as a self-service version of premium support tools like Intercom or Drift—but fully autonomous, powered by Google Gemini 2.5 Flash, and seamlessly supporting both voice and text.


✨ Key Features

1. 🧠 Multi-Format Knowledge Engine (RAG)

  • Ingest Anything: Upload .txt or Markdown files, paste raw text, or provide URLs for automated web scraping (integrating with services like ZenRows).
  • AI Summarization: Data is passed through Gemini for intelligent, dense summarization.
  • Advanced Embeddings: Generates 3072-dimensional embeddings via gemini-embedding-001.
  • Vector Search: Stores and retrieves context efficiently using Neon PostgreSQL and pgvector.

2. 🎙️ Triple-Mode Embed Widget

The frontend widget embedded on customer sites offers three distinct modes:

  1. Text Chat: Real-time text-based RAG chat.
  2. Voice Mode: In-browser, real-time voice conversations powered by Vapi.
  3. Call Mode: Displays a dedicated phone number (phone_number_id) for customers to natively dial for support.

3. 🎭 Sections (Chatbot Personas)

  • Create specialized personas for different parts of your widget.
  • Define explicit tones (e.g., friendly, technical).
  • Set strict boundaries with allowed topics and blocked topics.
  • Link specific subsets of your knowledge base to distinct personas.

4. 📊 AI-Powered Call Analytics & Webhooks

  • Automatically receives end-of-call webhooks from Vapi.
  • Parses full call transcripts and fetches audio recordings (recording_url).
  • Uses Gemini to automatically generate a concise ai_summary of the phone call.
  • Tracks visitor data and conversation durations natively within the dashboard.

5. 🔐 Enterprise Secrets & Team Collaboration

  • Bring Your Own Keys (BYOK): Securely integrates with AWS Secrets Manager so users can input and store their own API keys (e.g., Vapi) without exposing them in the local database.
  • Scalekit Integration: Next-gen B2B auth and team management. Invite team members, assign organizational roles, and manage SSO/OAuth flows efficiently.

🛠️ Tech Stack

Layer Technology
Framework Next.js 16.1.6 (App Router)
Language TypeScript, Node.js
Styling & UI Tailwind CSS v4, Shadcn UI, Radix UI, Framer Motion
Database PostgreSQL (Neon serverless) with Drizzle ORM
Vector Engine pgvector (3072-dim embeddings)
AI / LLM Google Gemini 2.5 Flash, gemini-embedding-001 (via LangChain)
Voice AI Vapi (@vapi-ai/web, @vapi-ai/server-sdk)
Auth & B2B SaaS Scalekit (OAuth/SSO, Team Invites)
Secrets Management AWS Secrets Manager (@aws-sdk/client-secrets-manager)
Validation & Utils Zod, date-fns, react-hook-form
Tokenization @lenml/tokenizer-gemini
Deployment Docker & Docker Compose

🗄️ Database Schema Overview

Synora's database is managed via Drizzle ORM (db/schema.ts) and consists of 10 highly relational tables:

  1. user - Synced user profiles (id, org, name, email).
  2. metadata - Core business info (business name, website URL).
  3. knowledge - Knowledge base entries holding the raw content, metadata, and 3072-dim embedding vectors.
  4. sections - Chatbot personas mapping tones and allowed/blocked topics.
  5. chatBotMetadata - Widget appearance (color, welcome message) and integration IDs (assistant_id, phone_number_id).
  6. teamMembers - Tracks invited users, roles, and status (powered by Scalekit).
  7. visitors - End-customers interacting with the widget (captures IP, email, phone).
  8. conversation - Parent tracker for chat/voice sessions, durations, Vapi call IDs, and AI-generated summaries.
  9. messages - The individual back-and-forth messages within a text conversation.
  10. plugins - Tracks active integrations (like Vapi) mapped to AWS secret names.
  11. subscriptions - Schema placeholder for upcoming billing tiers and Stripe/Polar.sh integration.

🏗️ Architecture & Request Flow

  1. Onboarding: A business owner logs in via Scalekit, adds metadata, and uploads text/URLs.
  2. Ingestion: Synora summarizes the data using Gemini, embeds it, and saves it in pgvector.
  3. Widget Setup: Owner customizes the widget (colors, Vapi assistant IDs) and copies the lightweight <script> tag.
  4. End-User Interaction: A visitor lands on the business page and opens the widget.
    • Session: Widget requests a signed JWT session.
    • Chat: For text chats, a POST is sent to /api/chat/public. Cosine similarity search fetches the top 4 relevant docs. Gemini processes the system prompt (along with specific Section rules) to answer within 20,000 character limits.
    • Voice: For voice, Vapi takes over the browser microphone, processes voice-to-text, queries the same backend knowledge limits, and speaks back.
  5. Analytics: Post-chat/Post-call, data is compiled, summarized by AI, and served to the Business Owner's Next.js dashboard.

🚀 Getting Started

Prerequisites

  • Node.js (v20+ recommended)
  • PostgreSQL Database with pgvector enabled (e.g., Neon.tech)
  • Google AI Studio API Key (Gemini)
  • Scalekit Account Credentials
  • AWS Account (for Secrets Manager)
  • Vapi Account (optional, for Voice functionalities)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd synora
  2. Install dependencies:

    npm install
  3. Environment Setup: Create a .env file in the root directory (refer to .env.example if available) and add the necessary keys for Database, Scalekit, Gemini, AWS AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY, and JWT keys.

  4. Database Migration: Generate and push the Drizzle schema to your Postgres instance:

    npm run db:generate
    npm run db:push
  5. Start Development Server:

    npm run dev

    Open http://localhost:3000 to view the application.


🐳 Deployment

Synora is fully Dockerized for multi-stage production builds and easy shipping.

To run via Docker Compose:

docker-compose up --build -d

This will build the Next.js production bundle using the included Dockerfile and serve it efficiently.


🛡️ License & Copyright

(Include specific licensing details based on the organization's requirements for Synora.)

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages