- workflows/LLM_wiki.en.json: English, credentials/IDs scrubbed for template submission - templates/SUBMISSION.md: title, description and checklist for n8n.io Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4.8 KiB
n8n Template Submission — LLM Wiki
Workflow file to submit: workflows/LLM_wiki.en.json
Submit at: https://n8n.io/creators/ → Submit a workflow (you must be signed in to your n8n.io creator account).
Title
LLM Wiki: pre-compiled RAG with an AI editor, using Google Docs & Sheets
Short description (one-liner)
A different take on RAG: instead of embedding-and-retrieve, an LLM acts as a "wiki editor" that reads, rewrites and cross-links your documents into a structured knowledge base — then answers questions by looking things up in an index, like a human would.
Full description
This workflow implements Andrej Karpathy's LLM Wiki idea in n8n, using tools everyone already has — Google Docs for the wiki pages and Google Sheets as the index. No vector database required.
The idea — "pre-compile" instead of "embed-and-retrieve"
Traditional RAG shreds your documents into chunks, embeds them, and at query time pulls a few chunks for the LLM to read. The model only ever sees those fragments — it has no global view.
LLM Wiki does the opposite. It pre-compiles your raw material: the LLM reads everything and, like a Wikipedia editor, organizes, rewrites and cross-links it into clean wiki pages. To find an answer it first consults an index (just like a person looking something up), then reads the relevant page. The result is a curated knowledge base, not an ever-growing knowledge warehouse — similar material gets updated into existing pages rather than piled up as new chunks.
| Classic vector RAG | LLM Wiki (this template) | |
|---|---|---|
| Ingestion | chunk → embed → store vectors | LLM reads → rewrites → wiki page |
| Retrieval | vector similarity | look up the index |
| Growth | unbounded (warehouse) | curated, updated in place (library) |
| Source docs | shredded directly | kept as single source of truth |
What's inside
The workflow has two independent flows:
- Ingest (write). A form upload (
.md/.txt) feeds an AI Agent ("knowledge-writing assistant"). It always reads the index first, splits the upload into topics, then for each topic either appends to an existing Google Doc and updates the index, or creates a new Doc and adds an index row. - Query (read). A chat trigger feeds an AI Agent ("knowledge-query assistant") that browses the index, picks the most relevant page(s), reads them, and answers — read-only, grounded in the wiki.
Tools used by the agents
get_indexs— read the index sheet (topic, doc_id, keywords, summary)create_wiki_page— create a new Google Doc (via an HTTP call to a tiny companion sub-workflow, because the Docs node can't create a file directly inside a target folder)write_wiki/update_wiki— append/update a wiki Docwrite_index— add a new index rowread_wiki— read a wiki Doc's full text
Companion sub-workflow. This template needs a small second workflow (
create_wiki_page) that creates a Doc and moves it into your wiki folder, exposed as a webhook. It's included in the GitHub repo linked below.
Setup
- Import the workflow.
- Create a Google Sheet for the index with columns:
topic,doc_id,keywords,summary,last_updated. Point theget_indexs/write_indexnodes at it (replace theYOUR_INDEX_SHEET_IDplaceholder). - Import the companion
create_wiki_pagesub-workflow and set its target folder; put its webhook URL into thecreate_wiki_pageHTTP node (replaceYOUR-N8N-HOST/...). - Attach your own credentials to the Google Sheets / Docs nodes and your LLM node (this template uses Google Gemini; swap in any chat model).
- Activate, upload a doc, then ask a question in the chat trigger.
Notes & credits
- This burns more tokens than vector RAG (the LLM actually reads and rewrites your material) — but the curation quality is the point.
- Concept by Andrej Karpathy (original gist). This template just swaps Obsidian for Google Docs + Sheets so anyone can run it.
- Full repo, the companion sub-workflow, a sample index and a sample wiki page: https://github.com/uncle6me-web/LLM-Wiki-for-n8n
Suggested categories / tags
AI, RAG, Agent, Google Docs, Google Sheets, Knowledge Base, Gemini
Pre-submission checklist
- All user-facing strings translated to English
- Credentials removed (importers attach their own)
- Personal Sheet ID replaced with
YOUR_INDEX_SHEET_ID - Personal n8n webhook URL replaced with
YOUR-N8N-HOST/... - Instance metadata (
id,versionId,webhookId,tags,pinData) cleared - Companion
create_wiki_pagesub-workflow imported & its webhook URL filled in - Tested end-to-end on your own n8n before submitting