# Dec 3rd, 2025: \[EN\] Build a Conversational Expense Assistant Using Elasticsearch Agent Builder with Telegram, n8n, and AWS Bedrock

**URL:** <https://discuss.elastic.co/t/dec-3rd-2025-en-build-a-conversational-expense-assistant-using-elasticsearch-agent-builder-with-telegram-n8n-and-aws-bedrock/383585>\
**Category:** Advent Calendar\
**Created:** [December 3, 2025, 8:00am UTC](https://discuss.elastic.co/t/dec-3rd-2025-en-build-a-conversational-expense-assistant-using-elasticsearch-agent-builder-with-telegram-n8n-and-aws-bedrock/383585 "2025-12-03T08:00:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_som](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/_som/32/138182_2.png) [@\_som](https://discuss.elastic.co/u/_som)\
**Post date:** [December 3, 2025, 8:00am UTC](https://discuss.elastic.co/t/dec-3rd-2025-en-build-a-conversational-expense-assistant-using-elasticsearch-agent-builder-with-telegram-n8n-and-aws-bedrock/383585/1 "2025-12-03T08:00:21Z")

</div>

![social-advent-2021-Day3](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a40b44d442bce5f264093d93650844e46168c20.png)

Ever wished you could _talk_ to your expense data?

Ask things like:

> - “How much did I spend last week?”
> - “Show my food expenses for the month.”
> - “Add yesterday’s dinner for 350 via credit card.”

This project turns those natural messages, even **voice notes** , into structured data and searchable insights using:

- **Telegram** as your chat UI
- **n8n** as the workflow orchestrator
- **AWS Bedrock (Claude 3.5 Sonnet)** used in this demo for intent classification, ingestion, and conversational query agents _(you can replace it with any LLM of your choice)_
- **Sarvam Speech-to-Text** used for voice transcription _(feel free to plug in Whisper, Deepgram, AssemblyAI, or something that is confortable.)_
- **Elasticsearch Agent Builder + MCP** handles storage, semantic search, and custom ES|QL function-calling tools.

Also, prepared a **single Colab notebook** that deploys the entire n8n workflow automatically, and it is temporary. For sustained n8n servers, please feel free to deploy it on your servers instead of Colab.

* * *

## What This System Does

- Converts **voice → text**

- Determines whether the message is:

- Ingests structured JSON into Elasticsearch with **semantic embeddings**

- Uses Agent Builder tools to run contextual ES|QL queries

- Sends friendly answers back in Telegram

- Handles low-confidence classification with an interactive clarification step

* * *

## n8n Architecture at a Glance

 ![n8n_architecture_for_expense_tool](https://us1.discourse-cdn.com/elastic/original/3X/a/6/a619f48f464065a216c4bd76b9f5cda6b4ff51b3.png)

**Flow:**

Telegram → n8n (STT → Classifier → Ingest/Query routing) → AWS Bedrock LLMs → Elasticsearch (index + semantic search using MCP) → Elastic Agent Builder tools → Telegram response

* * *

## Key Nodes/Components

### **n8n Workflow**

- Telegram Trigger

- Voice/Text switch

- STT request

- Classifier agent

- Ingestion agent

- Query agent via Agent Builder MCP

- Elasticsearch indexer

- Low-confidence gates

### **Elasticsearch**

- Enabling `semantic_text` field with Bedrock embeddings

- Clean index mapping (amount, merchant, category, ts/@timestamp, raw\_transcript.)

- Agent Builder tools built with ES|QL

### **AWS Bedrock**

- Claude 3.5 Sonnet v2 for:

- Intent classification

- Expense JSON extraction

- Query agent reasoning (function calling via MCP)

* * *

## Try It Yourself (One-Click Setup)

I packaged everything inside this Colab notebook:

**Colab:**

[https://colab.research.google.com/gist/someshwaranM/b5d21d51a6a9a9cc96e62b05c97ac203/som-expense-tool-colab.ipynb](https://colab.research.google.com/gist/someshwaranM/b5d21d51a6a9a9cc96e62b05c97ac203/som-expense-tool-colab.ipynb)

What the Colab does for you:

- Spins up **n8n** inside Colab for a Temporary setup.

- Exposes it to the internet via **Cloudflare Tunnel**

- Creates AWS, ES, Telegram credentials in n8n via API

- Installs the entire workflow template

- Sets up Elasticsearch:

- Bedrock inference endpoint

- Index mapping with `semantic_text`

- Provides a bulk ingest tool for your synthetic expense dataset

- Lets you start chatting with your bot immediately from **Telegram**.

* * *

## Demo Screenshots

- Telegram conversation

 ![telegram_conversation_in_bot](https://us1.discourse-cdn.com/elastic/original/3X/c/6/c6cfb04edb1e4798c6f651cda7a480c7e6e7835e.jpeg)

- Agent Builder (Direct Conversation)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/0/5095888ed6b3cca3f78a33f124b39e1f9df152eb.png)

- Elastic Agent Builder Youtube Video

[![](https://us1.discourse-cdn.com/elastic/original/3X/5/1/513db9ca13ee3b76b222733fb57e221f3ab004de.jpeg "Build Expense Tracker using Elastic Agent Builder! (Explained in 165 Secs)") ](https://www.youtube.com/watch?v=ZBS9GHADrXI)

* * *

## Wrap-Up

This stack gives you:

- A conversational personal finance assistant

- Full semantic + structured search using Elastic Agent Builder

- Real-time ingestion from chat or voice

* * *
