๐ง System Architecture โ
This assistant is built on top of n8n, using LangChain, Mistral Cloud, and Google Sheets to enable a natural-language-based finance tracker.
๐ Components โ
| Component | Purpose |
|---|---|
| Chat Trigger | Receives user messages |
| LangChain Agent | Parses intent and picks a tool |
| Mistral Cloud | Powers the LLM responses |
| Google Sheets | Stores all persistent expense data |
| Calculator Tool | Computes totals and averages |
| Chat Memory | Stores short-term chat history |
๐ Workflow Diagram โ
๐ง AI Prompt Strategy โ
The AI is instructed with a strict system prompt that:
- Describes the exact schema (
Date,Details,Category,Amount) - Lists accepted categories
- Forces confirmation before entry
- Bans hallucinated or assumed data
- Uses
Calculatoronly for math
โ๏ธ Tool Descriptions โ
Each tool node has a toolDescription configured like:
Add Expense: Append a row to sheet after confirmationGet Expense By Category: Return rows matching a categoryGet All Expense: Return all rowsCalculator: Only used when asked to compute totals/averages