Chat with GitHub API using n8n, Pinecone & OpenAI RAG

This n8n workflow enables a conversational interface to query the GitHub OpenAPI specification using Retrieval-Augmented Generation (RAG) techniques with Pinecone vector database and OpenAI. It solves the problem of navigating complex API docs manually by providing quick, accurate answers.
manualTrigger
httpRequest
vectorStorePinecone
+11
Workflow Identifier: 1701
NODES in Use: Manual Trigger, HTTP Request, Pinecone Vector Store, Default Data Loader, Recursive Character Text Splitter, When chat message received, AI Agent, OpenAI Chat Model, Window Buffer Memory, Vector Store Tool, Generate User Query Embedding, Pinecone Vector Store (Querying), Generate Embeddings, Sticky Note

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow creates a chatbot that answers questions about the GitHub API by using its official OpenAPI JSON file.

It solves the problem of spending too much time searching through complex API docs. Instead, users get quick and correct answers from the workflow.

The chatbot works by processing the GitHub OpenAPI specs, storing them as searchable vectors in Pinecone, and answering queries with GPT-4o-mini.


How the workflow works – Inputs, Process, Output

Inputs

The starting input is the GitHub OpenAPI JSON file fetched by the HTTP Request node.

User questions come in through the When chat message received webhook node.

Processing Steps

  • Splits the large JSON into smaller text chunks with Recursive Character Text Splitter.
  • Generates vector embeddings for each chunk using OpenAI embeddings model.
  • Stores embeddings in Pinecone vector index with Pinecone Vector Store node.
  • When a user question arrives, converts it into an embedding.
  • Queries Pinecone for the most relevant API doc chunks matching the question.
  • Provides these chunks as context to the AI Agent node using GPT-4o-mini to generate answers.
  • Maintains conversation context using Window Buffer Memory node for better replies.

Output

The result is a chatbot reply that explains GitHub API endpoint details or usage clearly and precisely based on the official OpenAPI specs.


Who should use this workflow

This workflow is made for developers or anyone working with GitHub API who wants fast and accurate information about API endpoints.

No need to manually sift through complex JSON docs or OpenAPI files. It helps save time, reduce errors, and understand API usage quickly.


Tools and services used

  • n8n automation tool: To create and run the workflow.
  • OpenAI API: Generates vector embeddings and chat answers using GPT-4o-mini.
  • Pinecone vector database: Stores and searches vector embeddings for fast context retrieval.
  • GitHub OpenAPI JSON file: Source document describing GitHub REST API endpoints.
  • Webhook trigger: Receives user chat messages in real time.


Beginner step-by-step: How to use this workflow in n8n

Step 1: Import workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor and select Import from File.
  3. Select the downloaded workflow JSON file to import it.

Step 2: Add credentials

  1. Add your OpenAI API Key in the OpenAI nodes.
  2. Add your Pinecone API Key and endpoint to the Pinecone nodes.
  3. Verify the Pinecone index name (default is n8n-demo) matches your index.

Step 3: Configure settings

  1. If needed, update node parameters such as API URLs or index names.
  2. Make sure the webhook URL from the When chat message received node is copied for your chat client.

Step 4: Test the workflow

  1. Manually trigger the workflow or send a test chat message to the webhook URL.
  2. Check the workflow run to confirm the GitHub OpenAPI JSON is fetched, split, embedded, and indexed without errors.
  3. Verify the chatbot replies with answers to your queries.

Step 5: Activate for production

  1. Enable (activate) the workflow in n8n to run automatically.
  2. Use the webhook URL in your front-end chatbot or client app to receive user questions live.
  3. Monitor workflow logs in n8n for any issues.
  4. Optionally, use a self-host n8n setup if running on your own server.

Customization ideas

  • Change the Pinecone index name to your own custom index in both insert and query nodes.
  • Switch OpenAI GPT models in the chat node to GPT-4 or GPT-3.5 based on desired cost and accuracy.
  • Add a node after the AI Agent to log chat conversations to Google Sheets or a database.
  • Adjust Recursive Character Text Splitter node settings to change chunk size or separators for better chunks.
  • Extend with additional HTTP Request nodes to add more API docs or other JSON specs.


Common errors and how to fix them

Error: “Failed to insert vectors into Pinecone.”
Cause: Wrong Pinecone index name or invalid API keys.
Fix: Double-check index name in nodes and update API credentials in n8n.

Error: “OpenAI API call limit exceeded.”
Cause: Too many embedding or chat requests.
Fix: Reduce requests or upgrade OpenAI plan.

Error: “Webhook not triggering.”
Cause: Incorrect webhook URL or inactive workflow.
Fix: Copy the correct webhook URL and ensure workflow is active.


Summary of results

✓ Fast chatbot answers from GitHub OpenAPI docs.

✓ Saves time by avoiding manual doc reading.

✓ Helps developers understand API calls better.

✓ Easily customize for other APIs or data sources.


Frequently Asked Questions

Yes, but this workflow is set up specifically for Pinecone. Using others like Weaviate or Faiss requires changing node configurations.
Yes, generating embeddings and chat completions uses API credits. Manage usage by controlling queries and model types.
Pinecone stores vectors securely and OpenAI uses encrypted connections. Keeping API keys private is important.
Pinecone indexes scale well for many queries but the n8n instance may need autoscaling for high loads.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free