-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or requestepic:07-llm-genEpic 7: LLM-Powered Content GenerationEpic 7: LLM-Powered Content Generation
Description
Epic 7: LLM-Powered Content Generation
Story 7.1: Database Schema + Mastra Setup
Scope (3 pts, ~4.8 hours)
Foundation setup for Mastra workflow system and database schema.
Tasks
- Create
ai_generationstable with Supabase migration - Add indexes on (
lesson_id,generation_type,created_at) - Set up Mastra project structure (
lib/mastra/) - Configure OpenAI/Anthropic provider
- Create base workflow config with error handling
- Add environment variables for API keys
- Test database connection and basic workflow execution
Database Schema
```sql
CREATE TABLE ai_generations (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
lesson_id UUID NOT NULL REFERENCES lessons(id),
generation_type TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'pending',
input_data JSONB NOT NULL,
output_data JSONB,
tokens_used INTEGER,
cost_usd DECIMAL(10,6),
error TEXT,
created_at TIMESTAMPTZ DEFAULT NOW(),
completed_at TIMESTAMPTZ
);
```
Success Criteria
- Database migration runs successfully
- Mastra initializes without errors
- Can execute simple test workflow
- Environment properly configured
Related: PR #32, docs/prd/EPIC_7_MASTRA_ARCHITECTURE.md
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestepic:07-llm-genEpic 7: LLM-Powered Content GenerationEpic 7: LLM-Powered Content Generation