Skip to content

Add multi-mode roadmap generation (topic/document/quiz_performance); … - #134

Merged
Matee-ur-Rehman merged 1 commit into
QuantumLogicsLabs:mainfrom
Matee-ur-Rehman:ai-ml/roadmap-multi-mode
Sep 19, 2026
Merged

Matee-ur-Rehman merged 1 commit into
QuantumLogicsLabs:mainfrom
Matee-ur-Rehman:ai-ml/roadmap-multi-mode

Conversation

@Matee-ur-Rehman

Copy link
Copy Markdown
Collaborator

Overview

Implements multi-mode roadmap generation per the Study Roadmap Feature Gaps task — supports document, topic, and quiz_performance generation modes on POST /generate-roadmap.

What was added
mode field on the request (document | topic | quiz_performance), dispatched to three separate generation paths in roadmap_service.py
document mode: pulls all chunks for a document_id (ownership-scoped to the authenticated user) from the shared Chroma store, extracts topics via YAKE, generates a roadmap from real document content
quiz_performance mode: reuses WeakTopicService directly (cross-module import), marks weak topics as high priority
topic mode: unchanged from the original single-mode implementation
New get_document_chunks() in embedding/chroma_store.py — direct metadata lookup (not similarity search), enforces user_id ownership so a caller can't pull another user's document by guessing a document_id
New roadmap_generator/app/utils/topic_extractor.py — YAKE-based keyword extraction, reusing quiz_generator's existing YAKE config constants
Documented all three modes' request/response formats in docs/api-contracts.md
Bugs found and fixed along the way
chroma_store.py: .env path had one extra .parent, pointing at the repo root instead of ai-ml/ — meant CHROMA_API_KEY/CHROMA_TENANT/CHROMA_DATABASE were never actually loaded from ai-ml/.env, regardless of what was set there.
weak_topic_service.py: default data file path was a bare relative string ("data/quiz_results.json"), which only worked if the process happened to be started from inside weak_topic_detection/ itself. Fixed to resolve as an absolute path anchored to the file's own location.
Testing

All three modes verified end-to-end locally with a real JWT and real Chroma Cloud data:

topic — generated a correct 4-step Algorithms roadmap
quiz_performance — generated a correct roadmap from weak-topic demo data
document — generated a correct roadmap from a real uploaded PDF's actual extracted content (verified topics matched the source document's subject matter)
Note for reviewers

Checked web/backend/routes/roadmap.py on main — it currently calls the old single-mode contract with no mode field. Per the task's Submission: line, this is expected to be Pluto's separate web/roadmap-entry-points branch updating to match this new contract, not something this PR needs to stay compatible with.

…fix .env path bug in chroma_store.py and relative path bug in weak_topic_service.py
@vercel

vercel Bot commented Sep 19, 2026

Copy link
Copy Markdown

@Matee-ur-Rehman is attempting to deploy a commit to the mrymfarid684-3634's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Matee-ur-Rehman
Matee-ur-Rehman merged commit 68f919c into QuantumLogicsLabs:main Sep 19, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant