Wiro - Ask Questions to a YouTube Video With AI icon

Wiro - Ask Questions to a YouTube Video With AI

Ask questions and get instant answers from any YouTube video using Wiro’s RAG AI

Overview

This node enables users to ask questions and receive instant AI-generated answers about the content of any YouTube video by providing its URL. It leverages a Retrieval-Augmented Generation (RAG) approach combined with large language models (LLMs) to analyze the video's transcript or metadata and generate relevant responses based on user prompts.

Common scenarios where this node is beneficial include:

  • Quickly summarizing or extracting key points from lengthy YouTube videos.
  • Creating interactive chatbots that can discuss specific video content.
  • Enhancing content discovery by querying video topics without watching them fully.
  • Educational tools that answer questions about tutorial or lecture videos.

For example, a user could input a YouTube video URL of a documentary and ask, "What are the main themes discussed in this video?" The node will return an AI-generated summary or explanation based on the video's content.

Properties

Name Meaning
Website URL The full URL of the YouTube video you want the AI to analyze and chat about.
Prompt The question or message you want to ask about the YouTube video content.
User ID Optional user identifier for session continuity, allowing personalized or continuous conversations.
Session ID Optional session identifier to maintain chat history across interactions.
System Prompt Defines the AI assistant’s behavior and tone, including instructions to be helpful, respectful, honest, safe, unbiased, and positive. Also instructs the AI to avoid false information and explain incoherent questions.
Selected Model Select a large language model (LLM) chat model from a list of available options, such as various Qwen, DeepSeek, Llama, EuroLLM, Mistral, Microsoft Phi, and others.
Temperature Adjusts randomness of outputs; higher values produce more diverse results.
Top P Samples from the top p percentage of most likely tokens to influence output diversity.
Top K Samples from the top k most likely tokens to control randomness.
Chunk Size Size of text chunks (in tokens) used when processing the video content for analysis.
Chunk Overlap Number of overlapping tokens between chunks to maintain context across segments.
Similarity Top K Number of most relevant chunks used as context for generating answers.
Context Window Token limit for input context to the model; controls how much prior information is considered.
Max New Tokens Maximum number of tokens the model should generate in the response.
Seed Seed value for reproducible outputs, ensuring consistent results given the same inputs.
Quantization Option to enable quantized models for improved performance at potential cost of precision.
Do Sample Whether to enable sampling randomness during generation, affecting variability of answers.

Output

The node outputs a JSON object containing:

  • taskid: The unique identifier of the task submitted to the external API.
  • message: The AI-generated answer or chat message related to the YouTube video content.
  • status: The status of the task, which can be "completed" if successful or "failed" if an error occurred during processing.

The output does not include binary data; it focuses on textual AI responses derived from the video analysis.

Dependencies

  • Requires an API key credential for authenticating with the external Wiro AI service.
  • Makes HTTP POST requests to the Wiro API endpoint https://api.wiro.ai/v1/Run/wiro/rag-chat-youtube.
  • Uses a polling mechanism to wait for the asynchronous task completion via a socket access token provided by the API.
  • Relies on helper functions to generate authentication headers and handle request retries until the AI response is ready.

Troubleshooting

  • Missing or invalid API credentials: The node requires valid API keys for the Wiro AI service. Ensure credentials are correctly configured in n8n.
  • API response missing task ID or socket token: If the API does not return these, the node throws an error indicating invalid response. Verify network connectivity and API service status.
  • Task failure statuses (-1, -2, -3, -4): These indicate different failure modes during processing. Check the API documentation or logs for detailed error causes.
  • Timeouts or long waits: Since the node polls asynchronously for task completion, slow API responses may delay output. Consider increasing timeout settings or checking API load.
  • Invalid input parameters: Ensure all required properties like Website URL and Prompt are provided and correctly formatted.

Links and References

Discussion