How to Build an AI Agent With n8n, FreeModel and Abacus AI — 2026 Step-by-Step Guide
Build an AI Agent With n8n, FreeModel and Abacus AI — 2026 Step-by-Step Guide
Connect three powerful tools into one autonomous Telegram AI assistant. Free API access, visual workflow automation, and 100+ premium LLMs — all for under $20/month.
Start Building →This tutorial is part of AIGetFree's hands-on automation series. If you're new to n8n, start with our n8n Review 2026 for platform context. For the full AI agent stack without the tutorial, see our Ultimate AI Agent Stack. Already comfortable with APIs? Jump straight to FreeModel Review for API details.
The short version: You'll build a Telegram bot that uses FreeModel for simple queries (free), Abacus AI for complex reasoning ($10/mo), and n8n to orchestrate everything visually — no code required. Total cost: $15-20/month including hosting.
What You Will Build
A fully autonomous Telegram AI assistant that intelligently routes requests between free and premium AI models, searches the web for current information, and remembers conversation context — all orchestrated visually in n8n.
Telegram Trigger
Receives user messages via Telegram Bot API in real time.
Smart Routing
Simple queries → FreeModel (free). Complex tasks → Abacus AI (premium).
Web Search
Searches the web for current information when needed.
Conversation Memory
Remembers the last 10 messages per chat using n8n memory nodes.
Formatted Replies
Sends structured, helpful answers back to the user via Telegram.
Near-Zero Cost
Entire stack runs for $15–20/month including VPS hosting.
Total monthly cost: FreeModel API is free. n8n Community Edition is free. Telegram Bot API is free. Abacus AI adds $10/month for premium models. A $5–10 VPS covers hosting. Total: $15–20/month vs $80–160+ for traditional alternatives.
Prerequisites: What You Need Before Starting
n8n Installed and Running FREE
Use the self-hosted Community Edition via Docker (free, unlimited executions).
FreeModel API Key FREE — No Card Required
Sign up at freemodel.dev. After verification, you receive free API credits. Two endpoints: api.freemodel.dev (GPT-style) and cc.freemodel.dev (Claude-style).
Abacus AI Account $10/month — Optional
Sign up at chatllm.abacus.ai. 100+ premium models: GPT-5.6 Sol, Claude Sonnet 5, Gemini 3.1 Pro, Grok 4.5.
Telegram Bot Token FREE
Message @BotFather on Telegram → send /newbot → follow instructions. You will receive a bot token.
Part 1: AI Agents vs Regular Workflows
Regular Workflow
Follows a fixed path you define: if X happens, do Y. Every branch must be anticipated and built manually. Works well for structured tasks — syncing spreadsheets, sending emails, posting Slack messages.
AI Agent
Understands a goal and figures out the steps itself. You give it a task description and a set of tools. It decides which tools to call, in what order, and how many times — looping internally until the task is complete.
The ReAct Loop — How n8n's AI Agent Thinks
n8n's AI Agent node uses the ReAct (Reasoning and Acting) framework. This loop runs inside the node — you do not wire it up manually.
Input
User message received
Thought
Model reasons about task
Action
Selects and calls a tool
Observation
Reads the tool result
Final Answer
Enough info → respond
Part 2: Setting Up Your Credentials in n8n
Go to Settings → Credentials → New Credential in n8n. Create three credentials:
🔑 FreeModel GPT FREE
🚀 Abacus AI $10/mo
✈️ Telegram Bot FREE
Part 3: Building the AI Agent Workflow
Create a new workflow in n8n. Add nodes in this order:
Telegram Trigger
Listens for messages
AI Agent Node
Brain of the workflow
Telegram Send
Returns response
Telegram Trigger Node
Add a Telegram Trigger node. Select your Telegram credential. Set "Updates" to message. This fires every time a user sends a message to your bot.
AI Agent Node — Chat Model Sub-nodes
Add an AI Agent node. Inside it, add two Chat Model sub-nodes:
- Sub-node A — FreeModel GPT-5.5: Select "OpenAI Chat Model" → choose "FreeModel GPT" credential → set Model to auto. This is your free everyday model.
- Sub-node B — Abacus AI Premium: Select "OpenAI Chat Model" → choose "Abacus AI" credential → set Model to GPT-5.6 Sol or Claude Sonnet 5. This handles complex reasoning.
Memory Sub-node — Window Buffer Memory
Add a Window Buffer Memory sub-node: Session ID = {{ $json.chatId }} (unique per chat), Context Window Length = 10 (remembers last 10 messages).
Tool Sub-nodes — Web Search and HTTP Request
Add tool sub-nodes: Web Search (SerpAPI or Google Search) for current information, and HTTP Request (GET, dynamic URL) for fetching data from any API.
Telegram Send Message Node
Add after the AI Agent: Chat ID = {{ $json.chatId }}, Text = {{ $json.output }} (the agent's final answer).
Part 4: Configuring the Agent's System Prompt
In the AI Agent node, paste this into the System Message field:
Part 5: Testing Your Agent
Click Test Workflow in n8n. Open Telegram and send these test messages:
Part 6: Advanced Patterns — Taking It Further
Vector Store RAG
Add Pinecone or Qdrant as a tool. Upload your docs, FAQs, or knowledge base. Agent answers from your specific content.
Human-in-the-Loop
Insert a Switch node. Low-confidence answers route to an admin Telegram chat for review before sending to the user.
Multi-Agent System
Separate agents for Research, Code, and Support. Route incoming messages to the right specialist agent based on content.
Logging and Analytics
Add Google Sheets nodes to log every conversation. Track usage, response quality, and routing decisions over time.
Multi-Channel Output
Add Gmail, Slack, and Notion nodes. The same agent can respond via Telegram, email, and Slack simultaneously.
Scheduled Agents
Replace the Telegram Trigger with a Schedule Trigger. Run your agent automatically every hour, day, or week.
Part 7: Cost Analysis — Why This Stack Wins
| Component | Our Stack | Traditional Alternative | Our Cost | Traditional Cost |
|---|---|---|---|---|
| Automation Platform | n8n Community (self-hosted) | Zapier Professional | $0 | $19.99+/mo |
| AI API (Simple queries) | FreeModel API | OpenAI API (pay per token) | $0 | $20–100+/mo |
| AI API (Complex queries) | Abacus AI | ChatGPT Plus + Claude Pro | $10/mo | $40/mo |
| Telegram Bot API | Telegram (free) | — | $0 | $0 |
| Hosting / VPS | Your VPS or homelab | Cloud-hosted alternatives | $5–10/mo | $0 |
| TOTAL | n8n + FreeModel + Abacus AI | Zapier + OpenAI + ChatGPT/Claude | $15–20/mo | $80–160+/mo |
Frequently Asked Questions
Do I need to know how to code?
No. This entire tutorial uses n8n's visual node editor — drag, drop, connect, and configure with dropdown menus and text fields. The only "code" you write is the system prompt, which is plain English instructions.
Is FreeModel really free?
Yes. FreeModel provides free API credits after account verification. No credit card is required. For moderate usage (hundreds of queries per day), the free tier is sufficient. See our full FreeModel review for details.
Why use both FreeModel and Abacus AI?
FreeModel is free and handles simple queries perfectly. Abacus AI gives you access to 100+ premium models for $10/month. Using both gives you zero cost for everyday tasks and premium power when you need it.
Can I run this on a Raspberry Pi?
Yes. n8n runs on any Linux system with Docker, including Raspberry Pi 4 or 5. The heavy AI lifting happens on FreeModel's and Abacus AI's servers — your Pi just orchestrates the workflow.
What if FreeModel is rate-limited or unavailable?
n8n's AI Agent node can be configured with fallback models. If FreeModel returns an error, the agent automatically switches to Abacus AI or another provider.
Can I use this for commercial projects?
Yes. The entire stack is production-ready. n8n's fair-code license allows commercial use. FreeModel and Abacus AI are designed for production workloads.
Final Verdict: Is This Stack Worth Building?
This n8n + FreeModel + Abacus AI stack is the most cost-effective way to build AI agents in 2026. Visual workflow automation, free API access for everyday tasks, and premium model access for complex work — all for the price of a VPS and a $10/month subscription.
The learning curve is real — expect a weekend to get comfortable with n8n's interface and debug your first agent. But once it clicks, you have a platform that can automate almost anything: Telegram bots, customer support agents, content pipelines, lead qualification systems — all powered by the same three tools.
The Bottom Line
The verdict is clear — this is the approach that delivers the best results for the lowest cost.
Start here, follow the steps, and you'll have a working solution before the coffee gets cold.
Related Posts
You close the tab and put the knowledge to work.
