| name | rag-over-course-content |
| description | Use when building AI assistant for course-specific knowledge. RAG = retrieve relevant content + generate response.
|
RAG Over Course Content
RAG (Retrieval-Augmented Generation): index course content → search → use as context → generate. Course-aware AI.
RAG architecture
- Embed course content — turn into vectors
- Vector database (Pinecone, Weaviate, Chroma)
- Student question — convert to vector
- Similarity search — find relevant content
- Pass to LLM — context for response
- LLM generates — informed by retrieved content
Implementation steps
- Chunk course content — into 200-500 token segments
- Embed each chunk — using embeddings model (text-embedding-3-small)
- Store in vector DB
- Build query function — embed query, search
- Inject context into prompt — top 3-5 chunks
- Generate response — using LLM
Quality factors
- Chunk size — too small loses context; too large loses precision
- Embedding model quality — varies
- Search relevance — return truly related content
- Citation in response — point to source
- Refresh frequency — when content updates
Where this fits in the X3 empire
RAG implementation for CardPrepAI Academy AI assistant.