Sample code for the Agentic Coding with Claude Code course by Tertiary Courses.
Live Demo: https://alfredang.github.io/C1382-Agentic-Coding-with-Claude-Code/
A Retrieval-Augmented Generation chatbot for course materials, powered by the Claude Agent SDK. It loads course documents, builds a vector store with ChromaDB, and provides intelligent Q&A with source attribution — all authenticated through your Claude Code subscription (no API key needed).
Features: Dark/light theme toggle, sidebar with course listing and quick-start prompts, markdown-rendered responses with source attribution, session-based conversation history.
- Python 3.13+
- uv — Python package manager
- Claude Code CLI — installed and authenticated (
npm install -g @anthropic-ai/claude-code, thenclaudeto log in)
git clone https://github.com/alfredang/rag-claude-code-starting.git
cd rag-claude-code-starting
uv syncImportant: Do NOT set
ANTHROPIC_API_KEYin your environment or.envfile. The Claude Agent SDK authenticates via the Claude Code CLI's OAuth token. Setting an API key will override this and cause errors.
./run.shOr manually:
cd backend
uv run uvicorn app:app --reload --port 8002Open http://localhost:8002 in your browser.
- Course documents (
.txtfiles indocs/) are parsed into sentence-aware chunks and stored in ChromaDB - When a user asks a question, the Claude Agent SDK spawns a Claude instance with an MCP server exposing a
search_course_contenttool - Claude decides when and how to search the vector store, enabling multi-turn reasoning over results
- Responses include source links back to specific course lessons
Place .txt files in the docs/ directory following this format:
Course Title: [name]
Course Link: [URL]
Course Instructor: [name]
Lesson 0: [title]
Lesson Link: [URL]
[content...]
Lesson 1: [title]
[content...]
Documents are automatically loaded on server startup.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/query |
Send a question, get an answer with sources |
POST |
/api/new-chat |
Start a new conversation session |
GET |
/api/courses |
Get loaded course stats |
- Claude Agent SDK — LLM integration via Claude Code CLI OAuth
- FastAPI — Backend API server
- ChromaDB — Vector database for semantic search
- Sentence Transformers (
all-MiniLM-L6-v2) — Text embeddings - Vanilla HTML/JS/CSS — Frontend (no build step)
