Chat with GitHub OpenAPI Specification using RAG (Pinecone and OpenAI) n8n Workflow Template

n8n workflow template · 14 nodes · Pinecone

Chat with GitHub OpenAPI Specification using RAG (Pinecone and OpenAI) is a free n8n workflow template that starts when a chat message is received and works with Pinecone and OpenAI. It has 14 nodes, 12 of them AI nodes (Pinecone Vector Store, Default Data Loader, Recursive Character Text Splitter and Chat Trigger). The notes inside the workflow say: “This part of the workflow is responsible for extracting content, generating embeddings and sending them to the Pinecone vector store.” To run it, you add your own credentials for OpenAI API and Pinecone API.

At a glance

Trigger
Chat Trigger (When chat message received)
Nodes
14
Apps
Pinecone and OpenAI
AI nodes
12
Credentials
2 types
Category
RAG, documents and vector search

Apps and integrations

  • Pinecone
  • OpenAI

Node types used

  • Manual Trigger
  • HTTP Request
  • Pinecone Vector Store
  • Default Data Loader
  • Recursive Character Text Splitter
  • Chat Trigger
  • AI Agent
  • OpenAI Chat Model
  • Window Buffer Memory
  • Vector Store Question Answer Tool
  • OpenAI Embeddings

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Indexing content in the vector database

This part of the workflow is responsible for extracting content, generating embeddings and sending them to the Pinecone vector store.

It requests the OpenAPI specifications from GitHub using a HTTP request. Then, it splits the file in chunks, generating embeddings for each chunk using OpenAI, and saving them in Pinecone vector DB.

Querying and response generation

This part of the workflow is responsible for the chat interface, querying the vector store and generating relevant responses.

It uses OpenAI GPT 4o-mini to generate responses.

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

RAG workflow in n8n

This is an example of how to use RAG techniques to create a chatbot with n8n. It is an API documentation chatbot that can answer questions about the GitHub API. It uses OpenAI for generating embeddings, the gpt-4o-mini LLM for generating responses and Pinecone as a vector database.

Before using this template

  • create OpenAI and Pinecone accounts
  • obtain API keys OpenAI and Pinecone
  • configure credentials in n8n for both
  • ensure you have a Pinecone index named "n8n-demo" or adjust the workflow accordingly.

Nodes in this workflow

The 14 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. When clicking ‘Test workflow’ (Manual Trigger)
  2. HTTP Request (HTTP Request)
  3. Pinecone Vector Store (Pinecone Vector Store)
  4. Default Data Loader (Default Data Loader)
  5. Recursive Character Text Splitter (Recursive Character Text Splitter)
  6. When chat message received (Chat Trigger)
  7. AI Agent (AI Agent)
  8. OpenAI Chat Model (OpenAI Chat Model)
  9. Window Buffer Memory (Window Buffer Memory)
  10. Vector Store Tool (Vector Store Question Answer Tool)
  11. OpenAI Chat Model1 (OpenAI Chat Model)
  12. Generate User Query Embedding (OpenAI Embeddings)
  13. Pinecone Vector Store (Querying) (Pinecone Vector Store)
  14. Generate Embeddings (OpenAI Embeddings)

Credentials you need

  • OpenAI API – used by Generate Embeddings, Generate User Query Embedding, OpenAI Chat Model and OpenAI Chat Model1
  • Pinecone API – used by Pinecone Vector Store and Pinecone Vector Store (Querying)

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us