Key User Flows
The Engagement Lifecycle
An engagement is the core unit of work — one advisor going through the Epok process. Every engagement follows a structured path with defined milestones.
Milestones (Progress Tracker)
The engagement has a visual milestone tracker in the Overview tab. Kendra manually marks each milestone complete.
[1] Intake → Client signs up, pays deposit, receives questionnaire
[2] Discovery → Questionnaire completed, initial docs submitted, first call
[3] Workshop 1 → Hypothesis testing session — themes identified
[4] Workshop 2 → Draft report review — co-creation with client
[5] Workshop 3 → Accountability & handoff — final report
[6] Complete → Report delivered, optional ongoing setup
Each milestone has a corresponding "MS:" tag. The Overview tab shows "View docs" links that filter the Documents tab by the milestone's tag.
Visual states: Completed (colored, with date) · Current (highlighted) · Upcoming (greyed out)
Flow 1: Create & Prepare Engagement
- Kendra logs in (Google OAuth via @epokadvice.com)
- From Engagements list, clicks "New Engagement"
- Fills in advisor name, email, firm name, AUM range, optional notes
- System creates engagement + seeds 6 milestones (step 1 = current)
- Engagement detail shows 4 tabs: Overview, Documents, Questionnaires, Analysis
- Kendra prepares:
- Creates engagement-scoped documents and folders
- Assigns a questionnaire template to the engagement
- Writes internal notes
- Optionally assigns an associate
Flow 2: Questionnaire Workflow
- Kendra goes to top-level Questionnaires section in sidebar
- Creates or selects a questionnaire template (versioned question builder)
- Question types: text, textarea, select, multi-select, scale, yes/no
- From engagement Questionnaires tab, starts a new response linked to a published template version
- Three respondent modes:
- Interviewer: Kendra fills in answers during a call
- Client: Advisor fills in via their portal
- Agent: AI fills in from engagement context (AI-assisted answer filling)
- AI fill: sends each question + engagement documents to LLM, auto-populates draft answers
- Completed responses are saved and available as context for analysis
Flow 3: Workshop & Content Capture
For each workshop:
- Pre-workshop: Review AI chat insights, prepare talking points using the KB
- During workshop: Kendra runs the session (external: Google Meet, Zoom, Otter.ai)
- Post-workshop:
- Otter.ai recording auto-ingested via Zapier →
/api/v1/ingest→ lands in KB Inbox as Summary + Transcript documents - Kendra reviews in KB, uses "File to Engagement" to move docs into the engagement with milestone tag
- Creates additional notes as engagement documents
- Marks milestone complete in Overview tab
- Otter.ai recording auto-ingested via Zapier →
Flow 4: AI Chat
Available on every admin page via the slide-out chat panel (right side):
- User types a question or instruction
- System embeds the query → retrieves top-5 relevant document chunks via pgvector cosine similarity
- Retrieved context + user message sent to Claude Sonnet (default) or GPT-4o
- Response streamed via SSE
- Agent tools available: search KB, read documents, list engagements, create notes
- Chat history persisted per session in
chat_messagestable - Model selector in chat header to switch between Claude and GPT-4o
Flow 5: AI Analysis
Per-engagement analysis with document references:
- From engagement Analysis tab, click "New Analysis"
- Write a prompt using the @-mention editor — type
@to search and reference specific engagement or KB documents - Referenced documents become analysis inputs (linked via
analysis_inputstable) - Select model: Claude Sonnet (default), GPT-4o, or GPT-4o Mini
- Click Run → streaming LLM execution via SSE with real-time output display
- On completion, output is auto-saved as a content document tagged "Analysis Output" and linked to the engagement
- Refinement: Click "Refine with AI" → enter refinement instructions → current output + instructions sent back through the streaming endpoint to produce an updated version
- Analysis detail view shows full output with export options
Flow 6: Knowledge Base Management
- Navigate to Knowledge Base in sidebar (badge shows unfiled inbox doc count)
- Folder tree in left panel with nested folders, document list in main area
- Create folders, move documents between folders
- Tag documents with classification labels (multi-select)
- Filter by tag — clicking a tag shows all documents with that tag across all folders
- Create new documents with TipTap editor (rich WYSIWYG or raw markdown toggle)
- Version history sidebar shows all versions with timestamps and change summaries
- Publish → auto-embeds for AI search
- File to Engagement: On unfiled KB docs, select engagement + optional milestone tag → moves doc to engagement scope
- Inbox: Auto-ingested content (Otter.ai transcripts) lands here for triage
Flow 7: Export & Sharing
From any document or analysis output, the Copy & Export menu provides:
- Copy: Markdown source, plain text, or rich text (HTML) to clipboard
- Google Docs:
- First use: OAuth redirect to connect Google account (tokens stored in profile)
- Creates new Google Doc with title, formatted content
- Optional: select target Google Drive folder via folder picker
- Gamma:
- Choose format: Document, Presentation, or Webpage
- POST creates generation → client polls for completion (30-90 seconds)
- On success, link to view in Gamma
- Auth:
X-API-KEYheader withsk-gamma-...key
Flow 8: External API & AI Agent Access
ChatGPT Integration
- ChatGPT connects via OAuth 2.1 → gets API key
- Uses OpenAPI spec at
/api/v1/openapi.jsonto discover tools - Calls
POST /api/v1/toolsorPOST /api/v1/tools/:nameto execute tools - Can search KB, read documents, create notes, list engagements
Claude MCP Integration
- Claude connects via MCP + OAuth → gets API key
POST /api/mcp— stateless JSON-RPC 2.0 endpoint- Same tool set as REST API
- Handles: initialize, tools/list, tools/call, ping
Zapier / Otter.ai Auto-Ingestion
- Otter.ai records and transcribes a meeting
- Zapier triggers on new Otter recording
- Optionally saves to Google Drive (backup)
- POST to
/api/v1/ingestwith title, summary, transcript, meeting_date, source, participants - Creates up to 2 KB documents (Summary + Transcript) in Inbox folder
- Auto-tagged "Auto-Ingested" + "Summary"/"Transcript"
- Auto-embedded for AI search
Flow 9: API Key Management
- Navigate to admin API Keys page (
/admin/api-keys) - Create new key — shown once, copy immediately
- Key format:
epok_sk_...(base64url random) - Keys are SHA-256 hashed in database; only prefix stored for identification
- Keys can be deactivated or deleted
- OAuth-created keys are auto-named (e.g. "OAuth: client_abc123")
Flow 10: Email Notifications
Resend-powered email for:
- Questionnaire request invitations
- Document sharing notifications
- Content update notifications
- HTML templates in
docs/folder (zapier-email-template.html, content-update-email.html)
Future Flows (Not Yet Built)
- Client Portal: Full client-facing portal with milestone tracker, questionnaire completion, and published content viewing
- Context Switching: Super admin views system as client for QA
- Scheduling: Calendar integration for workshop booking
- Atlas Point Integration: Tool access provisioning after engagement completion
- Cohort Dashboard: View all active engagements as a cohort with milestone progress
- Built-in Video: LiveKit-powered interview sessions with live transcription