AutomatedReality, home

Build a Free Local AI Personal Assistant with Ollama

Overview & Architecture

This blueprint turns a Telegram bot into a personal assistant that runs on your own hardware. Send it a PDF, another document, or a photo of printed text with a question, and it answers from the file. Send no file and just ask about one (“Please summarize my terms of service document”), and it looks for that file in a Google Drive folder.

Every file goes through a self-hosted Apache Tika container, which extracts the text (with OCR for photos). An n8n AI Agent node then answers with a local Ollama model and remembers the last few messages in the chat, so follow-up questions work. The bot only responds to your own Telegram chat ID.

The model and the text extraction stay on your own machine. Telegram carries the messages and Google Drive stores the files.

The Pipeline

  1. Telegram Message: A Telegram Trigger receives messages from one bot and only accepts the owner’s chat ID.
  2. File Attached?: If the message has a document or a photo, it is downloaded from Telegram. The caption is the question; with no caption the assistant summarizes the file.
  3. Extract File Search Term: With no attachment, a small Ollama step pulls one to three keywords out of the message, so “Please summarize my terms of service document” becomes “terms service”.
  4. Search Drive Folder: n8n searches one Google Drive folder for a file whose name contains those keywords and downloads the first match. Google Docs and Slides are exported to PDF, Sheets to CSV.
  5. Extract Text With Tika: Every file is sent to Apache Tika (full image, with OCR) at http://tika:9998, and the text is trimmed to about 12,000 characters.
  6. Personal Assistant: An AI Agent node runs Ollama with qwen2.5:14b-instruct-q5_K_M and a window memory of the last 6 messages, keyed by Telegram chat ID. If no file was attached and nothing matched, it says so and answers from the message alone.
  7. Reply in Telegram: The answer is escaped for Telegram’s HTML formatting and sent back to the same chat.

What You Need

Key Deployment Hurdles & Solutions

Download the Workflow (.json)

Import-ready n8n workflow with all 16 nodes. In n8n choose Import from file, attach your own Telegram, Google Drive and Ollama credentials, then replace YOUR_TELEGRAM_CHAT_ID in the Telegram Message trigger and YOUR_GOOGLE_DRIVE_FOLDER_ID in Search Drive Folder, and publish the workflow.

Download the n8n workflow (.json)

Download the Companion System Prompt (.md)

Enter your first name to personalize the assistant prompt so your AI helper can walk you through the Telegram, Google Drive, Tika, Ollama and n8n setup step by step. Add your email optionally to get notified when new home lab blueprints drop.