Worklog Week 5

Week 5 Objectives: Sprint 2 - AI Tutor Integration

Integrate Amazon Bedrock Nova Micro for AI conversation, implement session/turn management, and build chat UI.

Main Tasks:

DayTaskComplete
MonBedrock Service:
- Nova Micro integration
- Converse API (non-streaming)
- Error handling + retries
TuePrompt Engineering:
- System prompt design
- Level-specific prompts (A1-C2)
- Token optimization
WedSession & Turn Entities:
- Session/Turn domain models
- Use cases (Create, Submit, Get, List)
- DynamoDB repositories
ThuAPI Handlers:
- POST /speaking/sessions
- POST /speaking/sessions/{id}/turns
- GET endpoints
- WebSocket support
FriChat UI:
- Chat interface (Shadcn/ui)
- Turn bubbles (user/AI)
- Loading states
- Mobile responsive

Results:

1. Bedrock Integration:

  • ✅ Model: apac.amazon.nova-micro-v1:0 (inference profile)
  • ✅ Converse API (synchronous, non-streaming)
  • ✅ Retry: AWS SDK adaptive mode (exponential backoff + jitter)
  • ✅ Cost tracking per turn

2. Prompt Engineering:

  • ✅ Level-specific prompts (A1-C2)
  • ✅ OptimizedPromptBuilder
  • ✅ Token optimization: ~150 tokens/response
  • ✅ Context window: sliding window (last 10 turns)

3. Session & Turn Management:

  • ✅ Entities: Session, Turn (not Conversation/Message)
  • ✅ Use cases: Create, Submit, Get, List
  • ✅ DynamoDB storage
  • ✅ Sliding window context (10 turns)

4. API Endpoints:

  • ✅ POST /speaking/sessions - Create session
  • ✅ POST /speaking/sessions/{id}/turns - Submit turn
  • ✅ GET /speaking/sessions/{id} - Get detail
  • ✅ GET /speaking/sessions - List sessions
  • ✅ WebSocket for real-time updates

5. Chat UI:

  • ✅ Clean interface (Shadcn/ui)
  • ✅ Turn bubbles (user vs AI)
  • ✅ Loading indicators
  • ✅ Mobile responsive

Performance:

MetricValue
Bedrock latency800ms - 1.5s
API response125ms (non-voice)
Chat page load1.8s
Cost per turn~$0.0003

User Feedback:

“AI responses feel natural and contextual!” - Tester 1

“Responses are fast enough, no lag.” - Tester 2

“Love the clean interface.” - Tester 3

Next: Sprint 2 Part 2 - Flashcards, Scenarios, Stats