PythonIntermediateApplied AI EngineerForward Deployed EngineerApplied AI Architect
RAG service with permissions and citations
Ingest docs, retrieve with hybrid BM25 plus embeddings behind a per-user permission filter, and have Claude answer only from cited chunks or refuse.
Locked
The code is part of the full course
The file map and notes are open to everyone. Get lifetime access to every template's source, the .zip download and all four tracks for a one-time $249.
Run it
shell
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # add ANTHROPIC_API_KEY
python -m app.main ingest
python -m app.main search "who approves a 350 USD refund" --user bob # offline, no key
python -m app.main ask "who approves a 350 USD refund" --user bob
uvicorn app.api:create_app --factory --port 8000
python -m evals.retrieval_eval --min-recall 0.8Test it
shell
pytest -qOffline: no API key or network needed.
Taught in
- Module 7 Retrieval-Augmented Generation (RAG)
- Module 7 Exercise: Help-Center Answers with Citations
- E3 Retrieval Architecture Choices
- E3 Exercise: A Chunker and BM25 From Scratch
- E3 Exercise: Hybrid Retrieval With Rank Fusion and Filters
- E3 Measuring Retrieval
- E3 Exercise: Grounded Answers With Verified Citations
- E9 Native Citations: What the API Guarantees
- E6 Design It: Document Q&A at p95 Under 2 Seconds
- A6 Reference Architecture: Enterprise Knowledge Assistant