Arrow keys or scroll to navigate

Zeno HLD

Voice-First Teaching Voice Agent - System Architecture & Design

80%
Workload Reduction
3min
Generation Time
< $1
Cost per Lesson
10x
Cost Reduction vs Raw LLM
02

Autonomous Lesson Planning Through Voice

The Problem

Mentors spend hours manually creating lesson plans, slides, and practice sets for each session. Repetitive work steals time from actual teaching.

How Zeno Works

1

Voice Conversation (HITL)

Mentor speaks topic. Zeno asks 7 discovery questions using Human-in-the-Loop methodology via LiveKit.

2

RAG-Powered Context

Searches 50+ lectures via FAISS semantic search to surface related prior content.

3

Custom Skill Infrastructure

Proprietary two-phase engine: LLM parses intent into JSON spec, then deterministic renderer produces branded PPTX/DOCX. 10x cheaper than raw LLM generation.

4

Auto-Upload to Drive

Lesson plan + slides + practice sets uploaded automatically to Google Drive via OAuth2. Zero manual steps.

03

System Architecture

LiveKit Voice Agent

Claude Opus Whisper STT OpenAI TTS 120s timeout

Handles full HITL conversation, calls 5 specialized tools

↓

5 Specialized Tools (Flat Architecture - No Multi-Agent Overhead)

↓
search_curriculum
FAISS semantic search (top-K)
get_full_lecture
Full context retrieval (4000 chars)
generate_lesson_plan
Separate API worker (400s timeout)
generate_slides
Custom Skill Infrastructure → PPTX → Drive
generate_practice_set
Custom Skill Infrastructure → DOCX → Drive
↓

Google Drive Storage

LessonPlans/  |  Slides/  |  Practice/  (OAuth2, automatic upload)

Single Agent  |  No Multi-Agent Orchestration  |  Worker Pattern for Heavy Tasks

04

Data Flow & Tech Stack

RAG Pipeline

1. Data Source

Data_Doc_main.txt  |  316KB  |  33 lectures

2. Embeddings

OpenAI text-embedding-3-small  |  1536 dims

3. Vector DB

FAISS IndexFlatL2  |  L2 distance  |  202KB

4. Semantic Search

Real-time context injection during HITL conversation

Technology Stack

Voice I/O: LiveKit AgentSession

Session LLM: Claude Haiku (120s, $0.80/MTok)

Lesson Generator: Claude Haiku worker (400s)

Embeddings: OpenAI text-embedding-3-small

Vector Search: FAISS CPU (IndexFlatL2)

PDF/PPTX/DOCX: Custom Skill Infrastructure

Storage: Google Drive API (OAuth2)

05

Custom Skill Infrastructure

Why We Built This

Anthropic's Skills API with raw LLM generation was costing 10x more per deck and producing inconsistent, off-brand output. We replaced the expensive free-form generation with a deterministic rendering engine — built entirely from scratch.

Two-Phase Pipeline Architecture

Input
Lesson Plan
.md file
→
Phase 1: Non-Deterministic
LLM Parser
Claude Sonnet/Haiku
→
Intermediate
JSON Spec
Typed schema
→
Phase 2: Deterministic
Python Renderer
python-pptx / docx
→
Output
Branded File
PPTX / DOCX
▶

Slide Deck Skill

parser.py extracts slide structure. renderer.py builds PPTX with 9 typed slide templates using Space Grotesk + coral theme.

▶

Practice Set Skill

ps_parser.py extracts 3-level exercises. ps_renderer.py builds DOCX with Beginner/Intermediate/Advanced sections.

▶

Zero Rendering Cost

Phase 2 runs pure Python. No LLM tokens consumed for formatting, layout, or branding. Only Phase 1 incurs API cost.

06

Cost Comparison: Before vs Now

BEFORE - Raw LLM Generation

Model: Claude Sonnet / Opus for full generation

Tokens per deck: ~8k input + ~5k output

Sonnet cost: ~$0.099/deck

Opus cost: ~$0.495/deck

Quality: Inconsistent, off-brand layout

