Skip to main content

AI-powered company documents Q&A assistant with Google Drive and GPT-4 mini

Workflow preview

Workflow preview
100%
AI-powered company documents Q&A assistant with Google Drive and GPT-4 mini preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Company Knowledge Base Assistant Who's it for This workflow is designed for companies looking to onboard new employees and interns efficiently. It's perfect for HR teams, team leaders, and organiza...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.googledrivetrigger, n8n-nodes-base.googledrive, @n8n/n8n-nodes-langchain.vectorstoreinmemory, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.agent

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Roshan Ramani.

Original n8n.io source

1.1 Workflow description

Title
AI-powered company documents Q&A assistant with Google Drive and GPT-4 mini
Workflow name
AI-powered company documents Q&A assistant with Google Drive and GPT-4 mini

Company Knowledge Base Assistant

Who's it for

This workflow is designed for companies looking to onboard new employees and interns efficiently. It's perfect for HR teams, team leaders, and organizations that want to provide instant access to company knowledge without manual intervention. Whether you're a startup or an established company, this assistant helps your team find answers quickly from your existing documentation.

What it does

This AI-powered chatbot automatically learns from your company documents stored in Google Drive and provides accurate, contextual answers to employee questions. The system continuously monitors a designated Drive folder, processes new documents, and makes them instantly searchable through a conversational interface.

Key features:

  • Automatic document ingestion from Google Drive
  • Intelligent search across all company documents
  • Conversational interface with memory
  • Source citation for answers
  • Real-time updates when new documents are added

How it works

The workflow has two main components:

Document Processing Pipeline: Monitors your Google Drive folder every minute for new files. When a document is added, it's automatically downloaded, split into searchable chunks, converted into vector embeddings, and stored in an in-memory knowledge base.

Chat Interface: Users send questions via webhook, the AI agent searches the knowledge base for relevant information, maintains conversation history for context, and returns accurate answers with source citations.

Requirements

  • Google Drive account with OAuth2 credentials
  • Google Service Account for document downloads
  • OpenAI API key for embeddings and chat model
  • Designated Google Drive folder for company documents

Setup Instructions

  1. Configure Google Drive:

    • Set up Google Drive OAuth2 credentials in the "Watch Company Docs Folder" node
    • Set up Google Service Account credentials in the "Fetch New Document" node
    • Select your company documents folder in the trigger node
  2. Configure OpenAI:

    • Add your OpenAI API key to both embedding nodes
    • The workflow uses GPT-4 Mini for cost-effective responses
  3. Upload Your Documents:

    • Add company handbooks, policies, procedures, and FAQs to the designated Drive folder
    • Documents will be automatically processed within minutes
  4. Test the Chat Interface:

    • The webhook endpoint accepts POST requests with this format:
    {
      "data": "Your question here",
      "session_id": "unique-user-id"
    }
    
  5. Integrate with Your Tools:

    • Connect the webhook to Slack, Teams, or your internal chat platform
    • Each user gets their own conversation history via session_id

How to customize

  • Change check frequency: Adjust polling interval in "Watch Company Docs Folder" from every minute to hourly or daily
  • Adjust chunk size: Modify the "Split into Searchable Chunks" node to change how documents are segmented
  • Increase context: Change topK parameter in "Search Company Documents" to retrieve more relevant sections
  • Extend memory: Adjust contextWindowLength in "Conversation History" to remember more previous messages
  • Switch AI model: Replace GPT-4 Mini with GPT-4 or other models based on your accuracy needs
  • Add filters: Modify the system prompt to focus on specific departments or document types
  • Custom responses: Update the system message in "Company Knowledge Assistant" to match your company's tone

Tips for best results

  • Use clear, descriptive file names for documents in Drive
  • Organize documents by department or topic in subfolders
  • Include FAQ documents with common questions and answers
  • Regularly update outdated documents to maintain accuracy
  • Monitor the assistant's responses and refine the system prompt as needed

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 2 - Watch Company Docs Folder

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 3 - Fetch New Document

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 4 - Store in Knowledge Base

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreInMemory - vectorStoreInMemory
Config choices
Version 1.3

Block 5 - Load Document Content

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 6 - Split into Searchable Chunks

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 7 - Generate Document Embeddings

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 8 - Company Knowledge Assistant

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 9 - Search Company Documents

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreInMemory - vectorStoreInMemory
Config choices
Version 1.3

Block 10 - Receive User Question

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 11 - Conversation History

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 12 - Send Answer to User

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 13 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow AI-powered company documents Q&A assistant with Google Drive and GPT-4 mini
Complexity advanced
Nodes 15
Categories Internal Wiki, AI RAG
Author Roshan Ramani
Published 18 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10947/10947.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does AI-powered company documents Q&A assistant with Google Drive and GPT-4 mini do?

Company Knowledge Base Assistant Who's it for This workflow is designed for companies looking to onboard new employees and interns efficiently. It's perfect for HR teams, team leaders, and organiza...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.