Build a Gemini-style Guided Learning Bot for Developer Onboarding
AIEducationProductivity

Build a Gemini-style Guided Learning Bot for Developer Onboarding

UUnknown
2026-03-01
10 min read
Advertisement

Build a personalized onboarding bot that auto-generates lesson plans, quizzes, and progress tracking using LLMs and RAG. Clone the starter kit and iterate.

Hook: stop wasting onboarding weeks — automate developer ramp-up with a guided-learning bot

New hires hit the codebase and face a maze: scattered docs, outdated tutorials, and inconsistent mentorship. What if a guided-learning chatbot could curate a personalized curriculum, generate runnable lessons and quizzes, and track progress automatically? In 2026, with mature LLMs, compact vector stores, and server-side function calling, building that experience is practical and secure.

What you'll build (the elevator pitch)

This walkthrough shows how to build a Gemini-style guided learning bot for developer onboarding: an LLM-backed chat interface that creates automated lesson plans, generates quizzes, stores canonical resources in a vector index (RAG), tracks user progress, and offers auto-graded runnable examples. Code snippets are runnable and framework-agnostic — the sample project uses Node.js + PostgreSQL (pgvector) + a simple React frontend.

Architecture overview

At a glance, the system contains five components:

  • Chat + LLM layer: a prompt-engineered interface to a capable LLM with function calling and streaming support.
  • RAG/content store: vector DB (pgvector, Milvus, or Pinecone) for company docs, code samples, and canonical tutorials.
  • Curriculum generator: server-side service that converts role/level goals into lesson plans and quizzes.
  • Progress tracker: relational DB tables for users, lessons, completion states, and spaced-repetition schedules.
  • Frontend: chat UI and a progress dashboard with runnable sandboxes for code exercises.

By 2026, these assumptions hold: LLMs are fast, support streaming and function calls, vector search is a first-class retrieval pattern, and it's common to run open-weight models on-prem or use encrypted API endpoints for sensitive repos. Prefer modular services, keep PII and secret code in private vector stores, and design for safe code execution (sandboxing / containerization).

Step-by-step implementation

1) Project scaffold (quick start)

Tech choices in this tutorial: Node.js (TypeScript), Express API, PostgreSQL with pgvector, and a React client. You can swap any LLM provider — the prompts and payloads remain similar.

// Initialize project
mkdir guided-onboarding && cd guided-onboarding
npm init -y
npm i express pg pg-hstore sequelize pgvector axios dotenv
npm i -D typescript ts-node-dev @types/express

2) LLM integration & prompt engineering

Build a small service that asks the LLM to generate lesson plans and quizzes. Use a structured JSON output spec in the prompt — that reduces post-processing and makes auto-grading easier.

// src/llm.ts (simplified)
import axios from 'axios';
import dotenv from 'dotenv';
dotenv.config();

const API_URL = process.env.LLM_API_URL; // e.g. https://api.your-llm
const API_KEY = process.env.LLM_API_KEY;

export async function generateLessonPlan({role, level, durationHours}){
  const prompt = `You are a senior engineering mentor. Produce a JSON lesson plan for a new ${role} at ${level} level. Output must be valid JSON with keys: title, description, lessons (array of {id, title, objectives, estimate_mins, exercises}), references (array). Max total duration: ${durationHours} hours.`;

  const resp = await axios.post(API_URL + '/v1/generate', {
    prompt,
    max_tokens: 800,
    format: 'json'
  }, { headers: { 'Authorization': `Bearer ${API_KEY}` } });

  return resp.data; // expected: parsed JSON lesson plan
}

Prompt tips: ask for machine-parseable outputs, include constraints (time budget, company stack), and request test-case-ready exercises when you want auto-grading.

3) Content store & RAG (pgvector + embeddings)

Store internal docs (architecture notes, design decisions, example code) as embeddings. When the LLM needs to ground advice in company context, run a vector similarity search and pass high-relevance hits into the prompt.

// SQL: add pgvector extension and a table
CREATE EXTENSION IF NOT EXISTS vector;

CREATE TABLE docs (
  id SERIAL PRIMARY KEY,
  title TEXT,
  content TEXT,
  embedding vector(1536)
);

-- Upsert example (Node.js)
import { Client } from 'pg';
const client = new Client({ connectionString: process.env.DATABASE_URL });
await client.connect();

