Spaces:
Sleeping
docs(planning): Finalize project plans to reflect strategic pivots
Browse filesOverhauls the initial and implementation plans to serve as final, annotated deliverables. This commit transforms the plans from simple task lists into a strategic narrative that documents the project's evolution and key decision-making processes.
The primary changes include:
- **Annotate Strategic Pivot:** Explicitly documents the critical decision to move from complex programmatic PDF extraction to a manually curated JSON knowledge base. This annotation explains the rationale, tying the decision to the "Bias for Action" principle and the goal of de-risking the project to focus on RAG quality.
- **Detail AI Collaboration Workflow:** Replaces the generic "AI as a Co-pilot" section with the specific, human-directed methodology used. This includes the multi-model planning process, the core technique of active context management, and the concept of the "virtuous cycle of code quality."
- **Reflect Stack Evolution:** Updates the technical stack to accurately represent the final implementation (e.g., direct implementation vs. LangChain) and clarifies the deployment path (Gradio app on Hugging Face Spaces vs. a formal REST API).
- **Improve Technical Precision:** Refines language to be more technically accurate, such as distinguishing between an "interactive web application" and a formal "REST API."
These finalized documents now provide a clear, professional, and honest account of the project's journey from initial concept to final implementation.
- docs/implementation_log.md +124 -0
- docs/implementation_plan.md +0 -279
- docs/initial_plan.md +0 -150
- docs/project_plan_and_design.md +111 -0
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FOT Intervention Recommender
|
| 2 |
+
## Final Implementation Plan (Annotated)
|
| 3 |
+
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
## Overview
|
| 7 |
+
|
| 8 |
+
This implementation plan documents the executable phases, tasks, and deliverables used to build the working proof-of-concept for the Freshman On-Track Intervention Recommender. This plan was updated from its original version to reflect the final, successful implementation path.
|
| 9 |
+
|
| 10 |
+
**Primary Deliverable**: A working RAG system, deployed as an interactive web application, that provides evidence-based intervention recommendations.
|
| 11 |
+
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
## Phase 0: Environment Setup & Resource Gathering
|
| 15 |
+
**Goal**: Establish a lean development environment and prepare all source materials.
|
| 16 |
+
|
| 17 |
+
### Tasks
|
| 18 |
+
|
| 19 |
+
#### 0.1 Development Environment Setup
|
| 20 |
+
- [✅] Create local project structure (`pyproject.toml`, `src/`, `tests/`).
|
| 21 |
+
- [✅] Configure a modern, fast dependency manager (`uv`).
|
| 22 |
+
- [✅] Install core libraries: `torch`, `sentence-transformers`, `faiss-cpu`, `google-generativeai`, `gradio`.
|
| 23 |
+
- [✅] Create a `.env` file for secure management of API keys.
|
| 24 |
+
|
| 25 |
+
#### 0.2 Source Material Collection
|
| 26 |
+
- [✅] Identify and download the primary source document (NCS FOT Toolkit) and five additional high-quality, evidence-based articles.
|
| 27 |
+
- [✅] Manually extract and structure all relevant interventions from these sources into a clean, high-quality `knowledge_base_raw.json` file.
|
| 28 |
+
- [✅] Create a `citations.json` file to store metadata for all source documents.
|
| 29 |
+
|
| 30 |
+
### Success Criteria
|
| 31 |
+
- ✅ Local development environment running with all simplified dependencies.
|
| 32 |
+
- ✅ `knowledge_base_raw.json` and `citations.json` files are created, validated, and located in `data/processed/`.
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## Phase 1: Knowledge Base Construction
|
| 37 |
+
**Goal**: Load and semantically chunk the curated knowledge base to prepare it for embedding.
|
| 38 |
+
|
| 39 |
+
> **_Strategic Pivot: From Programmatic Extraction to Curated Knowledge Base_**
|
| 40 |
+
>
|
| 41 |
+
> * **Initial Approach:** My original plan detailed a complex pipeline to programmatically extract text and tables from source PDFs using tools like PyMuPDF and pdfplumber.
|
| 42 |
+
> * **Challenge & Insight:** I quickly identified this approach as a significant project risk. The complexity and unreliability of PDF parsing could easily consume the majority of development time, detracting from the core task: building a high-quality RAG system. The ultimate goal is to provide relevant recommendations, which depends entirely on the *quality* and *cleanliness* of the knowledge base, not the sophistication of the extraction method.
|
| 43 |
+
> * **Decision & Rationale:** In line with the "Bias for Action" and "Startup Urgency" principles, I made a strategic decision to pivot. I manually curated a high-quality `knowledge_base_raw.json` file, a process accelerated by using an LLM as a co-pilot. This action de-risked the project, guaranteed the highest possible quality for the RAG pipeline's input, and allowed me to focus my efforts on the more critical tasks of semantic chunking, embedding, and retrieval logic.
|
| 44 |
+
> * **Result:** This pivot resulted in a more robust and effective PoC. The final system is built on a foundation of clean, reliable data, directly leading to more relevant and trustworthy recommendations.
|
| 45 |
+
|
| 46 |
+
### Tasks
|
| 47 |
+
|
| 48 |
+
#### 1.1 Content Loading
|
| 49 |
+
- [✅] Implement logic in `scripts/build_knowledge_base.py` to load the `knowledge_base_raw.json` file.
|
| 50 |
+
|
| 51 |
+
#### 1.2 Content Processing & Chunking
|
| 52 |
+
- [✅] Create a `src/fot_recommender/semantic_chunker.py` module to group related items from the raw JSON file.
|
| 53 |
+
- [✅] Implement a `chunk_by_concept` strategy that combines page-based items into larger, topic-based chunks.
|
| 54 |
+
|
| 55 |
+
#### 1.3 Knowledge Base Structuring
|
| 56 |
+
- [✅] Define a final chunk structure, ensuring the output is a clean list of dictionaries, each containing `title`, `source_document`, `fot_pages`, and a combined `content_for_embedding` string.
|
| 57 |
+
- [✅] Save the processed data as `knowledge_base_final_chunks.json`.
|
| 58 |
+
|
| 59 |
+
### Success Criteria
|
| 60 |
+
- ✅ `knowledge_base_raw.json` successfully loaded into the build script.
|
| 61 |
+
- ✅ Semantic chunking logic correctly combines related pages into fewer, more coherent chunks.
|
| 62 |
+
- ✅ A final `knowledge_base_final_chunks.json` file is produced and validated for quality.
|
| 63 |
+
|
| 64 |
+
---
|
| 65 |
+
|
| 66 |
+
## Phase 2: RAG Pipeline Implementation
|
| 67 |
+
**Goal**: Build and test the core Retrieval-Augmented Generation functionality.
|
| 68 |
+
|
| 69 |
+
### Tasks
|
| 70 |
+
|
| 71 |
+
#### 2.1 Vector Embedding Setup
|
| 72 |
+
- [✅] **Initialize embedding model**: In `rag_pipeline.py`, initialize `all-MiniLM-L6-v2` using the `sentence-transformers` library.
|
| 73 |
+
- [✅] **Create embeddings**: Implement a function to create embeddings from the `content_for_embedding` field of each chunk.
|
| 74 |
+
- [✅] **Set up FAISS vector database**: Implement `create_vector_db` to build an `IndexFlatIP` index from the embeddings and save it to `faiss_index.bin`.
|
| 75 |
+
|
| 76 |
+
#### 2.2 Retrieval System
|
| 77 |
+
- [✅] **Implement semantic search**: Create a `search_interventions` function that takes a query, embeds it, and uses the FAISS index to retrieve the top-k most relevant chunks.
|
| 78 |
+
- [✅] **Test retrieval**: Validate that sample queries return relevant and high-scoring results.
|
| 79 |
+
|
| 80 |
+
#### 2.3 Response Generation
|
| 81 |
+
- [✅] **Implement Generative Model**: Use the `google-generativeai` library to call the Gemini API.
|
| 82 |
+
- [✅] **Create persona-based prompts**: In `prompts.py`, create distinct, detailed prompts for 'teacher', 'parent', and 'principal' personas.
|
| 83 |
+
- [✅] **Synthesize response**: Create a `generate_recommendation_summary` function that formats the retrieved chunks and user query into the selected persona's prompt and sends it to the Gemini API.
|
| 84 |
+
|
| 85 |
+
### Success Criteria
|
| 86 |
+
- ✅ Vector database successfully created with all intervention embeddings.
|
| 87 |
+
- ✅ Semantic search returns relevant results for test queries.
|
| 88 |
+
- ✅ Response generation successfully synthesizes retrieved chunks into a coherent, persona-specific recommendation.
|
| 89 |
+
|
| 90 |
+
---
|
| 91 |
+
|
| 92 |
+
## Phase 3: System Integration & Application Deployment
|
| 93 |
+
**Goal**: Build a user-facing application, create a full test suite, and deploy the system.
|
| 94 |
+
|
| 95 |
+
### Tasks
|
| 96 |
+
- [✅] **Create an Interactive Web Application**: In `app.py`, build an interactive UI using Gradio.
|
| 97 |
+
- [✅] **Integrate RAG Pipeline**: Connect the UI components to the full RAG pipeline (embedding, search, generation).
|
| 98 |
+
- [✅] **Add Examples and UI Polish**: Include example scenarios and helper functions to improve user experience.
|
| 99 |
+
- [✅] **Implement Access Key**: Add a simple password field to protect the demo.
|
| 100 |
+
- [✅] **Deploy to Hugging Face Spaces**: Configure the repository for deployment and launch the live application.
|
| 101 |
+
- [✅] **Create a Full Test Suite**: In the `tests/` directory, write unit tests using `pytest` for key logic, including semantic chunking and RAG pipeline functions.
|
| 102 |
+
|
| 103 |
+
### Success Criteria
|
| 104 |
+
- ✅ End-to-end pipeline is fully functional within the Gradio application.
|
| 105 |
+
- ✅ Application successfully deployed and accessible via a public URL.
|
| 106 |
+
- ✅ Core logic is validated with passing unit tests, ensuring system resilience.
|
| 107 |
+
|
| 108 |
+
---
|
| 109 |
+
|
| 110 |
+
## Phase 4: Documentation & Presentation
|
| 111 |
+
**Goal**: Create clear, comprehensive documentation for the project.
|
| 112 |
+
|
| 113 |
+
### Tasks
|
| 114 |
+
- [✅] **Write a comprehensive `README.md`**:
|
| 115 |
+
- Include project goals, features, and system architecture.
|
| 116 |
+
- Provide clear, step-by-step instructions for local setup and execution.
|
| 117 |
+
- Add a link to the live deployed application.
|
| 118 |
+
- [✅] **Document code**: Add docstrings and inline comments to all major functions and modules.
|
| 119 |
+
- [✅] **Prepare for presentation**: Create a logical flow for a 5-minute video demonstration, walking through the project's "why," the PoC notebook, and the final live application.
|
| 120 |
+
|
| 121 |
+
### Success Criteria
|
| 122 |
+
- ✅ `README.md` is professional, clear, and comprehensive.
|
| 123 |
+
- ✅ Code is well-documented and easy to understand.
|
| 124 |
+
- ✅ A clear plan for the final presentation is established.
|
|
@@ -1,279 +0,0 @@
|
|
| 1 |
-
# FOT Intervention Recommender
|
| 2 |
-
## Detailed Implementation Plan (Revision 2)
|
| 3 |
-
|
| 4 |
-
---
|
| 5 |
-
|
| 6 |
-
## Overview
|
| 7 |
-
|
| 8 |
-
This implementation plan transforms the strategic project plan into executable phases, with specific tasks, deliverables, and success criteria for building the working proof-of-concept.
|
| 9 |
-
|
| 10 |
-
***Note on Strategic Pivot:*** *We have shifted from programmatic PDF extraction to using a manually curated, high-quality JSON knowledge base (`knowledge_base_raw.json`). This decision was made to bypass the complexities and unreliability of PDF parsing and to focus directly on the core RAG pipeline development.*
|
| 11 |
-
|
| 12 |
-
**Primary Deliverable**: A working RAG system application that provides intervention recommendations.
|
| 13 |
-
|
| 14 |
-
---
|
| 15 |
-
|
| 16 |
-
## Phase 0: Environment Setup & Resource Gathering
|
| 17 |
-
**Goal**: Establish a lean development environment and use the pre-processed source materials.
|
| 18 |
-
|
| 19 |
-
### Tasks
|
| 20 |
-
|
| 21 |
-
#### 0.1 Development Environment Setup
|
| 22 |
-
- [✅] Create local project structure.
|
| 23 |
-
- [✅] ~~Install required libraries in first cell:~~
|
| 24 |
-
```python
|
| 25 |
-
~~!pip install sentence-transformers faiss-cpu langchain pandas pymupdf pdfplumber transformers~~
|
| 26 |
-
```
|
| 27 |
-
- [✅] **Install simplified libraries:**
|
| 28 |
-
```bash
|
| 29 |
-
uv pip install langchain sentence-transformers faiss-cpu transformers torch
|
| 30 |
-
```
|
| 31 |
-
- [✅] Import necessary libraries and test basic functionality.
|
| 32 |
-
|
| 33 |
-
#### 0.2 Source Material Collection
|
| 34 |
-
- [✅] ~~**Extract FOT Toolkit pages 43-68**~~
|
| 35 |
-
- [✅] ~~**Download 5 external sources**~~
|
| 36 |
-
- [✅] **Prepare `knowledge_base_raw.json`**: Manually (or with LLM assistance) extract and structure all relevant interventions from the FOT Toolkit into a clean JSON file. This file becomes our single source of truth.
|
| 37 |
-
|
| 38 |
-
#### 0.3 Quick Content Reconnaissance
|
| 39 |
-
- [✅] ~~Scan each document to identify complexity~~
|
| 40 |
-
- [✅] ~~Create a "document complexity map" for processing strategy~~
|
| 41 |
-
|
| 42 |
-
### Success Criteria
|
| 43 |
-
- ✅ Local development environment running with all simplified dependencies.
|
| 44 |
-
- ✅ `knowledge_base_raw.json` file is created, validated, and located in `data/processed/`.
|
| 45 |
-
- ✅ ~~Basic understanding of each document's structure and complexity~~
|
| 46 |
-
|
| 47 |
-
---
|
| 48 |
-
|
| 49 |
-
## Phase 1: Knowledge Base Construction
|
| 50 |
-
**Goal**: ~~Extract, process, and structure content~~ **Load and semantically chunk the pre-processed knowledge base.**
|
| 51 |
-
|
| 52 |
-
### Tasks
|
| 53 |
-
|
| 54 |
-
#### 1.1 Content Extraction (Hybrid Approach)
|
| 55 |
-
- [✅] ~~**Implement PyMuPDF extraction**~~
|
| 56 |
-
- [✅] ~~**Implement pdfplumber for tables**~~
|
| 57 |
-
- [✅] ~~**Manual extraction for complex pages**~~
|
| 58 |
-
- [✅] **Load Pre-processed Knowledge Base**: Implement logic in `main.py` to load the `knowledge_base_raw.json` file.
|
| 59 |
-
|
| 60 |
-
#### 1.2 Content Processing & Standardization
|
| 61 |
-
- [ ] ~~**Create intervention extraction function**~~
|
| 62 |
-
- [ ] ~~**Process each document**~~
|
| 63 |
-
- [ ] **Implement Semantic Chunker**: Create a `semantic_chunker.py` module that combines related page-based items from the raw JSON into larger, topic-based chunks (e.g., group all pages about "Intervention Evaluation Flowchart" into one chunk).
|
| 64 |
-
|
| 65 |
-
#### 1.3 Knowledge Base Structuring
|
| 66 |
-
- [ ] ~~**Create standardized intervention format**~~
|
| 67 |
-
- [ ] ~~**Implement semantic chunking**~~
|
| 68 |
-
- [ ] **Define Final Chunk Structure**: Ensure the output of the semantic chunker is a clean list of dictionaries, each containing `title`, `fot_pages`, and a combined `content` string.
|
| 69 |
-
|
| 70 |
-
### Success Criteria
|
| 71 |
-
- ✅ `knowledge_base_raw.json` successfully loaded into the application.
|
| 72 |
-
- ✅ Semantic chunking logic correctly combines related pages into fewer, more coherent chunks.
|
| 73 |
-
- ✅ A final `knowledge_base_final_chunks.json` file is produced and validated for quality.
|
| 74 |
-
|
| 75 |
-
---
|
| 76 |
-
|
| 77 |
-
## Phase 2: RAG Pipeline Implementation
|
| 78 |
-
**Goal**: Build and test the core RAG functionality.
|
| 79 |
-
|
| 80 |
-
### Tasks
|
| 81 |
-
|
| 82 |
-
#### 2.1 Vector Embedding Setup
|
| 83 |
-
- [✅] **Initialize embedding model**:
|
| 84 |
-
```python
|
| 85 |
-
from sentence_transformers import SentenceTransformer
|
| 86 |
-
model = SentenceTransformer('all-MiniLM-L6-v2')
|
| 87 |
-
```
|
| 88 |
-
|
| 89 |
-
- [✅] **Create embeddings for knowledge base**:
|
| 90 |
-
```python
|
| 91 |
-
def create_embeddings(intervention_chunks):
|
| 92 |
-
embeddings = model.encode(intervention_chunks)
|
| 93 |
-
return embeddings
|
| 94 |
-
```
|
| 95 |
-
|
| 96 |
-
- [✅] **Set up FAISS vector database**:
|
| 97 |
-
```python
|
| 98 |
-
import faiss
|
| 99 |
-
def create_vector_db(embeddings):
|
| 100 |
-
dimension = embeddings.shape[1]
|
| 101 |
-
index = faiss.IndexFlatIP(dimension)
|
| 102 |
-
index.add(embeddings)
|
| 103 |
-
return index
|
| 104 |
-
```
|
| 105 |
-
|
| 106 |
-
#### 2.2 Retrieval System
|
| 107 |
-
- [✅] **Implement semantic search**:
|
| 108 |
-
```python
|
| 109 |
-
def search_interventions(query, index, intervention_data, k=3):
|
| 110 |
-
query_embedding = model.encode([query])
|
| 111 |
-
scores, indices = index.search(query_embedding, k)
|
| 112 |
-
return [(intervention_data[i], scores[0][idx]) for idx, i in enumerate(indices[0])]
|
| 113 |
-
```
|
| 114 |
-
|
| 115 |
-
- [ ] **Test retrieval with sample queries**:
|
| 116 |
-
- "Student failing core classes and missing school"
|
| 117 |
-
- "Attendance problems and behavioral issues"
|
| 118 |
-
- "Low credits earned, needs academic support"
|
| 119 |
-
|
| 120 |
-
#### 2.3 Response Generation
|
| 121 |
-
- [ ] **Create educator-friendly formatter**:
|
| 122 |
-
```python
|
| 123 |
-
def format_recommendations(retrieved_interventions, student_profile):
|
| 124 |
-
formatted_response = []
|
| 125 |
-
for intervention, score in retrieved_interventions:
|
| 126 |
-
recommendation = {
|
| 127 |
-
"intervention_name": intervention["name"],
|
| 128 |
-
"rationale": f"Recommended because: {explain_match(intervention, student_profile)}",
|
| 129 |
-
"implementation_steps": intervention["implementation_steps"],
|
| 130 |
-
"source": intervention["source_document"],
|
| 131 |
-
"confidence_score": score
|
| 132 |
-
}
|
| 133 |
-
formatted_response.append(recommendation)
|
| 134 |
-
return formatted_response
|
| 135 |
-
```
|
| 136 |
-
|
| 137 |
-
### Success Criteria
|
| 138 |
-
- ✅ Vector database successfully created with all intervention embeddings
|
| 139 |
-
- ✅ Semantic search returns relevant results for test queries
|
| 140 |
-
- ✅ Response format is educator-friendly with clear implementation guidance
|
| 141 |
-
- ✅ Source citations are properly maintained throughout pipeline
|
| 142 |
-
|
| 143 |
-
---
|
| 144 |
-
|
| 145 |
-
## Phase 3: System Integration & Testing
|
| 146 |
-
**Goal**: End-to-end testing with provided student profile
|
| 147 |
-
|
| 148 |
-
### Tasks
|
| 149 |
-
|
| 150 |
-
#### 3.1 End-to-End Pipeline Integration
|
| 151 |
-
- [ ] **Create main recommendation function**:
|
| 152 |
-
```python
|
| 153 |
-
def get_fot_recommendations(student_profile_narrative):
|
| 154 |
-
# 1. Process student narrative
|
| 155 |
-
# 2. Perform semantic search
|
| 156 |
-
# 3. Retrieve top 3 interventions
|
| 157 |
-
# 4. Format for educators
|
| 158 |
-
# 5. Return structured recommendations
|
| 159 |
-
pass
|
| 160 |
-
```
|
| 161 |
-
|
| 162 |
-
#### 3.2 Testing with Sample Student Profile
|
| 163 |
-
- [ ] **Test with provided profile**:
|
| 164 |
-
```python
|
| 165 |
-
sample_student = """This student is struggling to keep up with coursework,
|
| 166 |
-
having failed one core class and earning only 2.5 credits out of 4 credits
|
| 167 |
-
expected for the semester. Attendance is becoming a concern at 88% for an
|
| 168 |
-
average annual target of 90%, and they have had one behavioral incident.
|
| 169 |
-
The student needs targeted academic and attendance support to get back on
|
| 170 |
-
track for graduation."""
|
| 171 |
-
|
| 172 |
-
recommendations = get_fot_recommendations(sample_student)
|
| 173 |
-
```
|
| 174 |
-
|
| 175 |
-
#### 3.3 Quality Validation & Refinement
|
| 176 |
-
- [ ] **Evaluate recommendation quality**:
|
| 177 |
-
- Do recommendations address student's specific risk factors?
|
| 178 |
-
- Are implementation steps clear and actionable?
|
| 179 |
-
- Are source citations accurate and helpful?
|
| 180 |
-
|
| 181 |
-
- [ ] **Refine retrieval if needed**:
|
| 182 |
-
- Adjust embedding model parameters
|
| 183 |
-
- Modify chunking strategy if results are poor
|
| 184 |
-
- Fine-tune response formatting
|
| 185 |
-
|
| 186 |
-
### Success Criteria
|
| 187 |
-
- ✅ End-to-end pipeline processes student profile successfully
|
| 188 |
-
- ✅ Returns exactly 3 relevant intervention recommendations
|
| 189 |
-
- ✅ Each recommendation includes implementation steps and source citation
|
| 190 |
-
- ✅ Recommendations directly address student's risk factors (credits, attendance, behavior)
|
| 191 |
-
|
| 192 |
-
---
|
| 193 |
-
|
| 194 |
-
## Phase 4: Documentation & Presentation Preparation
|
| 195 |
-
**Goal**: Create clear notebook documentation and prepare for video presentation
|
| 196 |
-
|
| 197 |
-
### Tasks
|
| 198 |
-
|
| 199 |
-
#### 4.1 Colab Notebook Documentation
|
| 200 |
-
- [ ] **Add comprehensive markdown cells**:
|
| 201 |
-
- Project overview and goals
|
| 202 |
-
- Knowledge base composition and rationale
|
| 203 |
-
- Technical architecture explanation
|
| 204 |
-
- Step-by-step process documentation
|
| 205 |
-
|
| 206 |
-
- [ ] **Code documentation**:
|
| 207 |
-
- Add docstrings to all functions
|
| 208 |
-
- Include inline comments for complex logic
|
| 209 |
-
- Add example usage for key functions
|
| 210 |
-
|
| 211 |
-
#### 4.2 Demonstration Preparation
|
| 212 |
-
- [ ] **Create demonstration workflow**:
|
| 213 |
-
- Show knowledge base construction process
|
| 214 |
-
- Demonstrate search functionality with different queries
|
| 215 |
-
- Walk through the sample student profile analysis
|
| 216 |
-
- Display formatted recommendations
|
| 217 |
-
|
| 218 |
-
- [ ] **Prepare talking points for video**:
|
| 219 |
-
- Project value proposition (30 seconds)
|
| 220 |
-
- Technical approach overview (60 seconds)
|
| 221 |
-
- Live demonstration (2 minutes)
|
| 222 |
-
- Next steps and product vision (90 seconds)
|
| 223 |
-
|
| 224 |
-
### Success Criteria
|
| 225 |
-
- ✅ Notebook is well-documented with clear explanations
|
| 226 |
-
- ✅ All code cells execute successfully from top to bottom
|
| 227 |
-
- ✅ Demonstration workflow is smooth and highlights key features
|
| 228 |
-
- ✅ Ready for 5-minute video recording
|
| 229 |
-
|
| 230 |
-
---
|
| 231 |
-
|
| 232 |
-
## Phase 5: Bonus Features (Optional)
|
| 233 |
-
**Goal**: Implement advanced features to differentiate the solution
|
| 234 |
-
|
| 235 |
-
### Option A: API Microservice (Bonus 1)
|
| 236 |
-
- [ ] **Create FastAPI application**:
|
| 237 |
-
```python
|
| 238 |
-
from fastapi import FastAPI
|
| 239 |
-
app = FastAPI(title="FOT Intervention Recommender")
|
| 240 |
-
|
| 241 |
-
@app.post("/recommend")
|
| 242 |
-
async def get_recommendations(student_narrative: str):
|
| 243 |
-
return get_fot_recommendations(student_narrative)
|
| 244 |
-
```
|
| 245 |
-
|
| 246 |
-
- [ ] **Containerize with Docker**
|
| 247 |
-
- [ ] **Create deployment documentation**
|
| 248 |
-
|
| 249 |
-
### Option B: Persona-Based Recommendations (Bonus 2)
|
| 250 |
-
- [ ] **Implement persona-specific prompts**:
|
| 251 |
-
```python
|
| 252 |
-
def generate_persona_recommendations(interventions, persona):
|
| 253 |
-
# Teacher: Classroom-focused, actionable steps
|
| 254 |
-
# Parent: Supportive language, home-based strategies
|
| 255 |
-
# Principal: Resource requirements, systemic approach
|
| 256 |
-
pass
|
| 257 |
-
```
|
| 258 |
-
|
| 259 |
-
### Success Criteria (if attempted)
|
| 260 |
-
- ✅ Bonus feature fully functional and demonstrated
|
| 261 |
-
- ✅ Added value is clear and well-articulated
|
| 262 |
-
- ✅ Implementation quality matches core system standards
|
| 263 |
-
|
| 264 |
-
---
|
| 265 |
-
|
| 266 |
-
## Risk Mitigation Strategies
|
| 267 |
-
|
| 268 |
-
### Technical Risks
|
| 269 |
-
- **~~Complex PDF extraction fails~~**: **(RESOLVED)** This risk has been completely eliminated by pivoting to a manually curated JSON file.
|
| 270 |
-
- **Poor embedding quality**: Test alternative models (e.g., `all-mpnet-base-v2`).
|
| 271 |
-
- **Retrieval returns irrelevant results**: Adjust chunking strategy or add filtering.
|
| 272 |
-
- **New Risk - Poor Manual Extraction**: The quality of the RAG system now depends entirely on the quality of the `knowledge_base_raw.json`. Mitigation: Manually review and edit the JSON for clarity, accuracy, and completeness.
|
| 273 |
-
|
| 274 |
-
### Time Management Risks
|
| 275 |
-
- **~~Document processing takes too long~~**: **(RESOLVED)** This risk is eliminated.
|
| 276 |
-
- **Perfectionism trap**: Focus on working MVP first, refinements second.
|
| 277 |
-
- **Scope creep**: Stick to core deliverables, save enhancements for bonus phase.
|
| 278 |
-
|
| 279 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,150 +0,0 @@
|
|
| 1 |
-
# Freshman On-Track Intervention Recommender
|
| 2 |
-
## Project Plan & Technical Design (Revision 3)
|
| 3 |
-
|
| 4 |
-
---
|
| 5 |
-
|
| 6 |
-
## Problem Understanding
|
| 7 |
-
|
| 8 |
-
**Core Problem**: Freshman year performance is the strongest predictor of high school graduation, yet educators lack systematic tools to match at-risk 9th graders with evidence-based interventions. Currently, intervention selection relies on educator intuition rather than proven best practices, leading to inconsistent support for struggling students.
|
| 9 |
-
|
| 10 |
-
**Goal of this PoC**: Build a Retrieval-Augmented Generation (RAG) system that takes a student's on-track indicators (credits, attendance, behavioral flags) and automatically recommends the most relevant, evidence-based intervention strategies from a curated knowledge base of proven FOT practices.
|
| 11 |
-
|
| 12 |
-
**Value Proposition**: This system transforms scattered research into actionable guidance, enabling educators to quickly identify targeted interventions without requiring deep expertise in educational research. By democratizing access to best practices, we can systematically improve outcomes for at-risk freshmen.
|
| 13 |
-
|
| 14 |
-
---
|
| 15 |
-
|
| 16 |
-
## Proposed RAG Architecture
|
| 17 |
-
|
| 18 |
-
### Technical Stack & Rationale
|
| 19 |
-
|
| 20 |
-
**Programming Language**: Python
|
| 21 |
-
- Industry standard for ML/AI development
|
| 22 |
-
- Rich ecosystem of libraries for RAG implementation
|
| 23 |
-
- Rapid prototyping capabilities align with "bias for action" principle
|
| 24 |
-
|
| 25 |
-
**Core Libraries**:
|
| 26 |
-
- **LangChain**: Framework for RAG pipeline orchestration and prompt management
|
| 27 |
-
- **Sentence Transformers**: High-quality semantic embeddings optimized for educational content
|
| 28 |
-
- **FAISS**: Fast, in-memory vector search for PoC (Facebook AI Similarity Search)
|
| 29 |
-
- **Simplified Stack**: Focus on `langchain`, `sentence-transformers`, `faiss-cpu`, `torch`, and `transformers` to directly support the core RAG pipeline, removing dependencies for direct PDF processing.
|
| 30 |
-
|
| 31 |
-
**Vector Embeddings**: `all-MiniLM-L6-v2` model
|
| 32 |
-
- Optimized for semantic similarity tasks
|
| 33 |
-
- Balanced performance vs. computational efficiency
|
| 34 |
-
- Strong performance on educational/instructional text
|
| 35 |
-
|
| 36 |
-
**Cloud Services** (Production Path):
|
| 37 |
-
- **Google Cloud Run**: Serverless, auto-scaling container deployment
|
| 38 |
-
- **Pinecone/Weaviate**: Managed vector database for production scale
|
| 39 |
-
- **Google Cloud Storage**: Document storage and versioning
|
| 40 |
-
|
| 41 |
-
### RAG Pipeline Architecture
|
| 42 |
-
|
| 43 |
-
1. **Knowledge Base Ingestion**: Load and process a manually curated, high-quality JSON knowledge base (`knowledge_base_raw.json`). This bypasses unreliable PDF parsing to focus on core RAG functionality.
|
| 44 |
-
2. **Chunking Strategy**: Semantic chunking by intervention type and implementation steps.
|
| 45 |
-
3. **Vector Embedding**: Transform text chunks into searchable vector representations.
|
| 46 |
-
4. **Retrieval**: Take the `narrative_summary_for_embedding` from the student profile as the query. Perform semantic search against the vector database to retrieve the top 3 most relevant intervention chunks.
|
| 47 |
-
5. **Synthesis**: Generate educator-friendly recommendations with source citations.
|
| 48 |
-
|
| 49 |
-
### Alignment with Architectural Principles
|
| 50 |
-
|
| 51 |
-
- **RAG as Core**: Semantic search ensures recommendations are grounded in evidence-based research.
|
| 52 |
-
- **Actionable for Educators**: Output format prioritizes clear, implementable steps over raw research.
|
| 53 |
-
- **Startup Scale**: FAISS for PoC, cloud-native services for production scalability.
|
| 54 |
-
- **Bias for Action**: Minimal viable architecture focused on core functionality first.
|
| 55 |
-
|
| 56 |
-
---
|
| 57 |
-
|
| 58 |
-
## Knowledge Base & Data Processing Strategy
|
| 59 |
-
|
| 60 |
-
### Selected Best-Practice Documents
|
| 61 |
-
|
| 62 |
-
The knowledge base is built from the primary source document provided and is complemented by five additional high-quality, evidence-based resources to provide specific, actionable "playbooks" for educators.
|
| 63 |
-
|
| 64 |
-
**Primary Source Document:**
|
| 65 |
-
1. **Freshman On‑Track Toolkit (2nd Edition)** (Network for College Success, 2017)
|
| 66 |
-
- ***Primary Focus Area***: **Tool Set C: Developing and Tracking Interventions (Pages 43-68)**, which provides the core framework for intervention planning, tracking, and evaluation.
|
| 67 |
-
|
| 68 |
-
**Additional Curated Sources:**
|
| 69 |
-
2. **17 Quick Tips for Your Credit Recovery Program** (Edmentum, 2024)
|
| 70 |
-
- *Focus*: Actionable strategies for designing and implementing effective credit recovery programs at both the district and school levels.
|
| 71 |
-
3. **Handout: Strategies to Address Chronic Absenteeism** (Institute of Education Sciences, REL Southwest, 2025)
|
| 72 |
-
- *Focus*: Evidence-based interventions for chronic absenteeism, including Early Warning Systems, Mentoring, and Check & Connect.
|
| 73 |
-
4. **High-Quality Tutoring: An Evidence-Based Strategy to Tackle Learning Loss** (Institute of Education Sciences, 2021)
|
| 74 |
-
- *Focus*: Defines the characteristics of effective, high-impact tutoring to accelerate student learning.
|
| 75 |
-
5. **WWC Intervention Report: Check & Connect** (Institute of Education Sciences, What Works Clearinghouse, 2015)
|
| 76 |
-
- *Evidence Level*: A detailed report on a key dropout prevention program with positive effects on keeping students in school.
|
| 77 |
-
6. **Early Intervention Strategies: Using Teams to Monitor and Identify Students in Need of Support** (Attendance Works, 2019)
|
| 78 |
-
- *Focus*: A multi-tiered team-based approach to monitoring attendance data and implementing early interventions.
|
| 79 |
-
|
| 80 |
-
### Data Processing Strategy
|
| 81 |
-
|
| 82 |
-
~~**Content Extraction** (Hybrid Strategy):~~
|
| 83 |
-
- ~~**Tier 1**: PyMuPDF (fitz) for rapid extraction of simple, single-column text pages~~
|
| 84 |
-
- ~~**Tier 2**: pdfplumber for structured tabular data to preserve relational integrity~~
|
| 85 |
-
- ~~**Tier 3**: Nougat (Meta AI) layout-aware model for complex multi-column layouts and flowcharts~~
|
| 86 |
-
- ~~**Quality Assurance**: Manual review and validation of extracted content accuracy~~
|
| 87 |
-
|
| 88 |
-
**Pivoted Content Extraction Strategy:**
|
| 89 |
-
- **Manual Curation**: Bypassed programmatic PDF extraction due to complexity and unreliability. Instead, key interventions were manually extracted (with LLM assistance) from all source documents into a single, high-quality `knowledge_base_raw.json` file. This ensures maximum quality and allows direct focus on the RAG pipeline.
|
| 90 |
-
|
| 91 |
-
**Chunking Approach**:
|
| 92 |
-
- **Semantic Chunking**: Break documents by intervention type, not arbitrary word limits.
|
| 93 |
-
- **Chunk Size**: 300-500 words to maintain context while enabling precise retrieval.
|
| 94 |
-
- **Overlap Strategy**: 50-word overlap to preserve cross-boundary context.
|
| 95 |
-
- **Metadata Tagging**: Source document, intervention category, target indicators.
|
| 96 |
-
|
| 97 |
-
**Content Preparation**:
|
| 98 |
-
- Standardize intervention descriptions with consistent format.
|
| 99 |
-
- Extract key implementation steps and required resources.
|
| 100 |
-
- Tag interventions by target risk factors (attendance, credits, behavior).
|
| 101 |
-
- Create intervention summaries optimized for educator consumption.
|
| 102 |
-
|
| 103 |
-
---
|
| 104 |
-
|
| 105 |
-
## AI as a Co-pilot Strategy
|
| 106 |
-
|
| 107 |
-
### Development Acceleration
|
| 108 |
-
|
| 109 |
-
**GitHub Copilot**:
|
| 110 |
-
- Code generation for standard RAG pipeline components.
|
| 111 |
-
- Boilerplate reduction for data processing and API endpoints.
|
| 112 |
-
- Test case generation for validation scenarios.
|
| 113 |
-
|
| 114 |
-
**Large Language Models (GPT-4/Claude)**:
|
| 115 |
-
- **Knowledge Base Curation**: Accelerated the manual extraction process by summarizing dense academic PDFs and structuring the content into the clean `knowledge_base_raw.json` format.
|
| 116 |
-
- **Prompt Engineering**: Optimize prompts for educator-specific output formatting.
|
| 117 |
-
- **Content Synthesis**: Transform academic language into practitioner-friendly recommendations.
|
| 118 |
-
- **Code Review**: Architecture validation and optimization suggestions.
|
| 119 |
-
|
| 120 |
-
### Problem-Solving Workflow
|
| 121 |
-
|
| 122 |
-
1. **Research Phase**: Use LLMs to quickly synthesize intervention research and identify gaps.
|
| 123 |
-
2. **Architecture Design**: Validate technical approach against startup scaling requirements.
|
| 124 |
-
3. **Implementation**: Leverage Copilot for rapid prototype development.
|
| 125 |
-
4. **Testing**: AI-assisted generation of diverse student profile test cases.
|
| 126 |
-
5. **Optimization**: LLM-powered analysis of retrieval quality and recommendation relevance.
|
| 127 |
-
|
| 128 |
-
### Quality Assurance
|
| 129 |
-
|
| 130 |
-
- **Prompt Validation**: Use AI to generate edge cases for robust testing.
|
| 131 |
-
- **Content Review**: AI-assisted verification that academic content translates to actionable guidance.
|
| 132 |
-
- **Bias Detection**: Systematic review of recommendations for potential equity issues.
|
| 133 |
-
|
| 134 |
-
---
|
| 135 |
-
|
| 136 |
-
## Success Metrics & Next Steps
|
| 137 |
-
|
| 138 |
-
**PoC Success Criteria**:
|
| 139 |
-
- Accurate retrieval of top 3 relevant interventions for sample student profile.
|
| 140 |
-
- Educator-friendly output format with clear implementation guidance.
|
| 141 |
-
- Sub-2 second response time for typical queries.
|
| 142 |
-
- Proper source citation for all recommendations.
|
| 143 |
-
|
| 144 |
-
**Production Evolution Path**:
|
| 145 |
-
1. **Enhanced Knowledge Base**: Scale to 50+ intervention documents.
|
| 146 |
-
2. **Persona-Based Outputs**: Tailored recommendations for teachers, parents, principals.
|
| 147 |
-
3. **API Microservice**: RESTful service for integration with SIS platforms.
|
| 148 |
-
4. **Analytics Dashboard**: Track intervention effectiveness and usage patterns.
|
| 149 |
-
|
| 150 |
-
This PoC establishes the foundation for a scalable, evidence-based intervention recommendation system that can transform how educators support at-risk freshmen nationwide.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Freshman On-Track Intervention Recommender
|
| 2 |
+
## Project Plan & Technical Design (Final)
|
| 3 |
+
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
## 1. Problem Understanding
|
| 7 |
+
|
| 8 |
+
**Core Problem**: Freshman year performance is the strongest predictor of high school graduation, yet educators lack systematic tools to match at-risk 9th graders with evidence-based interventions. Currently, intervention selection often relies on educator intuition rather than proven best practices, leading to inconsistent support for struggling students.
|
| 9 |
+
|
| 10 |
+
**Goal of this PoC**: Build a Retrieval-Augmented Generation (RAG) system that takes a simple narrative about a student's challenges and automatically recommends the most relevant, evidence-based intervention strategies from a curated knowledge base of proven FOT practices.
|
| 11 |
+
|
| 12 |
+
**Value Proposition**: This system transforms scattered educational research into actionable guidance, enabling educators to quickly identify targeted interventions. By democratizing access to best practices, we can systematically improve outcomes for at-risk freshmen.
|
| 13 |
+
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
## 2. Proposed RAG Architecture
|
| 17 |
+
|
| 18 |
+
### Technical Stack & Rationale
|
| 19 |
+
|
| 20 |
+
The final technical stack was chosen to prioritize development speed, robustness, and alignment with modern AI engineering practices.
|
| 21 |
+
|
| 22 |
+
**Programming Language**: Python 3.12
|
| 23 |
+
- *Rationale*: Industry standard for AI/ML, rich library ecosystem, and rapid prototyping capabilities.
|
| 24 |
+
|
| 25 |
+
**Core Libraries**:
|
| 26 |
+
- **Sentence Transformers & FAISS**: For high-quality semantic search. `all-MiniLM-L6-v2` offers an excellent balance of performance and efficiency. FAISS provides a fast, in-memory vector store ideal for a PoC.
|
| 27 |
+
- **Google Generative AI**: To leverage the powerful `gemini-1.5-flash` model for the "Generation" step, synthesizing evidence into actionable, persona-based advice.
|
| 28 |
+
- **Gradio**: To rapidly build and deploy a user-friendly, interactive web application for the demo.
|
| 29 |
+
- **uv**: A modern, high-speed project and environment manager used to ensure fast, reliable dependency installation and management.
|
| 30 |
+
|
| 31 |
+
> **_Stack Evolution_**
|
| 32 |
+
> My initial plan considered using `LangChain` for pipeline orchestration. However, for a focused PoC, implementing the RAG logic directly provided greater control, transparency into the prompts, and avoided an additional dependency. The successful pivot away from programmatic PDF extraction also eliminated the need for data manipulation libraries like `Pandas`, resulting in a leaner and more focused final stack.
|
| 33 |
+
|
| 34 |
+
### Deployment & Production Path
|
| 35 |
+
|
| 36 |
+
- **PoC Deployment**: The application was successfully deployed to **Hugging Face Spaces**.
|
| 37 |
+
- *Rationale*: This platform is ideal for hosting interactive Gradio applications, providing a public URL for live demonstrations and stakeholder feedback without complex infrastructure setup.
|
| 38 |
+
|
| 39 |
+
- **Production Path**:
|
| 40 |
+
- The core logic would be packaged into a formal **REST API microservice** using a framework like FastAPI and containerized with Docker.
|
| 41 |
+
- This API would be deployed on a scalable, serverless platform like **Google Cloud Run** or **AWS Lambda** for cost-effective, high-availability serving.
|
| 42 |
+
- The FAISS index would be replaced by a managed vector database like **Pinecone** or **Weaviate** to handle a larger knowledge base and higher query volumes.
|
| 43 |
+
|
| 44 |
+
### RAG Pipeline Architecture
|
| 45 |
+
|
| 46 |
+
1. **Knowledge Base Curation**: A high-quality JSON file (`knowledge_base_raw.json`) was manually curated from source documents to ensure maximum data quality.
|
| 47 |
+
2. **Chunking & Indexing (Build Time)**: A build script processes the raw JSON, performs semantic chunking by concept, and creates a FAISS vector index (`faiss_index.bin`).
|
| 48 |
+
3. **Retrieval (Runtime)**: A user's narrative is embedded and used to perform a semantic search against the FAISS index, retrieving the most relevant intervention chunks.
|
| 49 |
+
4. **Synthesis (Runtime)**: The retrieved chunks and the original query are formatted into a persona-specific prompt and sent to the Gemini API.
|
| 50 |
+
5. **Output**: The API generates a synthesized, actionable recommendation tailored to a teacher, parent, or principal.
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## 3. Knowledge Base & Data Processing Strategy
|
| 55 |
+
|
| 56 |
+
### Selected Best-Practice Documents
|
| 57 |
+
The knowledge base was built from the primary source and five additional high-quality, evidence-based resources:
|
| 58 |
+
|
| 59 |
+
1. **Freshman On‑Track Toolkit (2nd Edition)** (Network for College Success, 2017)
|
| 60 |
+
2. **17 Quick Tips for Your Credit Recovery Program** (Edmentum, 2024)
|
| 61 |
+
3. **Handout: Strategies to Address Chronic Absenteeism** (IES, REL Southwest, 2025)
|
| 62 |
+
4. **High-Quality Tutoring: An Evidence-Based Strategy...** (IES, 2021)
|
| 63 |
+
5. **WWC Intervention Report: Check & Connect** (IES, What Works Clearinghouse, 2015)
|
| 64 |
+
6. **Early Intervention Strategies...** (Attendance Works, 2019)
|
| 65 |
+
|
| 66 |
+
### Data Processing Strategy
|
| 67 |
+
|
| 68 |
+
> **_Strategic Pivot Summary_**
|
| 69 |
+
> My initial plan involved complex programmatic PDF extraction. I pivoted to a manually curated `knowledge_base_raw.json` file, a decision driven by the "Bias for Action" principle. This approach guaranteed high-quality data, de-risked the project, and allowed me to focus on building a more effective core RAG pipeline.
|
| 70 |
+
|
| 71 |
+
**Final Processing Approach**:
|
| 72 |
+
- **Manual Curation**: Key interventions were manually extracted from all source documents into a single, high-quality `knowledge_base_raw.json`.
|
| 73 |
+
- **Semantic Chunking**: A script groups the raw data by `concept` (e.g., "Intervention: Mentoring") to create meaningful, coherent chunks for embedding. This is more effective than chunking by arbitrary word counts.
|
| 74 |
+
- **Content Preparation**: The title is prepended to the content for each chunk (`"Title: {concept}. Content: {content}"`) to improve the contextual richness of the embeddings.
|
| 75 |
+
|
| 76 |
+
---
|
| 77 |
+
|
| 78 |
+
## 4. AI as a Co-pilot: A Human-Directed Workflow
|
| 79 |
+
|
| 80 |
+
My approach to AI collaboration treats large language models as strategic partners, with the human acting as the director and critical thinker. This involves a structured, iterative dialogue rather than simple prompting.
|
| 81 |
+
|
| 82 |
+
### Strategic Planning & Ideation
|
| 83 |
+
The project and implementation plans were developed through an iterative, multi-model process.
|
| 84 |
+
- **Initial Drafting:** I engaged both Gemini Pro and Claude Sonnet to generate independent approaches for structuring the project and tackling the core tasks.
|
| 85 |
+
- **Iterative Refinement:** I then orchestrated a dialogue between the models, using prompts like *"What do you think of this take?"* to have each model critique the other's feedback. This iterative loop allowed me to synthesize their strengths and converge on a robust, detailed plan.
|
| 86 |
+
|
| 87 |
+
### Core Technique: Active Context Management
|
| 88 |
+
Throughout the collaboration, I carefully managed the conversational context to ensure high-quality, relevant outputs.
|
| 89 |
+
- **Preventing Confusion:** I actively curated the chat history to avoid "muddying the results." If multiple versions of code or text were present, I would remove obsolete versions from the context window to prevent the model from referring to the wrong information.
|
| 90 |
+
- **Tool-Specific Workflows:** I leveraged the unique features of different browser-based interfaces. **Claude.ai's** "Artifacts" feature was invaluable for creating and editing planning documents. **Google's AI Studio** offered a significant advantage with its ability to fork conversations and delete individual messages from the context window, enabling precise context control.
|
| 91 |
+
|
| 92 |
+
### Foundational Best Practices
|
| 93 |
+
This AI-driven workflow is built on a foundation of solid engineering hygiene. The project was initiated from a pre-configured template with standard tooling (`ruff`, `uv`, `.gitignore`), ensuring a clean and maintainable codebase from the start.
|
| 94 |
+
|
| 95 |
+
This creates a **virtuous cycle of code quality**. By starting with and consistently adding well-structured code, that uses best practices, the context window provided to the AI is enriched with high-quality exemplars. The model's in-context learning capabilities mean it, in turn, generates new code that adheres to these established patterns, further elevating the quality baseline. This compounding effect is a deliberate strategy to maintain a high standard of maintainability and robustness throughout the development lifecycle.
|
| 96 |
+
|
| 97 |
+
---
|
| 98 |
+
|
| 99 |
+
## 5. Success Metrics & Production Path
|
| 100 |
+
|
| 101 |
+
**PoC Success Criteria (Achieved)**:
|
| 102 |
+
- ✅ Accurate retrieval of the most relevant interventions for sample student narratives.
|
| 103 |
+
- ✅ Persona-based output is clear, actionable, and tailored to the audience.
|
| 104 |
+
- ✅ Sub-second response time for the entire RAG pipeline.
|
| 105 |
+
- ✅ All recommendations are grounded in evidence, with source documents and relevance scores displayed.
|
| 106 |
+
- ✅ Project is fully documented, tested, and deployed as a live, interactive web application.
|
| 107 |
+
|
| 108 |
+
**Production Evolution Path**:
|
| 109 |
+
1. **Enhanced Knowledge Base**: Scale the knowledge base to include a wider range of interventions.
|
| 110 |
+
2. **Formal REST API**: Package the final logic into a production-ready REST API (e.g., using FastAPI and Docker) for robust integration with School Information Systems (SIS).
|
| 111 |
+
3. **Feedback Loop & Analytics**: Add a mechanism for educators to rate the usefulness of recommendations and build an analytics dashboard to track intervention effectiveness.
|