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:
| Layer | Component | Free option | Job |
|---|---|---|---|
| Telephony | Gateway | WhatsApp Calling API (inbound free), Meta Cloud API | Receive calls/messages on a real business number |
| Speech | STT + TTS | Whisper (local), Edge TTS | Voice in, natural voice out |
| Brain | LLM | DeepSeek v4 flash (free API), Gemini free tiers | Reasoning, tool use, policy enforcement |
| Orchestration | Control plane | n8n community edition (self-hosted) | Webhooks, state, logging, retries, human handoff |
The complete call flow
- Customer calls the business WhatsApp number → Meta delivers WebRTC SDP offer to your webhook.
- Your n8n workflow accepts the call, streams audio to a local Whisper instance for transcription.
- Transcript + system prompt + knowledge base (Google Sheet) → DeepSeek free API.
- LLM decides: answer directly, call a tool (order lookup, booking), or escalate to human.
- Reply text → Edge TTS → audio stream back to caller via WebRTC.
- 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
- Hard-coded escalation triggers: refund requests, complaints, legal threats, 'human' keyword → instant human handoff.
- Unknown price rule: if price not in KB, bot says 'Let me check and get back to you' and creates a follow-up task.
- Response timeout: if LLM takes >3s, return a holding message and retry.
- Rate limits: max 20 calls/minute per number; excess queued with a polite wait message.
- PII scrubbing: phone numbers and names redacted from logs after 30 days unless flagged for review.
Observability you will actually use
| Metric | Target | Alert if |
|---|---|---|
| Call answer rate | 100% inbound | < 95% in any hour |
| End-to-end latency | < 2.5s median | > 4s p95 |
| Escalation rate | < 15% | > 25% (knowledge gap) |
| Hallucination catch | 0 in review | Any (review weekly) |
| Cost per call | $0 model cost | N/A — free tier |
Scaling from free tier to production volume
- Phase 1 (0-500 calls/month): Everything on free tiers. Single $5-10 VPS runs n8n + Whisper + TTS.
- 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.
- 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
- Webhook (Meta Cloud API + Calling API)
- HTTP Request (DeepSeek chat completions, Edge TTS)
- Execute Command (local Whisper CLI) or HTTP Request (Whisper API)
- Google Sheets (read KB, write logs)
- IF / Switch (escalation logic, human handoff)
- Wait (rate limiting, retry backoff)
- Error Workflow (catch-all -> alert + human handoff)
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

