Build an intelligent AI assistant using this powerful n8n workflow. Connect OpenAI and GitHub to create a knowledge base (RAG) from your source code using custom n8n templates.
Download this n8n workflow template and start using it instantly.
Managing vast amounts of source code or documentation often makes finding specific technical details challenging. This innovative n8n workflow solves this problem by turning your GitHub repository into a searchable knowledge base for an AI Agent.
This robust n8n template separates the process into two key phases: a synchronization flow (indexing the data) and a real-time conversational flow (answering questions). It demonstrates how seamlessly n8n handles large binary data, text splitting, embedding generation, and vector storage, all within a single, coherent n8n workflow. By using this n8n node setup, developers can query their codebase conversationally, drastically reducing search time and enhancing productivity.
This comprehensive n8n workflow operates in two distinct stages:
Sync Data n8n trigger (a Manual Trigger node).Config n8n node defines critical parameters like repoowner, reponame, and subpath within the GitHub repository.List files n8n node uses these parameters to identify all relevant files in the designated path.Get File n8n node downloads the actual content of each file.Default Data Loader handles the binary data, and the Recursive Character Text Splitter chops the content into smaller, manageable chunks (with 100 characters of overlap) suitable for vector embedding.Embeddings OpenAI n8n node calculates the vector embeddings for these chunks. Finally, the Simple Vector Store1 n8n node inserts the vector data into an in-memory knowledge base keyed as source-code.When chat message received n8n trigger when a user asks a question.AI Agent n8n node takes the query and leverages the OpenAI Chat Model1 for reasoning.Window Buffer Memory n8n node maintains conversation history.Vector Store Tool n8n node, named projectsource_tool, to perform a similarity search (top K=5) against the indexed knowledge base (Simple Vector Store). This retrieval step is crucial for contextual grounding.To deploy this powerful n8n workflow using these n8n templates, follow these steps:
Embeddings OpenAI and the OpenAI Chat Model n8n nodes. This is essential for both indexing and querying.Config n8n node and update the parameters according to your repository:repoowner: The owner of the GitHub repository.reponame: The name of the repository.sub_path: The specific directory path within the repository you wish to index (e.g., workflows or docs).Sync Data n8n trigger once to populate the Vector Store with your GitHub content before using the chat agent. Sync Data (Manual Trigger): The starting n8n trigger for the indexing side of the n8n workflow, used to manually refresh the knowledge base.
Config (Set): A foundational n8n node used to dynamically set environment variables (repoowner, reponame, subpath) used throughout the indexing flow.
List files (GitHub): This n8n node retrieves a list of files from the configured GitHub repository path, providing file details needed for downloading.
Get File (HTTP Request): Downloads the actual content of the files using the downloadurl provided by the GitHub n8n node, preparing the data for embedding.
Recursive Character Text Splitter: A key RAG preprocessing n8n node that efficiently splits large files into smaller chunks, optimizing them for embedding and vector search. Configured with a chunk overlap of 100.
Embeddings OpenAI / Embeddings OpenAI1: Two instances of this n8n node, responsible for converting text chunks and incoming queries into high-dimensional numerical vectors using the OpenAI service.
Simple Vector Store / Simple Vector Store1 (Vector Store In Memory): These n8n nodes maintain the RAG knowledge base using the key source-code. One is set to insert mode (for indexing) and the other is set to default (for search retrieval).
When chat message received (Chat Trigger): The initiating n8n trigger for the AI Agent side, listening for user interactions in the n8n chat interface.
AI Agent (LangChain Agent): The primary brain of the n8n workflow. Configured with a system message guiding it to use the projectsourcetool for technical questions based on the source code.
Vector Store Tool: An n8n node that defines how the AI Agent interacts with the knowledge base, specifically configured to retrieve the top 5 most relevant document chunks (topK=5).
Use this powerful n8n workflow to generate a real-time Calendly availability API endpoint. Get scheduling slots instantly using the n8n trigger and native n8n node integration.

Build a robust CRUD REST API quickly using this n8n workflow, leveraging Google Sheets as your serverless database. This powerful n8n template handles POST, GET, PUT, and DELETE requests.

Use an advanced n8n workflow to deploy a custom AI Executive PA chatbot for your website. This smart n8n template handles customer inquiries, checks Microsoft Outlook calendar availability, and books meetings using specialized n8n tools and the powerful n8n node architecture.

Deploy a robust RAG chatbot using n8n templates, Pinecone, and OpenAI. This dynamic n8n workflow automatically ingests PDFs from Google Drive to create a searchable knowledge base.

Deploy a complete AI Engineering Department using this advanced n8n workflow. The CTO n8n agent delegates tasks to specialized DevOps, Security, and Architect agents powered by OpenAI models.

Use this powerful n8n workflow to deploy a complete AI HR department. Featuring a strategic CHRO agent and specialist teams (Recruiter, Policy Writer, Compensation), this n8n automation leverages OpenAI O3 and GPT-4.1-mini for cost-effective, complex HR solutions.

I am Nguyen Trung Nghia, a Software Engineer passionate about AI Automation. I build intelligent automation systems that help businesses reduce costs, increase productivity, and scale faster with the power of AI technology.







































