Decoding Data Science | AI Accelerator Bootcamp | CPD UK | 9th edition | 27 to 29 Nov 2026

AI Accelerator Bootcamp Project 9
AI HR Enterprise Project

One company, one topic: leave at DDS. See how a PDF becomes chunks, how chunks become vectors, how a question finds its answer, and what each choice costs. Every lab on this page runs in your browser.

4documents (PDF)
1SQLite database
100employees
273leave requests
13policy chunks (by section)
3agent tools
01 | The whole journey

From PDF to answer

Click a step. The dashed step is the optional move from memory to a hosted vector database (Pinecone, notebook Day 2B, take-home).

02 | Simulations

Labs

Change a setting and watch what happens. Labs marked "toy" use a simplified model so the idea is visible. They never pretend to be a real model.

Chunking lab

The real DDS Leave Policy v2 text (about 11,000 characters). The amber band is the notice table in section 3.4 (7, 14 and 30 days). If a chunk boundary cuts through it, the bot may read only part of the table.

Sizes here are in characters. LlamaIndex counts tokens (about 4 characters each) and cuts at sentence ends. This lab cuts at exact characters, so counts differ a little from the notebook.

Retrieval and top_k lab (toy)

A question is compared with every chunk. The best top_k chunks go to the model. This toy retriever uses keywords plus a few synonyms so you can see the ranking. Real OpenAI embeddings understand meaning far better.

Embeddings and dimensions lab

An embedding is a list of numbers. The number of numbers is the dimension. The vector database index must use the same dimension as the embedding model.

Phrases with similar meaning sit close together, even without shared words. The bot finds "annual leave" for a "vacation days" question because they are neighbours.

Agent router lab

An agent reads the question, picks the tool, reads the result and writes the answer. Employee data below is real, from dds_leave.db. The reply text is a simulation of what DecoBot is told to say, not a live OpenAI call.

Today in the simulation is 2026-11-29. Notice rule: 1-2 working days need 7 calendar days, 3-9 need 14, 10 or more need 30.

RAG failure modes lab

Five problems every enterprise RAG meets. Pick one, read the failure, then switch the fix on. The retrieved chunks are scripted from the real DDS policy so you can see the idea without an API key. The notebook (Day 2, Part E) runs the real thing.

Which LLM do we plug into the notebooks?

Model list and prices checked on 27 Nov 2026 for AI Accelerator Bootcamp 9. Prices are US dollars per 1 million tokens, standard tier. Models and prices change often, so confirm on the provider page before you budget.

Class pick | OpenAI notebooks

gpt-5.4-mini

The model the notebooks were built and tested with. $0.75 in, $4.50 out. Cheaper newer option: gpt-6-luna at $0.10 in, $0.50 out.

Class pick | Gemini notebooks

gemini-3.8-flash

Stable Flash model. $0.75 in, $3.75 out until 31 Dec 2026, then $1.50 and $7.50. The newest family is gemini-4-argon.

Embeddings

One model per index

text-embedding-3-small ($0.02) for OpenAI, gemini-embedding-001 ($0.15) for Gemini. Never mix them in one index: the vector sizes differ.

Dates that matter this week: Gemini 4 Argon rises from $2/$10 to $4/$20 on 1 Dec 2026. Gemini 3.8 Flash rises to $1.50/$7.50 on 1 Jan 2027. Use the price window in the Cost calculator tab.
OpenAI notebooks  (Step 3 / setup cell)
MODEL = "gpt-5.4-mini"        # class default
MODEL = "gpt-6-luna"          # cheapest current option
MODEL = "gpt-6.2-sol"         # stronger, for the hard SQL questions
EMBED_MODEL = "text-embedding-3-small"

Gemini notebooks  (setup cell)
MODEL = "gemini-3.8-flash"    # class default
MODEL = "gemini-4-argon"      # newest family
MODEL = "gemini-3.5-flash-lite"   # cheapest stable
EMBED_MODEL = "gemini-embedding-001"
Before class: change the model name in one notebook, run it top to bottom once, and check that LlamaIndex accepts the name. If it complains about an unknown model, run pip install -U llama-index-llms-openai (or llama-index-llms-google-genai). The reasoning_effort setting in the OpenAI notebooks was tested on gpt-5.4-mini only. Gemini bills thinking tokens as output, so keep thinking low for the chatbot.
Naming note: GPT-5.4 is an OpenAI model and Gemini is a separate Google family (3.x and 4). There is no Gemini 5.4.
Sources: OpenAI developers pricing and models pages, Google AI for Developers models and pricing pages, and price trackers (benchlm, cloudzero, morphllm) for Terra, Luna and the Gemini 3.8 and 4 rates that the official pricing pages did not show clearly.

Cost calculator

Pick an OpenAI or Gemini model, a price window and the usage. Prices are US dollars per 1 million tokens, checked on 27 Nov 2026, and every price box is editable. This is a planning estimate, not an invoice.

input tokens  = calls x (system 330 + tools 400 + question 30)
              + top_k x chunk tokens + tool output 150 x (calls - 1)
output tokens = answer 120 + 40 x (calls - 1)
cost / question = input x in-price + output x out-price
embedding (one time) = chunks x chunk tokens x embedding price / 1M
vector storage = vectors x dimensions x 4 bytes
Assumptions are rounded teaching values. Real usage depends on your prompt length and how often the agent loops.
03 | The data

Four documents and one database

Documents hold rules. The database holds personal numbers. All data is synthetic, made for training.

The database: dds_leave.db

Table | 100 rows

employees

One row per person, with leave balances already computed from the requests.

Table | 273 rows

leave_requests

One row per request. Links to employees by employee_id. One employee has 1 to 5 requests.

Link

employee_id

leave_requests.employee_id points to employees.employee_id. The same key joins the tables in SQL.

Requests by leave type
Requests by status
Employees by department
Annual days remaining (100 employees, average 14.5)

Demo cast

Quality checks

Passed (0 issues)

Duplicate employee ids. End before start. Requests for unknown employees. Zero or negative working days. Remaining days that do not add up.

Worth a look

6 requests are dated after the simulated today (2026-11-29). 9 approved requests overlap an earlier one for the same person. Synthetic data, so we note it.

Rule of the data

Working days are Monday to Friday, no public holidays removed. Approved and started by 29 Nov 2026 means used. Approved and later means booked. Pending, Rejected and Cancelled do not count.

04 | Data dictionary

Every column explained

05 | Glossary

Words you will hear

06 | The stack

What each tool does

07 | Putting it online

Colab to a live website

Teach in Colab. Publish on Hugging Face Spaces. Render is the optional second home.

Hugging Face Spaces
  1. Create a new Space. Choose the Gradio SDK.
  2. Upload app.py, requirements.txt, and the data folder (PDF and database).
  3. In Settings, add secrets OPENAI_API_KEY and PINECONE_API_KEY.
  4. The Space builds on its own. Open the link and test with the demo employees.
Render (optional)
  1. Push the project to GitHub. The real keys must never be in the repository.
  2. In Render choose New, then Web Service (or Blueprint with render.yaml).
  3. Build: pip install -r requirements.txt. Start: python app.py.
  4. Add the two keys under Environment. Free plans sleep when idle, so the first load can be slow.
Moving the policy search from memory to Pinecone
from pinecone import Pinecone
from llama_index.core import VectorStoreIndex
from llama_index.vector_stores.pinecone import PineconeVectorStore

pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
store = PineconeVectorStore(pinecone_index=pc.Index("dds-leave-policy-nov26"))
index = VectorStoreIndex.from_vector_store(store)      # no embedding at start-up
policy_engine = index.as_query_engine(similarity_top_k=3, text_qa_template=qa_prompt)
08 | The program

Three days, one assistant

Fri 27 Nov | 6:30 PM | 2 hours

Day 1: Control the AI

Clarity Canvas (user, latest policy, owner), system prompt, the latest-policy experiment, clear questions, Prompt Clinic.

Sat 28 Nov | 11 AM | 2 hours

Day 2: Give it the policy

Embeddings, RAG with LlamaIndex, chunking lab, and five RAG failure modes with fixes. Optional take-home: Day 2B puts the same index in Pinecone.

Sun 29 Nov | 3 PM | 2 hours

Day 3: Data and tools

SQL, three read-only tools, a FunctionAgent, five scenes, bad tool descriptions.

FileUse
Day1_System_Prompt_and_Clarity.ipynbColab, no files
DecoBot_Prompt_Lab.htmlBrowser playbook, no key. Clarity Canvas, prompt and tool descriptions, scored out of 50
DecoBot_RAG_Playbook.htmlBrowser playbook, no key. Chunking playground, latest-policy lab, failure clinic, knowledge ops
Day2_RAG_and_Chunking.ipynbColab, upload the PDF. Index in memory
Day2B_RAG_with_Pinecone.ipynbOPTIONAL take-home, not taught in class. Same index in Pinecone. Needs OPENAI_API_KEY and PINECONE_API_KEY
Day3_SQL_Tools_and_Agent.ipynbColab, upload the PDF and dds_leave.db
DDS_Leave_Policy_v2.pdfThe policy, DDS-HR-POL-001 v2.0, effective 1 July 2026
dds_leave.db / build_database.pyThe database and the script that rebuilds it
Day1, Day2, Day3 decks and the 3-slide overview17, 18, 17 and 3 slides, click animation on every box
09 | Honest limits

What to know before class

Untested live

The OpenAI and Pinecone calls were not run end to end by the builder. Run each notebook once with your own keys before class, especially the new failure modes lab in Day 2.

Policy quirks

The policy does not define the probation period (the handbook only says "as stated in the employment contract"). Section 1 points to 4.4 for extended illness, but the content is in 5.4.

Not security

A prompt that says "refuse other people's data" is not security. A real site needs company login and tools locked to the signed-in employee.

Prices move

Model prices change. The calculator is a planning tool, not an invoice. Check the OpenAI pricing page before you budget.