Failure rate: High (LLM formatting errors)

NOW - Custom Skill Infrastructure

Phase 1 (LLM): Claude Sonnet for JSON spec only

Tokens for spec: ~3k input + ~2k output

Sonnet spec cost: ~$0.039/deck

Phase 2 (Python): $0.000/deck

Quality: Pixel-perfect, brand-consistent

Failure rate: Near-zero (deterministic)

Metric Before (Sonnet raw) Now (Custom Infra + Sonnet) Saving
Slide Deck Cost $0.099 $0.039 60% cheaper
Practice Set Cost $0.099 $0.039 60% cheaper
Full Lesson (plan+slides+practice) ~$0.40 ~$0.13 67% cheaper
Output consistency Unpredictable 100% deterministic rendering Zero formatting bugs

* Switch Phase 1 to Claude Haiku ($0.80/MTok) for further 4x reduction. Full lesson drops to ~$0.05.

07

Under the Hood

Slide Deck Generator

Skills/slide-deck/generator/

parser.py — LLM extracts slide JSON spec from lesson plan. Runs Claude API call with typed schema.

schema.py — PresentationSpec + SlideSpec Pydantic models. Validates LLM output.

renderer.py — SlideRenderer dispatches each slide to typed render function via python-pptx.

slide_types.py — 9 typed slide renderers: title, question, comparison, reveal, process, definition, architecture, best-practice, takeaway.

styles.py — Exact RGB colors, Space Grotesk font, coral (#F96846) palette enforced.

Output: 13-20 slide PPTX, 10"x7.5" 16:9, pixel-perfect branding. Uploaded to Google Drive/Slides/

Practice Set Generator

Skills/practice-set-extracted/generator/

ps_parser.py — LLM extracts 3-level exercise spec (Beginner/Intermediate/Advanced) with web search for real-world scenarios.

ps_schema.py — PracticeSetSpec + DifficultyLevel Pydantic models.

ps_renderer.py — PracticeSetRenderer builds DOCX via python-docx with JetBrains Mono for code blocks.

ps_styles.py — Colors, Fonts, FontSizes constants. Consistent brand across every document.

ps_utils.py — JetBrains Mono auto-download. Table styles. Code block formatting.

Output: DOCX with 3 difficulty tiers, real-world problem statements. Uploaded to Google Drive/Practice/

9
Slide Types
3
Difficulty Tiers
0
Rendering API Calls
100%
Brand Compliance
08

End-to-End Session Flow

HITL Discovery Phase

1

"Edith" wake word triggers session

2

Mentor speaks topic (e.g., "multi-agent systems")

3

Agent runs search_curriculum → FAISS top-5

4

Runs get_full_lecture → 4000-char context

5

7 discovery questions (Socratic, voice, one-at-a-time)

6

generate_lesson_plan worker (400s, separate API call)

Content Generation Phase

Lesson Plan Worker

Extracts HITL chat history → Claude Haiku (400s timeout) → 1500-word Markdown → Drive/LessonPlans/

Slide Generation (voice: "make slides")

skills_handler.generate_slides() → upload .md → Anthropic Skills container → Custom Skill Infrastructure → PPTX → Drive/Slides/

Practice Set (voice: "make practice")

skills_handler.generate_practice_set() → same pipeline → DOCX → Drive/Practice/

End State

Agent speaks Drive links. User says "good night" → session closes. Zero manual steps taken.

Built by Vishal

A voice agent that listens, reasons, and produces production-quality teaching materials — with a proprietary skill engine that makes it 10x cheaper than out-of-the-box AI generation.

1
Voice Agent
5
Specialized Tools
2
Custom Skill Engines
0
Manual Steps

Voice-First

Hands-free from wake word to Drive upload. Built for Raspberry Pi deployment.

RAG-Powered

33-lecture curriculum always in context. Socratic questions reference actual lecture content.

Custom Skill Infrastructure

Deterministic rendering. 10x cost reduction. Pixel-perfect branded output every time.

From spoken topic to complete teaching materials in under 4 minutes