← All templates
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.8

Test it

shell
pytest -q

Offline: no API key or network needed.

Taught in