Skip to content

Conversation

@jhodapp
Copy link
Member

@jhodapp jhodapp commented Dec 20, 2025

Summary

  • Adds ai_suggestion_controller with full CRUD operations for AI suggestions
  • Implements accept flow that creates Actions or Agreements from AI-detected suggestions
  • Implements dismiss flow to mark suggestions as no longer relevant
  • Exports ai_suggested_item module from domain for CRUD operations
  • Adds authorization checks (only session participants can manage suggestions)

New Endpoints

  • GET /coaching_sessions/:id/ai-suggestions - Get pending AI suggestions for a session
  • POST /ai-suggestions/:id/accept - Accept a suggestion, creating an Action or Agreement
  • POST /ai-suggestions/:id/dismiss - Dismiss a suggestion

Accept Flow

When a user accepts an AI suggestion:

  1. Validates the suggestion is still pending
  2. Gets the coaching session from the transcription chain
  3. Verifies user is a participant (coach or coachee)
  4. Creates an Action or Agreement based on suggestion type
  5. Links the suggestion to the created entity

Test plan

  • Verify cargo check passes with no warnings
  • Verify cargo clippy passes with no warnings
  • Test get suggestions endpoint with mock data
  • Test accept flow creates Action correctly
  • Test accept flow creates Agreement correctly
  • Test dismiss flow updates status correctly
  • Verify authorization checks work for non-participants

Part of #146 - Phase 6 of AI Meeting Integration (final backend phase)

Add database schema, entities, and CRUD operations for the AI meeting
recording and transcription integration:

Database Migrations:
- Add user_integrations table for encrypted API credentials
- Add ai_privacy_level enum and meeting_url to coaching_relationships
- Add meeting_recordings, transcriptions, transcript_segments tables
- Add ai_suggested_items table for AI-detected actions/agreements

Entity Definitions:
- user_integrations (Google OAuth, Recall.ai, AssemblyAI credentials)
- meeting_recordings (Recall.ai bot tracking)
- transcriptions (AssemblyAI transcript data)
- transcript_segments (speaker-diarized utterances)
- ai_suggested_items (pending AI suggestions)
- Enums: ai_privacy_level, meeting_recording_status, transcription_status,
  sentiment, ai_suggestion_type, ai_suggestion_status

Entity API:
- CRUD operations for user_integration, meeting_recording, transcription,
  and ai_suggested_item modules

Other:
- AES-256-GCM encryption utilities for API key storage
- Config additions for external service credentials
- Update coaching_relationships with meeting_url and ai_privacy_level

Relates to: refactor-group/refactor-platform-fe#146
…se 3)

Add gateway clients for Recall.ai, AssemblyAI, and Google OAuth with
configurable base URLs. Create integration controller endpoints for
API key verification and OAuth flow handling.
Add start/stop recording endpoints that integrate with Recall.ai bot
for meeting capture. Add webhook handler for receiving recording
status updates from Recall.ai.
- Add transcript_segment entity_api module with CRUD operations
- Add AssemblyAI webhook handler for transcription callbacks
- Create transcription controller with transcript/segments/summary endpoints
- Update router with transcription routes
- Export transcript_segment and transcription modules from domain
- Add ai_suggestion_controller with endpoints for suggestion management
- Implement accept flow that creates Actions or Agreements from suggestions
- Implement dismiss flow to mark suggestions as dismissed
- Export ai_suggested_item module from domain
- Add routes for GET /coaching_sessions/:id/ai-suggestions
- Add routes for POST /ai-suggestions/:id/accept and /dismiss
- Add nested response structures for Recall.ai video URL extraction
  (recordings[0].media_shortcuts.video_mixed.data.download_url)
- Add backend polling for Recall.ai bot status when frontend requests
- Fix AssemblyAI webhook field name mismatch (id vs transcript_id)
- Fetch full transcript from AssemblyAI API on webhook notification
  (webhooks are notifications only, don't include transcript data)
- Add comprehensive debug logging for troubleshooting
- Add serde(rename_all = "snake_case") to AiPrivacyLevel enum
- Add serde(default) to UpdateParams fields for optional deserialization
- Add Default derive to UpdateParams struct
- Add action item extraction after transcription completes
- Create AI suggestion records for each detected action item
- Use keyword-based extraction (will, going to, need to, should, etc.)
- Log extraction results for debugging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants