How I Built JobNinjas.ai: AI Platform Architecture
By Sairam Kumar Reddy Veereddy · Creator & Lead AI Engineer
Shipping a modern generative AI product solo is no longer just about calling an LLM endpoint. Production readiness requires authentication, transactional messaging, document storage, vector databases, background event orchestration, latency-sensitive voice streaming, and cost control.
I designed and launched JobNinjas.ai entirely on my own. In this article, I outline the full architectural blueprint: how AWS cloud primitives, a FastAPI microservice backend, LangChain RAG agents, 8 production n8n workflows, and real-time WebRTC voice interact to create a resilient user experience.
High-Level System Topology
The platform separates concerns into four clear tiers:
- Client & Voice Interface: WebRTC streaming audio combined with responsive frontend components.
- Core API & Intelligence Gateway: Python FastAPI deployed on AWS ECS containers with Cognito JWT validation.
- Retrieval & Agent Tier: LangChain and LangGraph coordination with ChromaDB vector indices.
- Asynchronous Automation Cluster: 8 multi-step n8n workflows handling document processing, user notifications, and CRM sync.
flowchart TD
subgraph Client [Client Tier]
UI[Web UI]
Voice[WebRTC Voice Channel]
end
subgraph AWS [AWS Cloud Infrastructure]
Cognito[AWS Cognito Auth]
S3[AWS S3 Document Lake]
RDS[(AWS RDS PostgreSQL)]
SES[AWS SES Email Gateway]
end
subgraph Backend [FastAPI Backend]
API[FastAPI Router]
RAG[LangChain RAG Agent]
Chroma[(ChromaDB Vector Store)]
end
subgraph Automations [Automation Tier]
n8nCluster[8 n8n Production Workflows]
end
subgraph VoiceEngine [Speech Tier]
Vapi[Vapi Realtime Engine]
Whisper[Faster-Whisper STT]
end
UI --> Cognito
UI --> API
Voice <--> Vapi
Vapi <--> Whisper
Vapi <--> API
API --> RDS
API --> S3
API --> RAG
RAG --> Chroma
API -->|Webhooks| n8nCluster
n8nCluster --> SES
n8nCluster --> RDS
FastAPI Backend & Asynchronous Tool Execution
We chose FastAPI because native Python asynchronous support (asyncio) allows high concurrency
without blocking thread pools during external LLM and vector store calls:
from fastapi import APIRouter, Depends, HTTPException, BackgroundTasks
from langchain.chains import RetrievalQA
from core.auth import get_current_user_cognito
from services.rag_engine import job_rag_agent
router = APIRouter(prefix="/api/v1/dossier", tags=["Dossier RAG"])
@router.post("/adapt-bullet")
async def adapt_resume_bullet(
bullet_req: BulletAdaptationRequest,
background_tasks: BackgroundTasks,
user: dict = Depends(get_current_user_cognito)
):
"""Adapt experience bullet point against target job description with RAG citations."""
try:
adapted_content = await job_rag_agent.aexecute_bullet_adaptation(
user_id=user["sub"],
raw_experience=bullet_req.bullet_text,
target_role=bullet_req.target_job_title
)
# Dispatch background event to n8n for user analytics and logging
background_tasks.add_task(
dispatch_n8n_event,
event_type="bullet_adaptation_completed",
payload={"user_id": user["sub"], "tokens": adapted_content.token_usage}
)
return adapted_content
except Exception as exc:
raise HTTPException(status_code=500, detail=str(exc))
Why 8 n8n Workflows? (Separation of Synchronous vs Asynchronous Work)
A common anti-pattern in early AI projects is cramming background tasks—email delivery, document chunking, CRM updates, and PDF rendering—directly into API endpoints. This inflates API latency and causes HTTP timeouts.
In JobNinjas.ai, I delegated these jobs to 8 independent n8n workflows:
- Document Ingestion & OCR: Normalizes uploaded PDFs from S3 and chunks text for embedding.
- Vector Index Refresher: Re-indexes ChromaDB embeddings when a user updates their profile.
- Welcome & Onboarding Sequence: Dispatches personalized emails via AWS SES.
- Interview Analytics Compiler: Gathers Vapi voice logs and formats a strengths-and-weaknesses report.
- Daily Job Match Alert: Queries indexed job feeds and matches candidates based on semantic distance.
- Billing & Subscription Lifecycle: Processes Stripe webhook events and updates AWS RDS entitlements.
- Dead Letter Queue Auditor: Retries failed external API calls with exponential backoff.
- System Observability Alert: Sends automated Slack notifications on API latency spikes.
Real-Time Voice Architecture with WebRTC
For realistic mock interviews, standard HTTP audio requests feel disjointed due to 3-second latency lags. JobNinjas.ai implements WebRTC audio streams connecting directly to a Vapi voice bridge running Faster-Whisper for transcription and low-latency neural speech synthesis. Conversational turnarounds average under 750 milliseconds, providing an experience that feels remarkably human.