professional work
Conversational AI Onboarding
A chat-based onboarding flow that populates a user's AI agent knowledge base through a guided conversation.
Full-Stack Developer · Undisclosed · Oct 2025 — Present
context
New users landed on a blank knowledge base with no guidance on what to put there. The goal was to replace that empty form with a short conversation that asked the right questions and filled in the knowledge base automatically.
the challenge
Getting multiple things to work together: an interview state machine, BAML typed functions, SSE streaming, website scraping, and knowledge base persistence. LLM output is unpredictable and SSE events can arrive split across chunk boundaries.
approach
- 1.I built the interview state machine separately from the UI. It tracks interview stage, captured fields, and completion status. Keeping it decoupled made it easier to reason about and test independently.
- 2.I used AI classification for detecting user intent (confirming, correcting, or continuing) instead of regex. Regex would need constant updating. AI classification handles natural variation without a keyword list.
- 3.I wrote an SSE streaming parser that handles events split across chunk boundaries. It buffers partial events and only emits once the full event is assembled.
technical highlights
- —BAML typed functions for each interview stage: question generation, answer merging, intent classification, and confirmation. Typed functions enforce structured output at the schema level so the LLM can't return unexpected shapes.
- —After the interview finishes, the system scrapes the user's website with a 45s timeout, saves it to the knowledge base, and links it to the created AI agent.
- —The chunk-boundary SSE parser was necessary because the network sometimes splits a single SSE event across multiple fetch chunks, which drops tokens if you process each chunk independently.
result
Users end up with a pre-populated knowledge base after a short conversation instead of a blank form.
technologies
Some implementation details have been generalized to respect employer confidentiality.