const insertDoc = async (title, content, emb) => {
  await client.query(`INSERT INTO docs (title, content, embedding) VALUES ($1,$2,$3)`, [title, content, emb]);
};

Use your LLM provider's embedding endpoint to generate embeddings (1536 dims common). For retrieval, use ORDER BY embedding <-> query_embedding LIMIT 5 to get top hits.

4) Progress tracking schema

Minimal schema to start: users, lesson_plans, lessons, progress. Track timestamps for completion, attempt counts, and an optional spaced-repetition score.

// SQL schema (simplified)
CREATE TABLE users (
  id UUID PRIMARY KEY,
  email TEXT,
  name TEXT
);

CREATE TABLE lesson_plans (
  id UUID PRIMARY KEY,
  title TEXT,
  meta JSONB
);

CREATE TABLE lessons (
  id UUID PRIMARY KEY,
  plan_id UUID REFERENCES lesson_plans(id),
  title TEXT,
  content JSONB
);

CREATE TABLE progress (
  user_id UUID REFERENCES users(id),
  lesson_id UUID REFERENCES lessons(id),
  status TEXT, -- 'not_started'|'in_progress'|'completed'
  score NUMERIC,
  updated_at TIMESTAMP DEFAULT now(),
  PRIMARY KEY (user_id, lesson_id)
);

API endpoints: /api/plans (POST to create plan via LLM), /api/users/:id/progress, /api/lessons/:id/complete (mark complete).

5) Quiz generation and auto-grading

Ask the LLM to emit quizzes in JSON: multiple-choice questions, coding tasks with test cases, or short answers. For code exercises, include unit tests the grader can run in a sandbox container.

// Example prompt snippet for quiz generation
"Generate 5 multiple-choice questions about React hooks for mid-level engineers. Output JSON array: [{id, question, choices:[...], answer_index}]."

// Example generated quiz entry
{
  "id": "q1",
  "question": "Which hook should you use to update local state based on props?",
  "choices": ["useEffect","useMemo","useState","useCallback"],
  "answer_index": 0
}

Auto-grading multiple-choice is trivial. For coding tasks, prefer test-driven exercises where the LLM supplies both the problem and the canonical unit tests. Run tests in a strict sandbox — Node's vm2, Firecracker microVMs, or ephemeral Docker containers are viable options. Always limit CPU, memory, and network.

// Simplified Node auto-grader for JS using vm2 (exercise only — audit before production)
import { NodeVM } from 'vm2';

function runCodeAndTests(userCode, testsCode) {
  const vm = new NodeVM({ timeout: 2000, sandbox: {} });
  try {
    vm.run(userCode + '\n' + testsCode);
    return { success: true };
  } catch (err) {
    return { success: false, error: err.message };
  }
}

Security note: vm2 is not bulletproof. For production, use isolated containers (Firecracker/Wasmtime) and do not allow network or host filesystem access.

6) Frontend: chat UI + progress dashboard

Build a React chat that streams LLM responses, shows suggested lessons, and displays a progress bar. When a lesson contains a code exercise, present a runnable editor pane that hits your auto-grader API.

// React pseudo-code for marking completion
async function markComplete(userId, lessonId){
  await fetch(`/api/users/${userId}/lessons/${lessonId}/complete`, { method: 'POST' });
  // refresh progress
}

7) Adaptivity & spaced repetition

Use progress metadata to schedule next lessons: if a user struggles on quizzes, the bot should insert remediation lessons. Basic algorithm: if score < 70%, schedule a 30-minute remediation within 24 hours; otherwise unlock the next lesson. For long-term retention, integrate a spaced repetition score and bump lessons based on recall intervals.

Complete example: Generate a lesson plan + quiz

Here's a minimal end-to-end Node handler that asks the LLM for a lesson plan and stores the result.

// src/api/plans.ts (Express handler)
import express from 'express';
import { generateLessonPlan } from '../llm';
import { v4 as uuid } from 'uuid';

const router = express.Router();

router.post('/', async (req, res) => {
  const { role, level, durationHours, userId } = req.body;
  const plan = await generateLessonPlan({ role, level, durationHours });

  // assume plan is already JSON with lessons
  const planId = uuid();
  // persist plan and lessons into DB (pseudo)
  await db.insert('lesson_plans', { id: planId, title: plan.title, meta: plan.meta });
  for (const lesson of plan.lessons) {
    await db.insert('lessons', { id: uuid(), plan_id: planId, title: lesson.title, content: lesson });
  }

  res.json({ planId, plan });
});

