Project 3 - RAG based AI Teaching Assistant · Lesson 1 of 1
Project 3 - RAG based AI Teaching Assistant
Design a source-grounded assistant that indexes approved transcripts, retrieves relevant chunks, and returns citations.
Lesson
1. Introduction
A retrieval-based teaching assistant can help learners locate relevant moments in a collection of lessons. Its usefulness depends on transcript quality, chunk boundaries, retrieval accuracy, and citations—not only on the fluency of the generated response.
2. Core concepts
A pipeline can transcribe permitted audio, retain timestamps, split text into chunks, attach video and time metadata, embed chunks, retrieve candidates, and construct an evidence-bounded prompt. Bulk processing needs progress tracking and recovery so long jobs do not restart from the beginning.
3. Topics covered in this module
- Project scope, transcription, Whisper, audio conversion, and timestamps
- Chunking, metadata, JSON records, batch embeddings, and tabular inspection
- Similarity search, top-k retrieval, prompt construction, and citations
- Evaluation, failure recovery, progress logs, privacy, and README documentation
4. Syntax and how to read it
chunk = {
'video_id': 'lesson-01',
'start_seconds': 42.5,
'text': 'A function groups reusable instructions.',
}
assert chunk['start_seconds'] >= 0Stable identifiers and timestamps make a result traceable to its source. Keep only media and transcript material you are permitted to process.
5. Practical workflow
Process one sample video end to end first, validate transcript timestamps, inspect chunk boundaries, and test retrieval against known questions. Only then scale batches; save checkpoints and evaluate whether cited chunks support answers.
6. Common mistakes
- Ignoring transcription errors or losing timestamps during chunking.
- Treating top similarity matches as guaranteed evidence or indexing material without permission.
7. Best practices
- Keep processing idempotent, checkpoint batches, and log safe progress metadata.
- Evaluate retrieval and groundedness using questions with known supporting passages.
8. Practice task
A retrieved chunk is similar to the question but does not contain the answer. What should the assistant do?
9. One possible solution
It should avoid inventing an answer, state that retrieved evidence is insufficient, and provide citations only for claims the chunks support.10. Summary
Design a source-grounded assistant that indexes approved transcripts, retrieves relevant chunks, and returns citations. Keep processing idempotent, checkpoint batches, and log safe progress metadata. Evaluate retrieval and groundedness using questions with known supporting passages.
11. What comes next
The next module, Conclusion, builds on this foundation and applies it to a new part of the analytics workflow.
Visual guide
A reliable Project 3 - RAG based AI Teaching Assistant workflow
-
Step 01
Frame
Define the question, input scope, and intended output.
-
Step 02
Work
Apply the method and validate assumptions as you go.
-
Step 03
Check
Compare results with known cases and communicate limitations.
Code examples
text = 'Functions organize reusable instructions.'
video_id, start = 'lesson-01', 42.5
chunks = [{'text': text, 'source': video_id, 'start': start}]
assert all(item['source'] and item['start'] >= 0 for item in chunks)
Checks each chunk has a source identifier and non-negative start time.
citation = {'video': 'lesson-01', 'time': '00:42'}
answer = {'text': 'A function groups reusable instructions.', 'citations': [citation]}
print(answer['citations'][0]['time'])
00:42
Key points
- Design a source-grounded assistant that indexes approved transcripts, retrieves relevant chunks, and returns citations.
- Keep processing idempotent, checkpoint batches, and log safe progress metadata.
- Evaluate retrieval and groundedness using questions with known supporting passages.
Check your understanding
Practice
Your learning progress