Spaces:
Sleeping
Sleeping
Commit History
-
chore(access) updates passwords
379f9ed
-
Refactor: Polish project for review
This commit includes final cleanup and usability improvements before sending the project for review. - **Dependency Cleanup**: Removed unused dependencies (`langchain`, `transformers`) from `pyproject.toml`. This simplifies the project environment and reduces the installation footprint. - **Improved Setup and Demo Experience**: - The error message for a missing `FOT_GOOGLE_API_KEY` is now more helpful, providing an example `.env` format to streamline local setup. - Modified the PoC notebook's setup cell to install only essential dependencies (`sentence-transformers`, `faiss-cpu`, `google-generativeai`) directly. This resolves critical dependency conflicts with Google Colab's pre-installed packages, ensuring the demo notebook runs reliably for any user.d9d86e9 -
fix: Defer IPython import to prevent deployment error
- Moves the `IPython` import into the notebook-only helper function in `utils.py`. - This lazy import resolves the `ModuleNotFoundError` on Hugging Face by not loading dev dependencies in the production server. - Applies standard `ruff` formatting fixes.009e36a -
feat: Enhance persona prompts and RAG evaluation logging
This commit significantly improves the "Generation" and evaluation capabilities of the RAG pipeline by fully implementing persona-based prompts and enriching the evaluation data. The initial implementation had placeholder prompts for the 'parent' and 'principal' personas. Furthermore, the evaluation log did not capture the exact prompt details sent to the LLM, making it difficult to debug or audit the generation step. This commit addresses these gaps by: - **Fully implements the 'parent' and 'principal' persona prompts** in `prompts.py`. Each prompt is now tailored with specific instructions for tone, content, and formatting to align with the requirements of the performance task brief. - **Refactors the `generate_recommendation_summary` function** in the RAG pipeline. It no longer returns just the final text, but now also returns a detailed dictionary containing the prompt template, the variables used, and the final formatted prompt text sent to the LLM. - **Updates the Gradio app…5a0951c -
style: Format code and fix linter warnings
Applied `ruff format` to the entire codebase for consistency. Also fixed all outstanding Pyright and Ruff linter warnings: - Ignored warnings for correct but "private" imports (gradio, genai). - Added a check for the API key to fix a potential `None` type error. - Suppressed E402 import errors in the build script where required.280d562 -
refactor(config): Centralize all application configuration
This commit introduces a major architectural improvement by refactoring the entire application to use a single source of truth for configuration (`src/fot_recommender/config.py`). Previously, configuration variables like file paths, model parameters, and secrets were scattered across multiple files (`app.py`, `rag_pipeline.py`, `main.py`), making the system brittle and difficult to maintain. This change establishes a clean separation of concerns, where the application logic is decoupled from its configuration. This makes experimentation significantly easier (e.g., changing a model name or similarity score in one place) and lays the foundation for supporting different deployment environments (dev, prod) in the future. Key Changes: - **`config.py` is now the Central Hub:** - Consolidates all file paths for the knowledge base, FAISS index, and citations. - Defines all RAG pipeline parameters (embedding/generative model names, `k` value, similarity score). - Centralizes the loadin…23ef32a
-
feat(ui): Overhaul Gradio app for interactivity and evaluation
Transforms the basic Gradio interface into a polished, feature-rich web application designed for demonstration and evaluation. The new UI provides a significantly improved user experience with interactive examples and adds robust features for capturing and analyzing the RAG pipeline's output. This work completes the transition from a back-end proof-of-concept to a user-facing demo. Key Changes: - **Gradio App Overhaul (`app.py`):** - Rewrote the UI using `gr.Blocks` for a custom two-column layout. - Added an "Example Scenarios" section with radio buttons to quickly populate the form with pre-defined student narratives. - Implemented an "Evaluation Data" accordion that displays the full RAG output (inputs, retrieval results, LLM output) in a JSON viewer. - Added a "Download JSON" button to allow users to save the complete evaluation data for offline analysis. - Refactored the API call to be a generator (`yield`), enabling progressive updates like "Processing..." messages an…abf3963
-
feat(deploy): Implement and deploy live Gradio API
This commit introduces a fully functional, live API for the FOT Recommender, deployed on Hugging Face Spaces using Gradio. It marks a major architectural shift from local scripts to a production-oriented, interactive web application. This provides a frictionless "it just works" experience for reviewers, demonstrating the entire RAG pipeline from a simple web interface without requiring them to handle API keys or run code locally. Key architectural changes and fixes include: - **Gradio API:** A new `app.py` serves the model, handling user input and displaying synthesized, formatted recommendations. - **Offline Artifact Generation:** The build process was refactored to pre-compute and save the `faiss_index.bin` vector database. This ensures the live application has a fast startup time and is highly efficient. - **Secure Configuration:** All secrets (Google API Key, Demo Password) are now read from the secure Hugging Face environment, removing them from source code. - **Deployment Stabi…8bfb8e4 -
feat(recommender): Implement generative synthesis for educator-friendly output
This commit completes the core Proof-of-Concept by implementing the final Generation step of the RAG pipeline. The system now moves beyond simple document retrieval to provide a fully synthesized, actionable recommendation tailored for educators. This fulfills the critical project requirement that the output must be clear and directly usable, not just a list of raw search results. This work completes the objectives outlined in Phase 3 of the implementation plan. Key Changes: - **Added Generative Synthesis**: Introduced a function in . This function leverages the Google Gemini API to process the top-k retrieved document chunks and synthesize them into a coherent, practical recommendation. - **Created Prompt Templates**: Added a new module to store and manage persona-specific prompts. The initial implementation includes a detailed prompt for the 'teacher' persona, designed to produce professional and encouraging output. - **Integrated into Main Application**: Refactored to call the …929cde0 -
feat(notebook): Add PoC notebook for RAG demonstration
This commit introduces the primary technical deliverable: a functional, interactive Proof-of-Concept (PoC) in a Google Colab notebook. The notebook () demonstrates the functionality of the Freshman On-Track Intervention Recommender. It guides the user through the entire process: - Setting up the local environment. - Loading the final, semantically chunked knowledge base. - Initializing the embedding model and FAISS vector database. - Accepting a user's free-text query about a student's challenges. - Performing a semantic search and displaying the top 3 recommendations. Key Changes: - **Added PoC Notebook**: Created to serve as the interactive demonstration of the RAG system. - **Created Display Utilities**: Introduced a new module with a helper function. This formats the raw search results into a clean, human-readable output, making the recommendations clear and actionable within the notebook. - **Updated Dependencies**: Added and to the dependencies in to ensure the project's…1550049 -
feat(pipeline): Implement core RAG retrieval system
This commit delivers the functional core of the FOT Recommender by implementing the end-to-end Retrieval-Augmented Generation (RAG) pipeline. This work completes the tasks outlined in Phase 1 (Knowledge Base Construction) and Phase 2 (RAG Pipeline Implementation) of the project plan. The system can now load a raw knowledge base, process it into semantically coherent chunks, create vector embeddings, build an in-memory vector database, and perform a semantic search to retrieve relevant intervention strategies based on a student's narrative. Key Changes: - **Introduced Semantic Chunker**: Added `semantic_chunker.py` to consolidate raw JSON entries into semantically rich, concept-level chunks. This crucial step groups related content together, significantly improving the quality of the vectors for retrieval. - **Added Build Script**: Created a new `scripts/build_knowledge_base.py` utility to automate the transformation of the raw knowledge base into the final `knowledge_base_final_chu…c32c832
-
refactor(data): Pivot data pipeline from PDF parsing to pre-processed JSON
This commit removes the entire programmatic PDF extraction pipeline, which proved to be brittle and time-consuming. It refactors the application to load a manually curated and high-quality JSON file (`knowledge_base_raw.json`) as its starting point. - Deletes the complex PDF parsing logic (`knowledge_base.py`, `manual_extractions.py`) and its configuration (`document_complexity_map.csv`). - Removes obsolete data extraction dependencies (`pymupdf`, `pdfplumber`, `pandas`) from `pyproject.toml`, simplifying the environment. - Updates `main.py` to load the pre-processed JSON directly, making the data ingestion process instant and 100% reliable. - Simplifies `config.py` to remove paths to now-deleted files. This strategic shift unblocks development on the core RAG functionality by decoupling the application's runtime from the challenges of PDF data extraction.d558ce2 -
feat(knowledge_base): Implement hybrid content extraction pipeline
This commit completes the core work of Phase 1 by establishing the knowledge base construction pipeline. It translates the strategy from the into a functional extraction system. The key changes include: - ****: The core module that orchestrates the extraction. It reads the complexity map and dynamically dispatches tasks to the appropriate tool: - usage: pymupdf [-h] {show,clean,join,extract,embed-info,embed-add,embed-del,embed-upd,embed-extract,embed-copy,gettext,internal} ... ------------------------- Basic PyMuPDF Functions ------------------------- options: -h, --help show this help message and exit Subcommands: {show,clean,join,extract,embed-info,embed-add,embed-del,embed-upd,embed-extract,embed-copy,gettext,internal} Enter 'command -h' for subcommand specific help for simple text extraction. - usage: pdfplumber [-h] [--structure | --structure-text] [--format {csv,json,text}] [--typ…4267727
-
chore(project): Initialize project for FOT Recommender
- Renames the project from 'demo_application' to 'fot_intervention_recommender' to accurately reflect its purpose. - Updates pyproject.toml with all necessary dependencies for the RAG system as defined in the implementation plan (langchain, faiss-cpu, pymupdf, etc.). - Modifies the console script entry point in pyproject.toml to 'fot-recommender'. This commit completes the environment setup described in Phase 0 of the plan, establishing the foundational scaffolding for development.1437923