Tutorials

How to Build a Production AI Agent Stack in 2026: The Complete Architecture (Free Tier Edition)

By ·2026-08-10·📖 11 min read
How to Build a Production AI Agent Stack in 2026: The Complete Architecture (Free Tier Edition)

What this stack actually does

This is not a toy. We run this exact architecture in production for an AI voice receptionist that answers WhatsApp and phone calls 24/7, handles bookings, looks up orders, and escalates to humans when needed — all on a $0 model bill. The stack has four layers:

LayerComponentFree optionJob
TelephonyGatewayWhatsApp Calling API (inbound free), Meta Cloud APIReceive calls/messages on a real business number
SpeechSTT + TTSWhisper (local), Edge TTSVoice in, natural voice out
BrainLLMDeepSeek v4 flash (free API), Gemini free tiersReasoning, tool use, policy enforcement
OrchestrationControl planen8n community edition (self-hosted)Webhooks, state, logging, retries, human handoff

The complete call flow

  1. Customer calls the business WhatsApp number → Meta delivers WebRTC SDP offer to your webhook.
  2. Your n8n workflow accepts the call, streams audio to a local Whisper instance for transcription.
  3. Transcript + system prompt + knowledge base (Google Sheet) → DeepSeek free API.
  4. LLM decides: answer directly, call a tool (order lookup, booking), or escalate to human.
  5. Reply text → Edge TTS → audio stream back to caller via WebRTC.
  6. Full transcript, decision trace, and outcome logged to Google Sheets for review.

The system prompt that prevents hallucination

The single most important file in the stack is the system prompt. Ours fits on one page and contains three non-negotiable sections:

You are the AI receptionist for [Business]. Answer ONLY using the knowledge base below. If the answer is not there, say: 'I will connect you with a team member who can help.' NEVER invent prices, hours, policies, or availability. If the caller says 'human', 'agent', 'representative', or 'operator', immediately respond: 'Connecting you now.'

The knowledge base lives in a Google Sheet with tabs: FAQ, Pricing, Hours, Policies, EscalationRules. n8n reads only the matching rows per query — the LLM never sees the whole sheet.

Guardrails that keep the bot from embarrassing you

Observability you will actually use

MetricTargetAlert if
Call answer rate100% inbound< 95% in any hour
End-to-end latency< 2.5s median> 4s p95
Escalation rate< 15%> 25% (knowledge gap)
Hallucination catch0 in reviewAny (review weekly)
Cost per call$0 model costN/A — free tier

Scaling from free tier to production volume

  1. Phase 1 (0-500 calls/month): Everything on free tiers. Single $5-10 VPS runs n8n + Whisper + TTS.
  2. Phase 2 (500-5000 calls/month): Add Redis queue for async processing; move Whisper to a dedicated GPU instance ($0.50/hr spot); keep LLM on free tier with retry/fallback logic.
  3. Phase 3 (5000+ calls/month): Dedicated inference (self-hosted vLLM or fixed-price provider); multi-region n8n; SLA monitoring; dedicated support rotation.

The exact n8n nodes you need

Rule of thumb: if a business misses 5+ calls a day, this stack pays for itself in week one. The free-tier version is production-ready — we ran it for months before adding a single paid component.

Get it built for your business

Want this stack deployed on your number this week? We build, host, and maintain production AI agents for businesses.

Chat on WhatsApp
AP

Independent AI & technology publication — research and verification driven. Read the editorial policy.

Related reading