Coding Rabbit: The AI Teaching Assistant for C++ Courses and beyond
Problem & Motivation:
Generative AI has made it easier than ever for programming students to obtain a working solution. But completing an assignment is not the same as learning how to solve the next problem. When an AI assistant immediately rewrites a loop, repairs a pointer, or generates an entire function. Students can bypass the productive struggle in which they develop mental models, debugging habits, and independent problem-solving skills.
This risk is especially important in introductory C++, where students must learn both how to program and how a computer manages memory, pointers, control flow, and data structures. At the same time, instructors and teaching assistants cannot provide immediate, individualized support whenever a student becomes stuck, particularly when normal office hours are no longer available.
Coding Rabbit, developed by the team, is a pedagogy-first AI teaching assistant designed to provide immediate, course-grounded C++ support without becoming an answer generator. Instead of completing the task for the student, it aims to provide the smallest useful intervention that keeps the student reasoning: the next step, not the answer.
Drawing on Vygotsky’s Zone of Proximal Development, which is the gap between what a learner can do alone and what they can do with guidance, Coding Rabbit assesses whether a student is conceptualizing, implementing, refactoring, or debugging. From this assessment, it applies a learning scaffold, such as a diagnostic question. When the student remains stuck, the assistant can progress to a visual explanation and when necessary, a narrowly targeted syntax suggestion. The complete solution remains outside the scaffold ladder.
Data Source & Data Science Approach:
Coding Rabbit combines educational content, student interaction data, code context and training examples.The retrieval corpus includes introductory programming materials from MIT OpenCourseWare and Harvard’s CS50, C++ Core Guidelines and reference materials. Instructors can also provide syllabus, slides, readings, coding practices, and assignment instructions by uploading them in the coding rabbit portal. To train our models, we generated synthetic question-and-answer pairs that simulate interactions between teaching assistants and students. The dataset was designed to align with our pedagogical framework, ensuring that TA responses are tailored to each student's cognitive state and provide an appropriate level of scaffolding. These conversations serve as the evaluation set for our RAG experiments and the development of the project’s pedagogical evaluation rubric.
The deployed system is based on the AWS ecosystem and uses a curriculum constrained retrieval augmented generation (RAG) pipeline. Course documents are stored in Amazon S3, registered and versioned in Aurora’s SQL database, processed asynchronously by an ECS Fargate ingestion worker, and embedded into Qdrant vector database. Retrieval is restricted to the student’s course content so that the assistant grounds its guidance in material rather than unrestricted internet knowledge. Additionally, the retrieval is restricted to course material as of the current week to avoid bringing in complex concepts not yet covered.
GitHub Codespaces provides each student with the same preconfigured development environment in the browser. The course repository defines the required C++ compiler, dependencies, assignment files, VS Code settings, and Coding Rabbit extension, so students do not need to install or configure tools on their own computers. This gives instructors a controlled and reproducible environment in which the extension can access the student’s active code, cursor position, compiler output, and terminal history using a consistent setup. It also reduces differences caused by operating systems or local configurations, simplifies onboarding and beta testing, and allows each course or assignment to use an approved repository, branch, and set of tools.
When a student asks for help through the VS Code extension in github spaces, Coding Rabbit receives the question along with relevant code, cursor context, recent terminal output, course, assistance mode, and session information. A thin orchestration layer resolves the student and course context, enforces input policies, retrieves relevant instructional material, assembles a grounded prompt, selects an inference route, and validates the response before returning it to the student. Aurora manages identity, course membership, sessions, and interaction metadata, while Qdrant provides course-scoped semantic retrieval.
Coding Rabbit also treats code as data. Static structural signals, code and cursor context, compiler output, and runtime state help the system distinguish between conceptualizing, implementing, refactoring, and debugging. This allows the assistant to select an appropriate form and intensity of support rather than responding only to the student’s natural-language question. Deterministic C++ feature extraction and AST-derived facts anchor the model to the objective state of the student’s program and reduce unsupported diagnoses.
Finally, the system applies defense-in-depth guardrails. Deterministic input rules screen direct answer-seeking and prompt-manipulation attempts before retrieval. Post-generation checks combine rules and semantic classification to detect code leakage, complete solutions, toxicity, and other unsafe outputs. Different failures receive different recovery actions: leaked solutions are regenerated, while unsafe content is removed and replaced.
Data Privacy & Safety
Data privacy and safety are a central component of Coding Rabbit’s design. Students provide an affirmative consent to have their data stored for the duration of the course and can withdraw their consent at any time. Once the course is over, their data is removed from the system. Data is viewable only by those with proper access. A student can see their own analytics and a professor can view only information for their section. Administrators are prevented from seeing which students have left feedback about Coding Rabbit but are still able to monitor the content so they can be aware of any issues with model performance. Students are able to raise a red flag if they have any concerns with their Coding Rabbit experience. This must be acknowledged by their professor so they can take appropriate action.
Evaluation:
Evaluation is provided for the students, professors and administrators.
Pedagogical Evaluation
Students can monitor their own progress, understanding how much time they are spending in chat vs. writing code. They can track their cognitive progression over the duration of the semester and see where they might be having difficulties. Similarly professors are able to monitor the progress of their students and adjust their pedagogy if they observe students struggling with the homework set.
System Evaluation
Professors and administrators can evaluate how Coding Rabbit itself is performing using an offline LLM-as-Judge to apply deterministic checks and augmented with human evaluation. We use a binary classification approach where 1 is pass and 0 is fail scores are produced. If a metric was not applicable, it received a score of “NA”. Several metrics are used across four main categories: pedagogy, correctness, RAG grounding, and safety.
- Pedagogy: Measures teaching quality by evaluating the use of scaffolding and guiding the student toward the answer and not providing a direct solution.
- Correctness: Measure accuracy by checking if the TA is providing correct C++ information
- RAG grounding: Measures the retrieval quality by seeing if the course material that was fetched was relevant and used appropriately in grounding answers.
- Safety: Measures the guardrails and sees if input/output filters are correctly blocking unsafe content.
The unique approach we took for evaluation was the per-reply and per-conversation evaluation of the Coding Rabbit. This approach allows us to pinpoint at what point in the conversation the AI TA begins to diminish in quality. Also provide insights at what point a student begins to become frustrated through a conversation. While also evaluating the overall effectiveness of the session as a whole.
Looking at the overall evaluation it is clear that generally most categories are showing over 90% effectiveness. RAG grounding is at 82% primarily driven due to lower context retrieval precision. We have implemented several corrections from our beta and look forward to reviewing updated results with additional user testing.
Overall Evaluation:
Key Learning & Impact:
Our first key learning is that AI assisted pedagogy relies on a systemic approach beyond static prompt engineering.. We found that a reliable educational assistant requires a comprehensive pedagogical state that includes course constraints, code evidence, retrieval, guardrails, and evaluation to work together. The system must know what the student has been taught, where the student appears to be stuck, and how much assistance has already been provided.
Our second key learning is that guardrail design requires balancing safety with learning. During live testing, the input CodeBERT classifier incorrectly blocked valid requests such as “compile,” “check the code,” and “works.” Because excessive blocking can interrupt legitimate learning, the final input guardrail uses high-confidence deterministic rules, while the classifier is retained only for monitoring. Output safety requires a layered approach because generated responses can reveal code, provide direct answers, or include unsafe content. The final output guardrail therefore combines deterministic rules with semantic classification. Code leakage triggers regeneration, while toxic content is removed and replaced. Effective educational safety must protect academic integrity without blocking useful Socratic guidance.
Third, retrieval quality depends not only on how much information is in the knowledge base, but also on how selectively that information is used. Adding C++ guidelines and C++ reference content improved recall and was necessary for providing citations in RAG responses. However, these references can dominate the retrieved context and crowd out course-specific material when fetched too broadly. To keep the citation benefits without overwhelming the course content, we applied two adjustments: triggering C++ reference retrieval only when relevant, and raising the score threshold for guideline/reference chunks so lower-value results are filtered out earlier.
Beta testing also surfaced an issue that was not visible in our synthetic training transcripts: retrieval often failed on follow-up questions in real conversations. These failures were largely caused by missing conversational context. In practice, a student’s follow-up often depends on earlier turns, the current code, or the current terminal state, while the latest message alone may be too short or ambiguous for retrieval. To address this, we expanded the retrieval query to include relevant previous conversation turns as well as the current code and terminal state, instead of relying only on the most recent student message.
Finally, educational impact extends beyond the student-facing chat. Students can review their own progress, instructors can identify concepts and cognitive stages where a class repeatedly needs support, and administrators can manage courses and system health. The platform uses role-aware access, professor-scoped feedback, accountable safety workflows, and reversible student consent to make privacy part of the product architecture.
Coding Rabbit does not attempt to replace instructors or teaching assistants. It extends their reach by providing immediate, judgment-free support between scheduled office hours while preserving instructor control over curriculum, academic-integrity boundaries, and the pace at which concepts are introduced.
Acknowledgements:
We extend our gratitude to:
Subject matter experts: John DeNero , Ashley Herrera, Matthew Wagner.
Beta testers: Ashley Herrera, Koreen Paterson , Jonathan Mowat, Kevin Guan.
Privacy and security: Rekha Venkatakrishnan
Berkeley Instructors: Joyce Shen and Korin Reid
Family and friends who supported us throughout this journey,
Go Bears!
