# Document analysis & chatbot creation with Llama and Gemini: n8n workflow

> Started by someone opening a chat with it, and works across Gmail and Pinecone. It puts Gemini behind a retrieval step, so answers are drawn from documents...

Source: https://millionrounds.com/workflow/document-analysis-and-chatbot-creation-with-llama-and-gemini (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Research and reporting](https://millionrounds.com/workflows?category=Research+and+reporting#library)

# Document analysis & chatbot creation with Llama and Gemini

Started by someone opening a chat with it, and works across Gmail and Pinecone. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 33 steps, 1 branch, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fdocument-analysis-and-chatbot-creation-with-llama-and-gemini)

**33 steps** Large: read it before trusting it with anything live

**1** Branch: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 2 Model 19 Logic 6 Service 6

The steps in the order they run, from what starts it.

- 1 **On form submission4** Form trigger *Starts it*
- 2 **Google Gemini Chat Model5** Lm Chat Google Gemini *Model*
- 3 **Google Gemini Chat Model6** Lm Chat Google Gemini *Model*
- 4 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 5 **Google Gemini Chat Model1** Lm Chat Google Gemini *Model*
- 6 **Embeddings Mistral Cloud** Embeddings Mistral Cloud *Model*
- 7 **Recursive Character Text Splitter** Text Splitter Recursive Character Text Splitter *Model*
- 8 **When chat message received** Chat trigger *Starts it*
- 9 **Google Gemini Chat Model2** Lm Chat Google Gemini *Model*
- 10 **Embeddings Mistral Cloud1** Embeddings Mistral Cloud *Model*
- 11 **Google Gemini Chat Model3** Lm Chat Google Gemini *Model*
- 12 **split the binary item** Code *Logic*
- 13 **Translator Agent** Agent *Model*
- 14 **Analyzer Agent** Agent *Model*
- 15 **AI Agent** Agent *Model*
- 16 **Information Extractor** Information Extractor *Model*
- 17 **Pinecone Vector Store** Vector Store Pinecone *Model*
- 18 **Default Data Loader** Document Default Data Loader *Model*
- 19 **Question and Answer Chain** Chain Retrieval Qa *Model*
- 20 **Pinecone Vector Store1** Vector Store Pinecone *Model*
- 21 **AI Agent1** Agent *Model*
- 22 **Loop Over Items1** Split In Batches *Logic*
- 23 **Convert to File4** Convert To File *Service*
- 24 **Markdown** Markdown *Logic*
- 25 **Vector Store Retriever** Retriever Vector Store *Model*
- 26 **Aggregate1** Aggregate *Logic*
- 27 **Parsing the document** Http Request *Service*
- 28 **Code** Code *Logic*
- 29 **Check the parsing status** Http Request *Service*
- 30 **Convert to File** Convert To File *Service*
- 31 **If2** If *Logic*
- 32 **Gmail** Gmail *Service*
- 33 **Provide the markdown** Http Request *Service*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 33, with 1 branch, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Pinecone
- **Model:** Gemini
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Gmail and Pinecone accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls Gemini. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 33 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 33 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fdocument-analysis-and-chatbot-creation-with-llama-and-gemini)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Pinecone](https://millionrounds.com/workflows?service=Pinecone#library)

## Workflows like it

Also research and reporting, with the same services where possible, closest in size first.

- [**Orchestrate sustainability lifecycle analytics with OpenAI** 33 steps · calls a model · Gmail, Slack](https://millionrounds.com/workflow/orchestrate-sustainability-lifecycle-analytics-with-openai)
- [**Weekly stock/ETF analysis with Claude and Gmail** 33 steps · Gmail, Google Sheets](https://millionrounds.com/workflow/weekly-stock-etf-analysis-with-claude-and-gmail)
- [**Customer feedback analysis with HTML** 34 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/customer-feedback-analysis-with-html)
- [**Extract & analyze competitor reviews with Firecrawl** 32 steps · calls a model · Gmail](https://millionrounds.com/workflow/extract-and-analyze-competitor-reviews-with-firecrawl)
- [**Generate professional reports from Excel/CSV with Gemini** 35 steps · calls a model · Gmail, in-memory vectors](https://millionrounds.com/workflow/generate-professional-reports-from-excel-csv-with-gemini)
- [**Reconcile bank transactions and generate reports with OpenAI** 31 steps · calls a model · Gmail](https://millionrounds.com/workflow/reconcile-bank-transactions-and-generate-reports-with-openai)
