feat: AI flashcard generation from interview knowledge documents
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
## Epic
Part of #25 — Study Tools
## Problem
Once interview documents are embedded, users have no way to do active recall on the material. There is no study loop — just passive re-reading or relying on the chat to surface facts on demand.
## Impact
Spaced-repetition flashcards are one of the most effective evidence-based study techniques. Generating them automatically from the user's own uploaded documents makes preparation faster and more targeted than any generic resource.
## Proposed Code (High Level)
**Backend**
```python
# backend/app/routers/study.py
POST /study/flashcards
body: { job_id: int, topic: str | None, num_cards: int = 10 }
# 1. pgvector similarity search over interview_knowledge_documents chunks
# (reuse practice_vector retrieval pattern)
# 2. Prompt Claude (claude-sonnet-4-6):
# "Generate {num_cards} flashcards as JSON [{front, back}].
# Focus on: {topic}."
# 3. Persist to StudyCardSet / StudyCard
# 4. Return card_set_id + cards
PATCH /study/cards/{card_id}/review
body: { rating: 'easy' | 'hard' } # updates ease_factor + interval_days
```
**New DB models**
```python
# backend/app/models/study.py
class StudyCardSet(Base):
id, job_id (FK), topic, created_at
class StudyCard(Base):
id, card_set_id (FK), front, back,
last_reviewed_at, ease_factor, interval_days # spaced repetition fields
```
**Frontend — Study Hub (`/study/:jobId`)**
- Card flip animation (CSS transform)
- Easy / Hard buttons after each card → PATCH review endpoint
- Progress bar: cards remaining in set
## Functionality Impact
- No new embedding pipeline — reuses existing pgvector chunks
- Spaced repetition fields stored for future due-date scheduling
- First deliverable to implement; unblocks the Study Hub layout
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.