5 Hands-On AI Projects for Data Analysts in 2026
Reading about AI is fun. Building with it is where the learning really happens! The fastest way to grow as a data person is to pick a real problem, open a notebook and get your hands dirty.
I work with data every day as a Data Research Analyst, and the projects that taught me the most were never the ones I only read about. They were the ones that broke, made me debug for an hour and then finally clicked. Each project helps you connect a new idea to something you already know.
If you are coming from data analysis (Excel, SQL, Python, Power BI) and want to step into AI and LLMs, here are five hands-on projects, ordered from easiest to hardest. The tools in this space change every few months, so everything below is based on what is current at the end of 2026. Prompt engineering matters a lot too, but I will leave it for another post.
Here is the plan for today
- What makes a good AI project?
- Project 1: Build a RAG assistant that answers questions about your reports
- Project 2: Build an AI data analyst agent that writes and runs SQL
- Project 3: Train a tiny GPT on financial news headlines
- Project 4: Fine-tune ModernBERT to classify customer feedback
- Project 5: Evaluate your AI system like an analyst
What makes a good AI project?
AI is not as new as it feels. The term “artificial intelligence” was coined for the Dartmouth workshop in 1956, and ideas like neural networks are even older. What changed in the last few years is the scale: huge datasets, cheap GPUs and the transformer architecture from the 2017 paper “Attention Is All You Need”. Today, when people say “AI”, they usually mean generative AI, which sits inside machine learning and deep learning.
When I choose a learning project, I look for three things:
- Core concepts: it should teach an idea you will meet again and again (embeddings, tokens, training, fine-tuning).
- A working product: you should end up with something you can demo, not just a notebook cell that printed “done”.
- Evaluation: you should be able to measure whether it is good, and improve it. This is where data analysts have a real advantage!
Project 1: Build a RAG assistant that answers questions about your reports
Imagine you have a folder full of PDF reports (annual reports, market research, internal dashboards exported as PDF) and you are tired of searching through them by hand. A RAG assistant lets you ask “What drove revenue growth in Q3?” and get an answer with the source page.
>>> What will you build?
A small app that takes your question, finds the most relevant passages in your documents, and asks an LLM to answer using only those passages.
>>> Skills you will learn
- How Retrieval Augmented Generation (RAG) works
- Splitting documents into chunks
- Creating vector embeddings with an open-source model
- Storing and searching embeddings in a vector database (Chroma, Qdrant or pgvector)
- Combining retrieved context with an LLM to answer questions
>>> Core concepts
What is RAG?
Say you want to know when a company was founded. Instead of trusting the model’s memory, you first look up the company’s profile (Retrieval), paste it into the prompt (Augmented) and let the model write the answer (Generation). That is the whole idea!
LLMs only know what was in their training data, and they can confidently make things up when asked about something they have never seen. RAG gives the model your own up-to-date documents as context, which makes answers more accurate and lets you show where each answer came from.
The usual flow looks like this:
- Chunk: split each document into small pieces (for example 500 to 1,000 characters).
- Embed and index: turn each chunk into a vector and store it in a vector database.
- Retrieve: turn the user’s question into a vector and find the closest chunks.
- Generate: put the question and the retrieved chunks into the prompt and let the LLM answer.
Embeddings and vector databases
An embedding is a list of numbers that represents the meaning of a piece of text. Texts with similar meaning end up close to each other, a bit like two shops on the same street having similar map coordinates. That is why “revenue went up” and “sales increased” land near each other even though they share no words.
A vector database stores these lists of numbers next to the original text, so you can quickly find the chunks that are “closest” to a question.
In 2026 you do not need a paid API for good embeddings. Small open models such as Google’s EmbeddingGemma (about 300M parameters) or the Qwen3 embedding family run on a normal laptop and do well on the MTEB benchmark. Leaderboards are not the full story though, so always test a couple of models on your own documents.
>>> Implementation steps
Tech stack:
- LLM: Claude Opus 5.5 through the Anthropic Python SDK (any strong LLM works)
- Embedding model: google/embeddinggemma-300m with sentence-transformers
- Vector database: Chroma (Qdrant or pgvector are good alternatives)
- PDF reading: pypdf
- Front-end: Streamlit
Step 1: Set up the environment
pip install uv
uv pip install anthropic chromadb sentence-transformers pypdf streamlit
Step 2: Load and chunk your documents
from pathlib import Path
from pypdf import PdfReader
def load_chunks(folder, size=800, overlap=150):
chunks = []
for pdf in Path(folder).glob("*.pdf"):
for page_no, page in enumerate(PdfReader(pdf).pages, start=1):
text = page.extract_text() or ""
for start in range(0, len(text), size - overlap):
piece = text[start:start + size].strip()
if piece:
chunks.append({"text": piece, "source": f"{pdf.name}, page {page_no}"})
return chunks
chunks = load_chunks("reports/")
The overlap keeps a sentence that falls on the border of two chunks from being cut in half.
Step 3: Embed the chunks and store them in Chroma
import chromadb
from sentence_transformers import SentenceTransformer
embedder = SentenceTransformer("google/embeddinggemma-300m")
db = chromadb.PersistentClient(path="vector_store")
collection = db.get_or_create_collection("reports")
collection.add(
ids=[str(i) for i in range(len(chunks))],
documents=[c["text"] for c in chunks],
metadatas=[{"source": c["source"]} for c in chunks],
embeddings=embedder.encode([c["text"] for c in chunks]).tolist(),
)
Because we use a PersistentClient, the vectors are saved to the vector_store folder, so you only need to embed your documents once.
Step 4: Retrieve and answer
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
def ask(question, k=4):
hits = collection.query(
query_embeddings=embedder.encode([question]).tolist(),
n_results=k,
)
context = "\n\n".join(
f"[{meta['source']}]\n{doc}"
for doc, meta in zip(hits["documents"][0], hits["metadatas"][0])
)
response = client.messages.create(
model="claude-opus-5-5",
max_tokens=2000,
system="Answer only from the context. Cite the source in brackets. "
"If the answer is not in the context, say you don't know.",
messages=[{"role": "user", "content": f"Context:\n{context}\n\nQuestion: {question}"}],
)
return response.content[0].text
print(ask("What were the main drivers of revenue growth in Q3?"))
And that’s it! You now have an assistant that searches your own reports and answers with sources. Wrap the ask() function in a few lines of Streamlit and you have a demo you can show in an interview.
>>> Useful resources
- AI Engineering by Chip Huyen
- Chroma and sentence-transformers documentation
- The MTEB leaderboard on Hugging Face, for choosing an embedding model
Project 2: Build an AI data analyst agent that writes and runs SQL
This is my favourite project for analysts, because it mirrors our daily work. You ask a business question in plain English, and the agent explores the database, writes SQL, runs it, checks the result and explains the answer.
>>> What will you build?
An agent connected to a SQLite sales database. It can list tables, look at their columns and run read-only queries until it can answer your question, without you writing a single line of SQL.
>>> Skills you will learn
- What an agent is and how the agent loop works
- Tool (function) calling with an LLM
- Giving an agent safe, limited access to data
- Where frameworks like LangChain 1.0, LangGraph and MCP fit in
>>> Core concepts
What is an agent?
An agent is an LLM that can take actions in a loop. Given a goal, it decides which tool to use, looks at the result, and then decides what to do next. It keeps going until it has an answer.
In pseudocode:
action = llm.decide(goal)
while action is not "final answer":
result = run_tool(action)
action = llm.decide(goal, history + result)
return action
A good mental model is a junior analyst with access to the database. You give them a question, they check which tables exist, write a query, notice the numbers look odd, fix the join, and come back with the answer. The agent does the same, just faster.
Tools
A tool is a normal function with a clear name and description. The LLM never runs code itself. It asks to call a tool, your code runs it, and the result goes back to the model.
In 2026 there are several ways to wire this up. LangChain 1.0 (released October 2025) has a simple create_agent function built on LangGraph, and the Model Context Protocol (MCP) has become the standard way to plug tools like databases and file systems into many different AI apps. For learning, I prefer starting with the LLM provider’s own SDK, because you can see exactly what happens in each step.
>>> Implementation steps
Step 1: Define the tools
import sqlite3
import anthropic
from anthropic import beta_tool
DB = "file:sales.db?mode=ro" # open the database read-only
def query(sql):
with sqlite3.connect(DB, uri=True) as conn:
cur = conn.execute(sql)
cols = [c[0] for c in cur.description]
rows = cur.fetchmany(50)
return "\n".join([", ".join(cols)] + [", ".join(map(str, r)) for r in rows])
@beta_tool
def list_tables() -> str:
"""List all tables in the sales database."""
return query("SELECT name FROM sqlite_master WHERE type='table'")
@beta_tool
def describe_table(table: str) -> str:
"""Show the columns and types of one table.
Args:
table: Name of the table.
"""
return query(f"PRAGMA table_info({table})")
@beta_tool
def run_sql(sql: str) -> str:
"""Run a read-only SQLite SELECT query and return up to 50 rows.
Args:
sql: A single SELECT statement.
"""
try:
return query(sql)
except Exception as e:
return f"SQL error: {e}"
Two safety habits here: the database is opened in read-only mode, and the results are capped at 50 rows so the agent cannot flood its own context.
Step 2: Run the agent
The Anthropic SDK has a tool runner that handles the loop for us. It sends the question, runs any tool the model asks for, sends the result back, and stops when the model is done.
client = anthropic.Anthropic()
runner = client.beta.messages.tool_runner(
model="claude-opus-5-5",
max_tokens=16000,
system="You are a careful data analyst. Explore the schema before writing SQL. "
"Double-check numbers that look surprising, then explain the answer "
"in plain English and show the final SQL you used.",
tools=[list_tables, describe_table, run_sql],
messages=[{"role": "user", "content": "Which 3 product categories grew the most in 2025 compared to 2024?"}],
)
for message in runner:
for block in message.content:
if block.type == "text":
print(block.text)
Run it and watch the steps: the agent lists the tables, describes the orders and products tables, writes a query with a GROUP BY, and then explains the result. If a query fails, it reads the error and tries again.
Step 3: Add a simple interface
Put a Streamlit chat box in front of the runner and you have your own “chat with the database” app. A nice extra is a make_chart tool that saves a matplotlib chart, so the agent can answer with a picture.
>>> Useful resources
- Anthropic’s guide “Building effective agents”
- LangChain 1.0 and LangGraph documentation, to compare a framework approach
- The Model Context Protocol documentation
Project 3: Train a tiny GPT on financial news headlines
Projects 1 and 2 use a model someone else trained. This one opens the box. Training a small language model from scratch is the best way to understand what tokens, weights and loss actually mean.
The great news is that it is very approachable. Andrej Karpathy’s “Let’s build GPT: from scratch” video and his nanoGPT repository walk you through it step by step. In October 2025 he also released nanochat, a full pipeline that trains a small ChatGPT-style model end to end (tokenizer, pretraining, fine-tuning and a chat web UI) for around 100 dollars of rented GPU time. For a first project, though, nanoGPT on a laptop or a free Colab GPU is enough.
>>> What will you build?
A small word-level transformer that writes realistic-looking financial news headlines, like “Oil prices climb as supply concerns ease demand fears”. Fun, and close to the kind of data I work with every day!
>>> Skills you will learn
- What “training” a language model means in PyTorch
- Neural network basics: forward pass, loss, backpropagation, gradient descent
- Tokenization
- Key hyperparameters: n_layer, n_head, n_embd, block_size, learning_rate, max_iters
- Spotting overfitting with a validation set
>>> Core concepts
This section has a little math. If it feels heavy, skim it and come back after you have trained your first model.
How a neural network learns
Each input to a neuron has a weight. The neuron multiplies inputs by weights, adds them up, and passes the result through an activation function. Layers of these neurons pass their output forward until the last layer makes a prediction. That is the forward pass.
Then we compare the prediction with the real answer using a loss function. Backpropagation works out how much each weight contributed to the error, and gradient descent (in practice the AdamW optimizer) nudges every weight a little in the direction that lowers the loss. Repeat this millions of times and the model gets good at predicting the next token.
Before 2017, text models were mostly RNNs. The transformer replaced them with attention, which lets every token look at every other token in the context at once. It is the architecture behind every modern LLM.
Tokens
Models do not read words, they read tokens. A token is a piece of a word, and as a rule of thumb one token is about three quarters of an English word, so 1,000 tokens is roughly 750 words. The tiktoken library lets you see this for yourself:
import tiktoken
enc = tiktoken.get_encoding("gpt2")
print(enc.encode("Revenue increased")) # a short list of token ids
>>> Implementation steps
Step 1: Prepare the data
Collect a few thousand headlines into a CSV (from a public financial news dataset or an RSS feed you scrape yourself). Then encode them and split them into training and validation sets:
import numpy as np
import pandas as pd
import tiktoken
df = pd.read_csv("data/headlines/headlines.csv")
text = "\n".join(df["headline"].dropna())
split = int(len(text) * 0.9)
enc = tiktoken.get_encoding("gpt2")
train_ids = np.array(enc.encode_ordinary(text[:split]), dtype=np.uint16)
val_ids = np.array(enc.encode_ordinary(text[split:]), dtype=np.uint16)
train_ids.tofile("data/headlines/train.bin")
val_ids.tofile("data/headlines/val.bin")
print(f"train: {len(train_ids):,} tokens, val: {len(val_ids):,} tokens")
90% of the text is used for training and 10% is kept aside to check if the model really learned or just memorized.
Step 2: Configure a baby GPT
Clone nanoGPT, then create config/train_headlines.py:
out_dir = "out-headlines"
dataset = "headlines"
eval_interval = 250
eval_iters = 20
always_save_checkpoint = False # only save when validation loss improves
batch_size = 16
block_size = 64 # how many tokens the model sees at once
n_layer = 6
n_head = 6
n_embd = 384 # size of each token's embedding vector
dropout = 0.2
learning_rate = 1e-3
max_iters = 3000
lr_decay_iters = 3000
min_lr = 1e-4
warmup_iters = 100
Step 3: Train
python train.py config/train_headlines.py
Keep an eye on the training and validation loss. With a small dataset, the validation loss will usually start going up after a while, even though the training loss keeps going down. That is overfitting: the model is memorizing instead of learning. Note the iteration where validation loss was lowest and stop training there.
Step 4: Generate headlines
python sample.py --out_dir=out-headlines --start="Stocks"
The first results will be a bit funny, but you will be surprised how quickly the model picks up the style of real headlines.
>>> Useful resources
- “Let’s build GPT: from scratch, in code, spelled out” by Andrej Karpathy
- 3Blue1Brown’s neural networks series
- The nanoGPT and nanochat repositories on GitHub
Project 4: Fine-tune ModernBERT to classify customer feedback
Not every problem needs a giant chat model. For classification tasks (sentiment, topic, ticket routing), a small fine-tuned encoder model is faster, cheaper and often more accurate. This is a skill companies use every day.
>>> What will you build?
A model that reads customer reviews or support tickets and labels each one, for example as complaint, question, praise or refund request. Your dashboard can then show trends by category instead of a wall of text.
>>> Skills you will learn
- What fine-tuning is and when to use it
- Working with the Hugging Face datasets and Transformers libraries
- Training with the Trainer API
- Measuring a classifier with precision, recall and F1
>>> Core concepts
What is fine-tuning?
Fine-tuning means taking a model that has already learned general language from a huge amount of text, and training it a little more on your own labelled examples. The model keeps what it already knows and learns your specific task. It is like hiring an experienced analyst and teaching them your company’s KPIs, instead of training someone from zero.
Why ModernBERT?
BERT (2018) was the go-to model for classification for years. ModernBERT, released at the end of 2024 by Answer.AI and LightOn, is a modern rewrite of the same idea: it is faster, handles up to 8,192 tokens instead of 512, and gives better results on most tasks. It is fully supported in Hugging Face Transformers v5.
>>> Implementation steps
Step 1: Load your labelled data
You need a CSV with a text column and a label column. A few hundred examples per label is a good start.
from datasets import load_dataset
ds = load_dataset("csv", data_files="feedback.csv")["train"]
labels = sorted(set(ds["label"]))
label2id = {l: i for i, l in enumerate(labels)}
ds = ds.map(lambda x: {"label": label2id[x["label"]]})
ds = ds.train_test_split(test_size=0.2, seed=42)
Step 2: Tokenize
from transformers import AutoTokenizer
model_id = "answerdotai/ModernBERT-base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
def tokenize(batch):
return tokenizer(batch["text"], truncation=True, max_length=512)
ds = ds.map(tokenize, batched=True)
Step 3: Fine-tune
import numpy as np
from sklearn.metrics import f1_score
from transformers import AutoModelForSequenceClassification, Trainer, TrainingArguments
model = AutoModelForSequenceClassification.from_pretrained(
model_id,
num_labels=len(labels),
id2label={i: l for l, i in label2id.items()},
label2id=label2id,
)
def compute_metrics(pred):
preds = np.argmax(pred.predictions, axis=-1)
return {"f1": f1_score(pred.label_ids, preds, average="macro")}
args = TrainingArguments(
output_dir="modernbert-feedback",
learning_rate=5e-5,
per_device_train_batch_size=16,
num_train_epochs=3,
eval_strategy="epoch",
save_strategy="epoch",
load_best_model_at_end=True,
metric_for_best_model="f1",
)
trainer = Trainer(
model=model,
args=args,
train_dataset=ds["train"],
eval_dataset=ds["test"],
processing_class=tokenizer,
compute_metrics=compute_metrics,
)
trainer.train()
trainer.save_model("modernbert-feedback/best")
tokenizer.save_pretrained("modernbert-feedback/best")
Step 4: Use it
from transformers import pipeline
clf = pipeline("text-classification", model="modernbert-feedback/best")
print(clf("I was charged twice for my order, please send my money back."))
And that’s it! You have a model you own, that runs on your own hardware and costs nothing per prediction.
>>> Useful resources
- The Hugging Face LLM Course (formerly the NLP Course)
- The ModernBERT announcement post on the Hugging Face blog
- Philipp Schmid’s guide to fine-tuning ModernBERT for classification
Project 5: Evaluate your AI system like an analyst
This is the project most beginners skip, and the one that makes the biggest difference at work. Anyone can build a demo that works on three questions. The hard part is knowing whether it works on the 300 questions your users will actually ask.
The good news: evaluation is basically data analysis. You build a dataset, define metrics, measure, and dig into the failures.
>>> What will you build?
An evaluation set and a scoring script for the RAG assistant from Project 1 (the same idea works for the agent and the classifier).
>>> Skills you will learn
- Building a “golden” test set of questions and expected answers
- Retrieval metrics: hit rate and recall@k
- Answer quality metrics: correctness, faithfulness and relevance
- Using an LLM as a judge, and checking that the judge itself is reliable
- Tools like Ragas, DeepEval and promptfoo
>>> Core concepts
Evaluate each part separately
A RAG system can fail in two places. Either retrieval did not find the right chunk, or the LLM had the right chunk and still answered badly. If you only score the final answer, you cannot tell which one to fix. So measure both:
- Retrieval: for each test question, was the chunk that holds the answer in the top k results? (hit rate, recall@k)
- Generation: is the answer correct, is it supported by the retrieved context (faithfulness), and does it actually answer the question (relevance)?
LLM as a judge
Scoring hundreds of free-text answers by hand is slow, so a common approach is to ask a strong LLM to grade each answer against the expected answer. It works well, but treat the judge like any other model: grade 30 to 50 answers yourself, and check how often you agree with it before you trust its scores.
For the classifier in Project 4, the classic metrics still apply: a confusion matrix, precision, recall and F1 per label. For the tiny GPT in Project 3, the validation loss is your metric.
>>> Implementation steps
Step 1: Build the test set
Write 30 to 50 real questions in a CSV with three columns: the question, the expected answer, and the source (file and page) that contains it. Include easy questions, hard questions, and a few that are not answered in the documents at all, to check that the assistant says “I don’t know”.
Step 2: Score retrieval
import pandas as pd
tests = pd.read_csv("eval_set.csv")
def retrieved_sources(question, k=4):
hits = collection.query(query_embeddings=embedder.encode([question]).tolist(), n_results=k)
return [m["source"] for m in hits["metadatas"][0]]
tests["hit"] = [row.source in retrieved_sources(row.question) for row in tests.itertuples()]
print(f"Retrieval hit rate: {tests['hit'].mean():.0%}")
Step 3: Score the answers with a judge
import json
def judge(question, expected, answer):
prompt = (
"Grade the answer against the expected answer.\n"
f"Question: {question}\nExpected: {expected}\nAnswer: {answer}\n"
'Reply with JSON only: {"correct": true or false, "reason": "..."}'
)
response = client.messages.create(
model="claude-opus-5-5",
max_tokens=1000,
messages=[{"role": "user", "content": prompt}],
)
return json.loads(response.content[0].text)
tests["answer"] = [ask(q) for q in tests["question"]]
tests["grade"] = [judge(r.question, r.expected, r.answer) for r in tests.itertuples()]
tests["correct"] = tests["grade"].map(lambda g: g["correct"])
print(f"Answer accuracy: {tests['correct'].mean():.0%}")
Step 4: Analyse the failures
Now do what analysts do best. Filter the rows where the answer was wrong and look for patterns. Were they all tables in the PDFs? Questions about dates? Questions where retrieval missed? Fix the biggest group first (maybe smaller chunks, a better embedding model, or a clearer system prompt), re-run the script and compare the numbers. Keep a small table of each run so you can show your improvement over time.
Once you are comfortable with the basics, frameworks like Ragas, DeepEval and promptfoo give you ready-made metrics, test runners and reports, so you do not have to write every scorer yourself.
>>> Useful resources
- AI Engineering by Chip Huyen (the chapters on evaluation are excellent)
- Ragas, DeepEval and promptfoo documentation
- Hamel Husain’s writing on LLM evals
Final thoughts
You do not need a PhD or a big GPU cluster to get into AI. Start with Project 1 this weekend, then add one project at a time. By the end you will understand how modern AI apps retrieve information, take actions, learn from data and get measured, which is exactly what employers want to see.
And remember: the tools will keep changing every few months, but the fundamentals in these five projects will not.
If you build one of these, I would love to see it. Feel free to reach out through my contact page!
This post was inspired by Lan Chu’s article “5 AI Real-World Projects To Set Foot in The Door” (AI Advances, 2024), updated with the tools and models that are current in late 2026.