An intelligent YouTube video conversation platform powered by AI
Demo β’ Features β’ Installation β’ API Reference
YtVerb revolutionizes how you interact with YouTube content by enabling intelligent conversations with any YouTube video. Using advanced RAG (Retrieval-Augmented Generation) architecture, the platform extracts, processes, and indexes video transcripts, allowing users to ask questions and get contextual answers about video content without watching the entire video.
- Instantly chat with any YouTube video using advanced AI
- Get immediate responses, summaries, and insights from video content
- Context-aware conversations that understand video themes and concepts
- AI understands context, themes, and key concepts from video content
- Deep learning capabilities for comprehensive content understanding
- Advanced query processing with contextual awareness
- Works with tutorials, podcasts, documentaries, and any YouTube content
- Support for educational videos, reviews, and entertainment content
- Flexible content processing pipeline
- Skip through long videos by asking specific questions
- Get instant answers without watching entire content
- Efficient knowledge extraction and summarization
- Framework: Next.js 15.5.0 with App Router
- Language: TypeScript 5.x
- Styling: Tailwind CSS 4.x with custom design system
- State Management: React Hooks with real-time updates
- UI Components: Custom components with Radix UI primitives
- Animations: Motion library for smooth interactions
- Build Tool: Turbopack for fast development and builds
- Runtime: Node.js with Express.js 5.x
- Language: TypeScript
- AI Framework: LangChain for RAG pipeline orchestration
- LLM: Google Gemini 1.5 Flash for conversation generation
- Embeddings: Google Generative AI Embeddings (gemini-embedding-001)
- Document Processing: YouTube transcript extraction and chunking
- Primary Database: Supabase (PostgreSQL)
- Vector Store: Supabase Vector Store with pgvector extension
- Tables:
conversations- Chat session managementdocuments- Video document metadataembedded_documents- Vector embeddings storageconversation_messages- Chat historyconversations_document- Conversation-document relationships
// YouTube video processing pipeline
const loader = YoutubeLoader.createFromUrl(url, {
addVideoInfo: true
});
const docs = await loader.load();const textSplitter = new RecursiveCharacterTextSplitter({
chunkSize: 1000,
chunkOverlap: 200
});
const embeddings = new GoogleGenerativeAIEmbeddings({
modelName: "gemini-embedding-001",
taskType: TaskType.RETRIEVAL_DOCUMENT,
apiKey: process.env.GOOGLE_API_KEY
});const vectorStore = new SupabaseVectorStore(embeddings, {
client: supabase,
tableName: "embedded_documents",
queryName: "match_documents"
});const retriever = vectorStore.asRetriever();
const chatModel = new ChatGoogleGenerativeAI({
model: "gemini-1.5-flash",
temperature: 0.7,
streamUsage: true
});
Modern landing page with animated elements and call-to-action
Comprehensive feature showcase with bento grid layout
Side-by-side video player and AI chat interface
- Node.js 18+ and npm/yarn
- Supabase account with pgvector extension
- Google AI API key
- Git
git clone https://github.com/yourusername/ytverb.git
cd ytverbcd backend
npm install
# Create .env file
cp .env.example .envConfigure your .env file:
DATABASE_URL=your_postgresql_url
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_anon_key
GOOGLE_API_KEY=your_google_ai_api_keycd ../frontend
npm install
# Create .env.local file
cp .env.example .env.localConfigure your .env.local file:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_keyRun the following SQL in your Supabase SQL editor:
-- Enable pgvector extension
CREATE EXTENSION IF NOT EXISTS vector;
-- Create tables
CREATE TABLE conversations (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
CREATE TABLE documents (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
CREATE TABLE embedded_documents (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
content TEXT,
metadata JSONB,
embedding VECTOR(768),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
CREATE TABLE conversation_messages (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
conversation_id UUID REFERENCES conversations(id),
role TEXT CHECK (role IN ('user', 'assistant')),
content TEXT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
CREATE TABLE conversations_document (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
conversation_id UUID REFERENCES conversations(id),
document_id UUID REFERENCES documents(id),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create vector similarity function
CREATE OR REPLACE FUNCTION match_documents(
filter JSONB DEFAULT '{}',
match_count INT DEFAULT 5,
query_embedding VECTOR(768) DEFAULT NULL
)
RETURNS TABLE(
id UUID,
content TEXT,
metadata JSONB,
similarity FLOAT
)
LANGUAGE plpgsql
AS $$
BEGIN
RETURN QUERY
SELECT
embedded_documents.id,
embedded_documents.content,
embedded_documents.metadata,
1 - (embedded_documents.embedding <=> query_embedding) AS similarity
FROM embedded_documents
WHERE (filter = '{}' OR embedded_documents.metadata @> filter)
ORDER BY embedded_documents.embedding <=> query_embedding
LIMIT match_count;
END;
$$;# Terminal 1 - Backend
cd backend
npm run dev
# Terminal 2 - Frontend
cd frontend
npm run devVisit http://localhost:3000 to see the application!
POST /store-document
Processes and stores a YouTube video for conversation.
// Request
{
"url": "https://youtube.com/watch?v=VIDEO_ID",
"document_id": "uuid-string"
}
// Response
{
"ok": true
}POST /query-document
Queries the stored video content using natural language.
// Request
{
"query": "What is the main topic of this video?",
"document_ids": ["uuid-string"],
"conversation_id": "uuid-string"
}
// Response (Streaming)
{
"content": "The main topic discussed in this video is..."
}ytverb/
βββ frontend/ # Next.js frontend application
β βββ app/ # App router pages and layouts
β βββ components/ # Reusable UI components
β βββ lib/ # Utility functions and helpers
β βββ public/ # Static assets
βββ backend/ # Express.js backend API
β βββ src/
β β βββ routes/ # API route handlers
β β βββ services/ # Business logic services
β β βββ helpers/ # Utility functions
β βββ index.ts # Server entry point
βββ README.md
DATABASE_URL- PostgreSQL connection stringSUPABASE_URL- Supabase project URLSUPABASE_KEY- Supabase anon/service keyGOOGLE_API_KEY- Google AI API key
NEXT_PUBLIC_SUPABASE_URL- Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Supabase anonymous key
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- LangChain for the RAG framework
- Supabase for the vector database
- Google AI for the language models
- Next.js for the frontend framework
Made with β€οΈ by AbsFuty7
β Star this repo if you find it helpful!