Skip to content
GenAI Learn/Capstone: Designing Full GenAI Systems
Browsing as a guest. Sign in to save your progress and earn XP as you complete chapters.

Worked Example: Developer & Creator Tools

8 min read

You'll learn to

  • -Walk a full code assistant design end to end
  • -Walk a full content moderation system design end to end
  • -See a real two-stage funnel computation for high-recall, low-cost moderation

A code assistant needs to understand an entire repository, not just the file currently open, generate code that fits existing architecture and conventions, and pass the project's own tests. This is RAG and agency composed together, and the composition is the entire design.

Code Assistant: RAG Grounding Plus a Verification Loop

Retrieval here works exactly like Tier 8, with one specific adaptation: code chunking is not text chunking. Splitting by semantic unit, whole functions, whole classes, and always including a function's type signature and imports alongside its body, is what makes retrieved code actually usable. A function body without its type signature is close to useless context, since the model cannot correctly call something it cannot see the contract for.

Generation then runs through the exact sandboxed generate-execute-fix loop from Tier 9's sandboxed code execution chapter: generate code in context, run the project's real tests, and if they fail, feed the actual error back to the model and iterate, capped at a fixed number of attempts, same as every other iterative loop this course has built.

Content Moderator: A Real Two-Stage Funnel

A platform processing 500,000 posts an hour currently catches only 40% of policy violations, with a 15% false positive rate wrongly removing legitimate content. The target: 95%+ violations caught, under 3% false positives. Running every single post through a full LLM call would be prohibitively expensive at this volume, so the design has to be a funnel, not a single stage.

The two-stage moderation funnel, computed end to end

Read the output carefully. Only 6.8% of all traffic ever reaches the expensive LLM stage, and the final result comfortably clears both targets: 97% recall, well above 95%, and a 0.50% false positive rate, well under 3%. This is the entire argument for a funnel shape. Stage 1 is deliberately tuned toward high recall, casting a wide net and accepting some false alarms, precisely because stage 2 exists specifically to correct exactly that kind of mistake, at a cost the platform can actually afford.

Why Stage 1 Is Allowed to Be Wrong

This is the same precision-recall tradeoff from Phase 1's evaluation chapter, deliberately exploited on purpose. Stage 1's job is not to be right. Its job is to never let a real violation through, even at the cost of some false alarms, since stage 2 is specifically built to correct exactly that kind of mistake. Optimizing stage 1 for precision instead of recall would be a serious design error here, since a violation stage 1 misses never reaches stage 2 at all.

Interview Signal is part of Pro

See a real weak answer next to a real strong one for this exact topic.

Quiz is part of Pro

Test what you just read with a short quiz, and bank the XP.

Ready to Build This?

Build the Code Assistant and Content Moderator levels in the GenAI Lab.

ScaleDojo Logo
Initializing ScaleDojo