Spaces:
Running
Running
Dipti Dhawade commited on
Commit Β·
e65f749
1
Parent(s): 33ad1a2
Rename to Interview.ai
Browse files- DEPLOYMENT.md +6 -6
- README.md +10 -10
- backend/library.py +1 -1
- backend/search.py +1 -1
- backend/settings.py +3 -3
- backend/starter_notes.py +1 -1
DEPLOYMENT.md
CHANGED
|
@@ -149,13 +149,13 @@ code checker (ESLint) before building, so commit the lockfile whenever you add o
|
|
| 149 |
- explorer upload
|
| 150 |
- study generation
|
| 151 |
|
| 152 |
-
## 5) Shared course library and
|
| 153 |
|
| 154 |
-
[
|
| 155 |
|
| 156 |
-
- **Study AI tab**: this frontend inside
|
| 157 |
Both sites are on `cherie-dips.github.io`, so they share the sign-in.
|
| 158 |
-
- **Ask AI** in
|
| 159 |
shown there. Those PDFs are read **once** on the server into the shared course library
|
| 160 |
(`backend/library.py`) and searched by every student; nothing is copied per student.
|
| 161 |
|
|
@@ -190,7 +190,7 @@ the next sync (typed PDFs are still indexed).
|
|
| 190 |
| Setting | Default | What it does |
|
| 191 |
|---|---|---|
|
| 192 |
| `LIBRARY_ENABLED` | `true` | Turn the shared library (and Ask AI's course search) on or off |
|
| 193 |
-
| `LIBRARY_SUPABASE_URL`, `LIBRARY_SUPABASE_KEY`, `LIBRARY_BUCKET` |
|
| 194 |
| `LIBRARY_PREFIXES` | `plaksha-university` | Bucket folders to index (comma-separated) |
|
| 195 |
| `LIBRARY_OCR` | `auto` | `auto` (Sarvam if a key is set, else Tesseract), `sarvam`, `tesseract` or `off` |
|
| 196 |
| `LIBRARY_SYNC_HOURS` | `0` | Re-check the bucket every N hours (`0` = only when started by hand) |
|
|
@@ -198,7 +198,7 @@ the next sync (typed PDFs are still indexed).
|
|
| 198 |
### Verify
|
| 199 |
|
| 200 |
1. `GET /library/status` lists the indexed PDFs.
|
| 201 |
-
2. In
|
| 202 |
(the PDF scrolls to that spot).
|
| 203 |
3. Open the **Study AI** tab: you are already signed in, and a deck saved from Ask AI is under Review.
|
| 204 |
|
|
|
|
| 149 |
- explorer upload
|
| 150 |
- study generation
|
| 151 |
|
| 152 |
+
## 5) Shared course library and Interview.ai (Study AI + Ask AI)
|
| 153 |
|
| 154 |
+
[Interview.ai](https://cherie-dips.github.io/SDE-Prep/) uses this backend in two ways:
|
| 155 |
|
| 156 |
+
- **Study AI tab**: this frontend inside Interview.ai (`/NoteScanner/?embed=sde`), in Interview.ai's colours.
|
| 157 |
Both sites are on `cherie-dips.github.io`, so they share the sign-in.
|
| 158 |
+
- **Ask AI** in Interview.ai's Notes tab: questions, flashcards, quizzes and summaries about the course PDFs
|
| 159 |
shown there. Those PDFs are read **once** on the server into the shared course library
|
| 160 |
(`backend/library.py`) and searched by every student; nothing is copied per student.
|
| 161 |
|
|
|
|
| 190 |
| Setting | Default | What it does |
|
| 191 |
|---|---|---|
|
| 192 |
| `LIBRARY_ENABLED` | `true` | Turn the shared library (and Ask AI's course search) on or off |
|
| 193 |
+
| `LIBRARY_SUPABASE_URL`, `LIBRARY_SUPABASE_KEY`, `LIBRARY_BUCKET` | Interview.ai's bucket | Where the PDFs are (the key is the public, read-only anon key) |
|
| 194 |
| `LIBRARY_PREFIXES` | `plaksha-university` | Bucket folders to index (comma-separated) |
|
| 195 |
| `LIBRARY_OCR` | `auto` | `auto` (Sarvam if a key is set, else Tesseract), `sarvam`, `tesseract` or `off` |
|
| 196 |
| `LIBRARY_SYNC_HOURS` | `0` | Re-check the bucket every N hours (`0` = only when started by hand) |
|
|
|
|
| 198 |
### Verify
|
| 199 |
|
| 200 |
1. `GET /library/status` lists the indexed PDFs.
|
| 201 |
+
2. In Interview.ai, open Notes β a course PDF β **Ask AI**: sign in, ask a question, click a source
|
| 202 |
(the PDF scrolls to that spot).
|
| 203 |
3. Open the **Study AI** tab: you are already signed in, and a deck saved from Ask AI is under Review.
|
| 204 |
|
README.md
CHANGED
|
@@ -19,8 +19,8 @@ due for review, and build a day-by-day revision plan before an exam.
|
|
| 19 |
|
| 20 |

|
| 21 |
|
| 22 |
-
**Also part of [
|
| 23 |
-
(this app in
|
| 24 |
questions, flashcards, quizzes and summaries about the course PDFs shown there, which the server reads
|
| 25 |
once into a shared course library. See [The shared course library](#4-the-shared-course-library).
|
| 26 |
|
|
@@ -81,10 +81,10 @@ Telugu).
|
|
| 81 |
- **Today** dashboard: cards due, streak, weak topics (from quiz scores), last 14 days of activity.
|
| 82 |
- **Exam mode**: a day-by-day revision plan up to an exam date, and timed mock tests from a whole course folder.
|
| 83 |
|
| 84 |
-
**Course library (
|
| 85 |
-
- Course PDFs from
|
| 86 |
- Ask about the PDF that's open: answers come from that PDF first, then the rest of its course, and each
|
| 87 |
-
source says where in the PDF it is (
|
| 88 |
- Flashcards, quizzes and summaries from a course PDF; saved decks show up in the Review tab here.
|
| 89 |
|
| 90 |
**Accounts and running a pilot**
|
|
@@ -194,7 +194,7 @@ after longer and longer gaps; cards you forget come back in 10 minutes.
|
|
| 194 |
|
| 195 |
### 4. The shared course library
|
| 196 |
|
| 197 |
-
|
| 198 |
uploading the same PDFs, the server reads each one **once** and keeps it in two shared collections.
|
| 199 |
|
| 200 |
```
|
|
@@ -212,10 +212,10 @@ uploading the same PDFs, the server reads each one **once** and keeps it in two
|
|
| 212 |
β
|
| 213 |
βΌ
|
| 214 |
Cut into passages and embed them, like a note. Each passage remembers its page and how far down
|
| 215 |
-
the page it starts, so
|
| 216 |
```
|
| 217 |
|
| 218 |
-
When
|
| 219 |
rest of its course together, with a small lead for the open PDF, so a lecture that clearly answers the
|
| 220 |
question wins. The student's own notes are used only when they really match.
|
| 221 |
|
|
@@ -290,7 +290,7 @@ NoteScanner/
|
|
| 290 |
β β StudyPanel, StudyDecks, StudyToday, ExamMode, FileTextView,
|
| 291 |
β β upload progress, settings, feedback, privacy note, admin page
|
| 292 |
β βββ auth.js, config.js Sign-in state and the server address
|
| 293 |
-
β βββ embed.js, embed.css Study AI mode: inside
|
| 294 |
β βββ localFileStore.js Keeps your original files on your device for viewing
|
| 295 |
β βββ localDiskFolder.js Optional: mirror your folders into a "NoteScanner" folder on your computer
|
| 296 |
β βββ studyApi.js, studyUtils.js, chatHistory.js, virtualPath.js Small helpers
|
|
@@ -399,7 +399,7 @@ Step-by-step instructions, backups and checks are in [DEPLOYMENT.md](DEPLOYMENT.
|
|
| 399 |
| Security and sizes | `CORS_ORIGINS` (localhost + `https://cherie-dips.github.io`), `SESSION_TTL_DAYS` (14), `MAX_UPLOAD_MB` (20), `MAX_CHAT_UPLOAD_CHARS` (300000), `CHAT_CACHE_TTL_SECONDS` (7200), `USER_DOCUMENT_MAX_BYTES` (2000000), `RATE_LIMIT_MULTIPLIER` (1) |
|
| 400 |
| Password-reset email | `FRONTEND_URL`, `SMTP_HOST`, `SMTP_PORT` (587), `SMTP_USERNAME`, `SMTP_PASSWORD`, `SMTP_FROM`, `SMTP_STARTTLS` (true). Turned on only when `SMTP_HOST` and `SMTP_FROM` are set. |
|
| 401 |
| OneNote | `MICROSOFT_CLIENT_ID`, `MICROSOFT_CLIENT_SECRET`, `MICROSOFT_REDIRECT_URI` |
|
| 402 |
-
| Course library | `LIBRARY_ENABLED` (true), `LIBRARY_SUPABASE_URL` / `LIBRARY_SUPABASE_KEY` / `LIBRARY_BUCKET` (
|
| 403 |
| Pilot | `ADMIN_EMAILS`, `ALERT_WEBHOOK_URL`, `AI_PRICE_PER_PAGE`, `AI_PRICE_PER_1K_INPUT_TOKENS`, `AI_PRICE_PER_1K_OUTPUT_TOKENS`, `AI_PRICE_CURRENCY` (INR), `AI_MONTHLY_BUDGET` (0 = off), `APP_TIMEZONE` (Asia/Kolkata), `REMINDER_HOUR` (8), `REMINDERS_ENABLED` (true), `STARTER_NOTES` (true) |
|
| 404 |
|
| 405 |
Search thresholds (how close a match must be before it's used) are the `MIN_SCORE_*` values in
|
|
|
|
| 19 |
|
| 20 |

|
| 21 |
|
| 22 |
+
**Also part of [Interview.ai](https://cherie-dips.github.io/SDE-Prep/).** There it is the **Study AI** tab
|
| 23 |
+
(this app in Interview.ai's colours, with the same sign-in), and it powers **Ask AI** in Interview.ai's Notes tab:
|
| 24 |
questions, flashcards, quizzes and summaries about the course PDFs shown there, which the server reads
|
| 25 |
once into a shared course library. See [The shared course library](#4-the-shared-course-library).
|
| 26 |
|
|
|
|
| 81 |
- **Today** dashboard: cards due, streak, weak topics (from quiz scores), last 14 days of activity.
|
| 82 |
- **Exam mode**: a day-by-day revision plan up to an exam date, and timed mock tests from a whole course folder.
|
| 83 |
|
| 84 |
+
**Course library (Interview.ai)**
|
| 85 |
+
- Course PDFs from Interview.ai's Notes tab are read once on the server and shared by every student.
|
| 86 |
- Ask about the PDF that's open: answers come from that PDF first, then the rest of its course, and each
|
| 87 |
+
source says where in the PDF it is (Interview.ai scrolls there when it's clicked).
|
| 88 |
- Flashcards, quizzes and summaries from a course PDF; saved decks show up in the Review tab here.
|
| 89 |
|
| 90 |
**Accounts and running a pilot**
|
|
|
|
| 194 |
|
| 195 |
### 4. The shared course library
|
| 196 |
|
| 197 |
+
Interview.ai's Notes tab shows course PDFs from a public Supabase Storage bucket. Instead of every student
|
| 198 |
uploading the same PDFs, the server reads each one **once** and keeps it in two shared collections.
|
| 199 |
|
| 200 |
```
|
|
|
|
| 212 |
β
|
| 213 |
βΌ
|
| 214 |
Cut into passages and embed them, like a note. Each passage remembers its page and how far down
|
| 215 |
+
the page it starts, so Interview.ai can scroll to the exact spot.
|
| 216 |
```
|
| 217 |
|
| 218 |
+
When Interview.ai asks a question it sends `library_path` (the open PDF). The search ranks that PDF and the
|
| 219 |
rest of its course together, with a small lead for the open PDF, so a lecture that clearly answers the
|
| 220 |
question wins. The student's own notes are used only when they really match.
|
| 221 |
|
|
|
|
| 290 |
β β StudyPanel, StudyDecks, StudyToday, ExamMode, FileTextView,
|
| 291 |
β β upload progress, settings, feedback, privacy note, admin page
|
| 292 |
β βββ auth.js, config.js Sign-in state and the server address
|
| 293 |
+
β βββ embed.js, embed.css Study AI mode: inside Interview.ai, with its name and colours
|
| 294 |
β βββ localFileStore.js Keeps your original files on your device for viewing
|
| 295 |
β βββ localDiskFolder.js Optional: mirror your folders into a "NoteScanner" folder on your computer
|
| 296 |
β βββ studyApi.js, studyUtils.js, chatHistory.js, virtualPath.js Small helpers
|
|
|
|
| 399 |
| Security and sizes | `CORS_ORIGINS` (localhost + `https://cherie-dips.github.io`), `SESSION_TTL_DAYS` (14), `MAX_UPLOAD_MB` (20), `MAX_CHAT_UPLOAD_CHARS` (300000), `CHAT_CACHE_TTL_SECONDS` (7200), `USER_DOCUMENT_MAX_BYTES` (2000000), `RATE_LIMIT_MULTIPLIER` (1) |
|
| 400 |
| Password-reset email | `FRONTEND_URL`, `SMTP_HOST`, `SMTP_PORT` (587), `SMTP_USERNAME`, `SMTP_PASSWORD`, `SMTP_FROM`, `SMTP_STARTTLS` (true). Turned on only when `SMTP_HOST` and `SMTP_FROM` are set. |
|
| 401 |
| OneNote | `MICROSOFT_CLIENT_ID`, `MICROSOFT_CLIENT_SECRET`, `MICROSOFT_REDIRECT_URI` |
|
| 402 |
+
| Course library | `LIBRARY_ENABLED` (true), `LIBRARY_SUPABASE_URL` / `LIBRARY_SUPABASE_KEY` / `LIBRARY_BUCKET` (Interview.ai's public bucket), `LIBRARY_PREFIXES` (`plaksha-university`), `LIBRARY_OCR` (`auto`), `LIBRARY_SYNC_HOURS` (0 = by hand). See [DEPLOYMENT.md](DEPLOYMENT.md#5-shared-course-library-and-interviewai-study-ai--ask-ai). |
|
| 403 |
| Pilot | `ADMIN_EMAILS`, `ALERT_WEBHOOK_URL`, `AI_PRICE_PER_PAGE`, `AI_PRICE_PER_1K_INPUT_TOKENS`, `AI_PRICE_PER_1K_OUTPUT_TOKENS`, `AI_PRICE_CURRENCY` (INR), `AI_MONTHLY_BUDGET` (0 = off), `APP_TIMEZONE` (Asia/Kolkata), `REMINDER_HOUR` (8), `REMINDERS_ENABLED` (true), `STARTER_NOTES` (true) |
|
| 404 |
|
| 405 |
Search thresholds (how close a match must be before it's used) are the `MIN_SCORE_*` values in
|
backend/library.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
"""
|
| 2 |
The shared course library: course PDFs read once on the server and searched by every student.
|
| 3 |
|
| 4 |
-
The PDFs come from a public Supabase Storage bucket (the Notes tab of
|
| 5 |
settings.py). They live in two shared collections, so nothing is copied per student:
|
| 6 |
|
| 7 |
- library_notes search passages + embeddings; metadata: path, subject, page and `y` (where on
|
|
|
|
| 1 |
"""
|
| 2 |
The shared course library: course PDFs read once on the server and searched by every student.
|
| 3 |
|
| 4 |
+
The PDFs come from a public Supabase Storage bucket (the Notes tab of Interview.ai; see LIBRARY_* in
|
| 5 |
settings.py). They live in two shared collections, so nothing is copied per student:
|
| 6 |
|
| 7 |
- library_notes search passages + embeddings; metadata: path, subject, page and `y` (where on
|
backend/search.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
Finding the note excerpts that answer a question.
|
| 3 |
|
| 4 |
Search order: chat uploads (+ button) β the open file β other files in the same course folder β
|
| 5 |
-
all other notes. When the question is about a shared course PDF (
|
| 6 |
path), that PDF and then the rest of its course come first. Every stage is scored as cosine
|
| 7 |
similarity (0..1), so stages can be compared.
|
| 8 |
"""
|
|
|
|
| 2 |
Finding the note excerpts that answer a question.
|
| 3 |
|
| 4 |
Search order: chat uploads (+ button) β the open file β other files in the same course folder β
|
| 5 |
+
all other notes. When the question is about a shared course PDF (Interview.ai's Notes tab sends its
|
| 6 |
path), that PDF and then the rest of its course come first. Every stage is scored as cosine
|
| 7 |
similarity (0..1), so stages can be compared.
|
| 8 |
"""
|
backend/settings.py
CHANGED
|
@@ -86,8 +86,8 @@ def _env_bool(name: str, default: bool) -> bool:
|
|
| 86 |
|
| 87 |
|
| 88 |
# ---------- Shared course library (read once on the server, searched by every student) ----------
|
| 89 |
-
# The PDFs behind
|
| 90 |
-
# publishable anon key, already served in plain text by
|
| 91 |
# read the bucket. Never put a service_role key here.
|
| 92 |
LIBRARY_ENABLED = _env_bool("LIBRARY_ENABLED", True)
|
| 93 |
LIBRARY_SUPABASE_URL = _env_str("LIBRARY_SUPABASE_URL", "https://jlmzxsaysnvoxbutfkxw.supabase.co").rstrip("/")
|
|
@@ -97,7 +97,7 @@ LIBRARY_SUPABASE_KEY = _env_str(
|
|
| 97 |
"ImFub24iLCJpYXQiOjE3NzIwNDA2NTcsImV4cCI6MjA4NzYxNjY1N30.VvBgtpcmwuhoBSdjUKE5A3_9At-S2cCznCqfS_ECUkg",
|
| 98 |
)
|
| 99 |
LIBRARY_BUCKET = _env_str("LIBRARY_BUCKET", "Notes")
|
| 100 |
-
# Top-level folders of the bucket to index (comma-separated).
|
| 101 |
LIBRARY_PREFIXES = tuple(
|
| 102 |
p.strip().strip("/") for p in _env_str("LIBRARY_PREFIXES", "plaksha-university").split(",") if p.strip()
|
| 103 |
)
|
|
|
|
| 86 |
|
| 87 |
|
| 88 |
# ---------- Shared course library (read once on the server, searched by every student) ----------
|
| 89 |
+
# The PDFs behind Interview.ai's Notes tab: a public Supabase Storage bucket. The key is that project's
|
| 90 |
+
# publishable anon key, already served in plain text by Interview.ai (js/notes-data.js); it can only
|
| 91 |
# read the bucket. Never put a service_role key here.
|
| 92 |
LIBRARY_ENABLED = _env_bool("LIBRARY_ENABLED", True)
|
| 93 |
LIBRARY_SUPABASE_URL = _env_str("LIBRARY_SUPABASE_URL", "https://jlmzxsaysnvoxbutfkxw.supabase.co").rstrip("/")
|
|
|
|
| 97 |
"ImFub24iLCJpYXQiOjE3NzIwNDA2NTcsImV4cCI6MjA4NzYxNjY1N30.VvBgtpcmwuhoBSdjUKE5A3_9At-S2cCznCqfS_ECUkg",
|
| 98 |
)
|
| 99 |
LIBRARY_BUCKET = _env_str("LIBRARY_BUCKET", "Notes")
|
| 100 |
+
# Top-level folders of the bucket to index (comma-separated). Interview.ai shows only this category.
|
| 101 |
LIBRARY_PREFIXES = tuple(
|
| 102 |
p.strip().strip("/") for p in _env_str("LIBRARY_PREFIXES", "plaksha-university").split(",") if p.strip()
|
| 103 |
)
|
backend/starter_notes.py
CHANGED
|
@@ -55,7 +55,7 @@ STARTER_FILES = (
|
|
| 55 |
("Sample - Newton's laws of motion.md", SAMPLE_PHYSICS),
|
| 56 |
)
|
| 57 |
|
| 58 |
-
# The name the student signed up under: "Study AI" is NoteScanner inside
|
| 59 |
APP_NAMES = ("NoteScanner", "Study AI")
|
| 60 |
|
| 61 |
|
|
|
|
| 55 |
("Sample - Newton's laws of motion.md", SAMPLE_PHYSICS),
|
| 56 |
)
|
| 57 |
|
| 58 |
+
# The name the student signed up under: "Study AI" is NoteScanner inside Interview.ai's Study AI tab.
|
| 59 |
APP_NAMES = ("NoteScanner", "Study AI")
|
| 60 |
|
| 61 |
|