export default router;

Prompt engineering patterns that work in 2026

  • JSON-first prompts: Require machine-parseable JSON output and a clear schema to avoid hallucinations.
  • RAG context windows: Always prepend top-3 vector matches (company docs, codebase snippets) and indicate provenance.
  • Function calling for determinism: Where possible, use the LLM's function-calling feature to get structured results you can trust.
  • Progress-aware prompts: Supply user progress and recent quiz performance so the bot personalizes the next lesson.
"In 2026 the best onboarding bots are retrieval-augmented, stateful, and explicitly self-checking — they prove a concept with tests, not just suggestions."

Security, privacy, and compliance

Protect private code and PII by keeping embeddings and RAG data in private, access-controlled vector stores. Encrypt at rest and in transit. Use on-prem LLMs for especially sensitive code. For auto-grading, execute code in isolated environments and limit resource usage. Log minimal metadata and give users control over their learning data.

Operational considerations

  • Use batching for embedding/upsert to the vector store.
  • Cache LLM-generated lesson plans for reproducibility and auditing.
  • Rate-limit LLM calls per user; generate heavy artifacts (quizzes + tests) asynchronously.
  • Instrument metrics: time-to-first-complete, average quiz score, and lesson drop-off points.

Advanced strategies and future-proofing (2026+)

Consider these advanced moves:

  • Multimodal lessons: include architecture diagrams, short screencasts, or dataflow images generated by the model and stored in your content store.
  • Tool integrations: call internal APIs to provision ephemeral sandboxes or link to CI jobs for integration tests as part of a lesson.
  • Model ensembles: combine an open-weight model on-prem for code synthesis with a commercial LLM for higher-level planning and safety checks.
  • Auto-curation: periodically re-run plans through an LLM to keep lessons up to date with repo changes (detect stale references using code search).

Checklist: From zero to an MVP

  1. Choose LLM provider and decide on on-prem vs hosted.
  2. Set up PostgreSQL + pgvector or a managed vector DB.
  3. Implement generator microservice with JSON schema outputs.
  4. Implement progress schema and endpoints for start/complete.
  5. Build a simple React chat that streams LLM answers and lists lessons.
  6. Implement a safe auto-grader for MCQs and sandboxed code tasks.
  7. Instrument analytics and iterate on prompt templates.

Common pitfalls and how to avoid them

  • Hallucinated references: always include RAG evidence in prompts and show source links to the user.
  • Insecure code execution: never run arbitrary user code on the host. Use proper isolation.
  • Unscalable LLM calls: cache generated artifacts and avoid generating full plans on every chat message.
  • Poor onboarding signals: capture explicit feedback (usefulness, confusion) to improve the curriculum iteratively.

Actionable takeaways

  • Start small: generate a 3-step lesson plan for one role and measure time-to-first-success.
  • Enforce JSON schemas in prompts for lesson plans and quizzes to simplify automation.
  • Store embeddings privately and use RAG to ground the LLM in your codebase and policies.
  • Sandbox grading and collect explicit feedback to improve adaptivity rules.

Why this matters in 2026

By 2026, companies expect faster ramp times and measurable outcomes from onboarding. An LLM-guided curriculum that integrates with real code, runs runnable exercises, and tracks progress bridges knowledge gaps and reduces manager time. It also provides a repeatable, auditable path for upskilling in areas like secure coding, architecture patterns, and infra changes.

Next steps and call-to-action

Ready to build an MVP? Clone the starter repo (link in the site post), run the example with your LLM API key, and iterate your prompt templates for your stack. If you want a ready template with sandboxing and pgvector wiring, check our starter boilerplate or submit your onboarding goals — we’ll help you convert them into inline lesson plans.

Start small, measure outcomes (time-to-first-PR, quiz pass rate), and let the model scale your mentorship. Share your implementation in the community to get feedback and reusable prompt templates.

Call to action: Clone the guided-onboarding starter kit, run the sample lesson generator with your LLM, and tag your repo with #guided-onboarding so other engineers can reuse and contribute prompts and quizzes.

Advertisement

Related Topics

#AI#Education#Productivity
U

Unknown

Contributor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.

Advertisement
2026-03-01T01:50:13.279Z