§ case
PostMind AI
Jan 2025 — presentAI · Full Stack · Web Development · Engineer
- —A content-intelligence platform on a 6-agent Mastra pipeline (Persona Analyst → Onboarding → Trend Research → Content Generator, plus a live Persona Chat and an AI co-writer) that turns a user's own posts into personalized, on-voice content briefs.
- —A deterministic Writing-DNA engine extracts 15+ quantitative voice metrics at zero LLM cost with 100% reproducibility, feeding a recency-decayed feedback loop that learns from ratings and real post performance.
- —Provider-agnostic by design: every agent resolves its model through one factory, switchable between Google Gemini and Ollama Cloud by an env var, with structured JSON output enforced through four cheap-first fallback layers instead of schema-constrained decoding.
- —Trend intelligence fans out across Tavily, Hacker News, 60+ domain RSS feeds, and Google News with cross-source dedup and a two-tier cache.
- —Ships as a Turborepo monorepo — 11 RESTful API modules, 13 MongoDB collections, 3-tier rate limiting — alongside a Next.js 14 frontend with real-time chat and a 7-signal AI detector plus humanizer.
- —Docker image trimmed 2.66 GB → 338 MB (87%), deployed via SHA-tagged, health-check-gated CI/CD on a GCP instance.
Mastra AINext.js 14TypeScriptMongoDBTurborepoDockerGitHub ActionsSwaggerGoogle Cloud Platform (GCP)
◼ Challenges
- →Generate on-voice content that doesn't read as generic LLM output
- →Get reliable structured output from models that don't support schema-constrained decoding
- →Stay portable across hosted and self-hosted LLMs, and ship a production monorepo with safe rollouts
◼ Solutions
- →Deterministic Writing-DNA engine (15+ voice metrics, zero LLM cost) plus a recency-decayed feedback loop weighted by real post performance
- →Four-layer JSON enforcement — native JSON mode, prompt rule, local repair/normalize, one repair call — instead of handing the SDK a response schema
- →Provider-agnostic model factory (Gemini ↔ Ollama by env var); Docker image trimmed 2.66 GB → 338 MB (87%) with SHA-tagged, health-check-gated CI/CD
