netflix/NETFLIX_GRAPHRAG_DESCRIPTION.md
michael 236d1ddbd8 Initial commit: Netflix GraphRAG marketing chatbot
Full-stack application combining LlamaIndex vector search with Neo4j
knowledge graph (GraphRAG) for answering queries about Netflix marketing
materials. Flask/Hypercorn backend with custom ReAct agent, React frontend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 10:28:33 -06:00

6 KiB

Netflix GraphRAG Chatbot

Overview

The Netflix GraphRAG Chatbot is an advanced AI-powered knowledge assistant specifically designed to help users navigate Netflix's marketing materials, particularly the GPD Key Art Playbook and related design guidelines. It leverages a hybrid retrieval system that combines traditional vector search with graph-based knowledge representation to provide comprehensive and contextually relevant answers.

User Experience

Chat Interface

Users interact with the system through a modern, intuitive chat interface that features:

  • Conversation Management: Create, select, and manage multiple conversation threads
  • Rich Text Responses: Markdown-formatted responses with proper formatting and layout
  • Source Attribution: View the sources of information used to generate answers
  • Image Support: Access to relevant document screenshots directly within the chat
  • Reasoning Transparency: Option to view the AI's reasoning process for each response
  • Theme Toggle: Switch between light and dark modes for comfortable viewing

Authentication

The application integrates with Microsoft Authentication Library (MSAL) for secure access, with:

  • Azure AD Integration: Enterprise-grade authentication for Netflix employees
  • Development Mode: A special bypass mode for local development that uses a default user

User Workflow

  1. Users log in through Microsoft authentication (or bypass in development mode)
  2. They can create a new conversation or select an existing one
  3. Questions are submitted through the chat input
  4. The system processes the query, combining vector-based and graph-based retrieval
  5. Responses include the answer, source references, and optional document images
  6. Conversations are persistent, allowing users to return to previous discussions

Technical Architecture

Backend Components

  1. Flask Server: Python-based REST API server using Hypercorn for async support

  2. Document Processing Pipeline:

    • LlamaParse Integration: Extracts text and images from various document formats
    • Semantic Chunking: Divides documents into meaningful semantic units
    • Entity Extraction: Identifies entities and relationships for the knowledge graph
    • Image Processing: Associates document screenshots with relevant text chunks
  3. Retrieval System:

    • Vector Storage: LlamaIndex with OpenAI embeddings for similarity search
    • Graph Database: Neo4j for storing and querying knowledge graph relationships
    • Hybrid Query Engine: Combined vector and graph-based retrieval for comprehensive answers
  4. Session Management:

    • MongoDB Integration: Stores user information, conversations, and messages
    • State Management: Handles session persistence and conversation tracking

Frontend Components

  1. React Application:

    • Built with Vite for fast development and optimized production builds
    • Tailwind CSS for responsive design and theming
    • Microsoft Authentication Library (MSAL) integration
  2. Key Features:

    • Real-time conversation updates with optimistic UI
    • Adaptive sidebar for conversation management
    • Image viewer with pagination for document screenshots
    • Source and reasoning tooltips for transparency
    • Offline fallback mode during development

GraphRAG Implementation

The system's core innovation is its GraphRAG (Graph Retrieval Augmented Generation) approach:

How It Works

  1. Document Processing:

    • Documents are chunked into semantic units using AI-based splitting
    • Each chunk is embedded and stored in a vector index
    • Entities and relationships are extracted from chunks using LLMs
    • A knowledge graph is constructed in Neo4j based on these extractions
  2. Community Detection:

    • The knowledge graph is analyzed to detect communities of related entities
    • Each community receives an AI-generated summary of its collective knowledge
    • Community information is cached to improve response time
  3. Dual Retrieval Process:

    • Vector Retrieval: Traditional similarity search finds relevant document chunks
    • Graph Retrieval: Entities from the query are mapped to graph communities
    • Context Merging: Information from both sources is combined for a comprehensive answer
  4. Answer Generation:

    • The LLM synthesizes information from both vector and graph contexts
    • The system returns the answer along with source documents and images
    • Reasoning steps are included for transparency

Advantages Over Standard RAG

  • Contextual Understanding: Graph relationships provide semantic connections beyond keyword matching
  • Cross-Document Insights: Can draw connections between information in separate documents
  • Community Summaries: Provides broader context from related concepts
  • Visual Context: Automatically includes relevant document images

Deployment & Development

Backend Setup

# Set up Python environment
python -m venv env
source env/bin/activate
pip install -r requirements.txt

# Configure local databases
cd db
docker-compose up -d  # MongoDB
cd ../neo4j
docker-compose -f docker-compose-neo4j.yml up -d  # Neo4j

# Run the server
python main.py

Frontend Setup

# Set up and run the React frontend
cd chat-interface
npm install
npm run dev

Development Mode

For local development, the system can run in a special mode that bypasses authentication:

  1. Create a .env file with PRODUCTION=false
  2. Start the backend and frontend servers
  3. Access the application at http://localhost:5173

Conclusion

The Netflix GraphRAG Chatbot represents a significant advancement in knowledge retrieval systems. By combining vector search with graph-based knowledge representation, it delivers more comprehensive, contextual answers that better reflect the interconnected nature of Netflix's marketing materials and guidelines. The system's ability to include relevant document images and explain its reasoning creates a more transparent and trustworthy user experience.