AB-Law / AB-Law/Vett

feat: AI flashcard generation from interview knowledge documents

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.