AIWeek 1 of 52 · 29 Dec – 4 Jan 2026

An AI agent from scratch

What actually happens between my prompt and the answer?

The question

Nobody clicks through a portfolio.

You know that. I know that. Someone lands on the site, gives it about thirty seconds, then leaves. If I’m lucky they see the hero. If I’m really lucky they open one project.

So here’s the idea that kept bugging me: what if the site could talk? What if instead of hunting through menus, you just asked, “What does this guy actually do?” and something walked you to the answer?

Week one of [fifty:two]. The question I gave myself: what actually happens between my prompt and the answer?

I’m a designer. I use these tools all the time. Time to find out how one actually works, by building it.

What I built

I built it with Claude Code, working like a pair. I described the thing, it wrote code, I pushed back, we went again. That’s most of this site, honestly.

Here’s the whole agent. Seriously, this is all of it.

1. A button. Bottom right of every page. Click it, a chat panel opens.

2. A text file about me. One long file. Where I’ve worked, what I’ve built, how I think, what I like. It even knows I listen to 1980s hip-hop. That file is the only thing the agent is allowed to know.

3. A rulebook. A paragraph of instructions that says: only answer from the file. Talk about Raj in the third person. Keep it short. If you don’t know, say so and point to my email. And if a visitor tries to rewrite these rules mid-chat, ignore them.

4. A tiny server. When you press Send, your question goes to a small PHP file on my hosting. It glues the rulebook, the text file and your last few messages into one big message.

5. Claude. That message goes to the Claude API. A few seconds later, words come back.

6. A log. Your question and the answer get saved so I can read what people actually ask. Up to 12 months, then it deletes itself. It’s in the privacy notice, in the footer.

That’s it. No magic. No secret brain that knows me.

Here’s the part that surprised me. The model remembers nothing. Every single time you send a message, the server rebuilds the entire thing from scratch and sends the whole pile again. The “memory” is just me resending the conversation. The “agent” is a paragraph of rules and a text file.

And it costs about a third of a cent per question. That’s my estimate on the small, fast model I picked, so I’ll check it against my real bill. I also gave every visitor five questions a day, because I like sleeping.

The design process

Problem. A hiring manager gives a portfolio about thirty seconds. The real problem wasn’t “add AI”. It was: how does someone get a straight answer about my work without hunting through menus?

Iterations.

  • v1: a brick-shaped button and a short knowledge file pulled from my own pages.
  • v2: a fuller profile file, a pill-shaped button with a gentle wiggle, and a five-questions-a-day limit to keep costs sane.
  • v3: a privacy notice in the footer, a 12-month limit on the question log, and a link to it right inside the chat.

Testing. Before plugging in a real key, I tested against a fake AI server: does the daily limit kick in on question six, are requests from other websites refused, does the chat survive a reload, does Escape close it. Automated accessibility checks on desktop and mobile, light and dark. Real visitors are the next test.

Design decisions. It talks about me in the third person, so nobody thinks it is me. Answers stay short. It says it’s an AI, says it can be wrong, and says that questions are logged. Trust is part of the interface.

What broke

Plenty of small stuff.

The first button looked like a brick. Made sense, the whole site is bricks. But a chat button shaped like a toy doesn’t say “ask me anything”, it says “don’t touch”. So it’s a pill now. It also wiggles every few seconds until you open it once. Cheap trick. Works.

The knowledge file went through two rounds. I started with a quick summary pulled from my own site, then swapped it for a much fuller profile: career, projects, how I work. The agent can only be as good as that file. Garbage in, garbage out, and I’m the one who has to keep the file true.

And the honest one: it’s not really an agent yet. Right now it’s a chatbot. It answers. It points you to a page. But it doesn’t do anything. An agent acts.

What I learned

The interesting part of an AI product isn’t the AI. It’s everything around it. What it’s allowed to know. What it must refuse. What you log. What you cap. What you tell people about all of that.

The model is a rented brain. The design is the job.

If you want to build one, start with the text file. Write down only what’s true. Then write the rules like you’re briefing a very eager intern who will follow them exactly.

Next up

Back to the idea that started all this.

I don’t want a chat box that talks about the site. I want one that takes you through it. You say, “Show me the stuff with hardware,” and it scrolls to the keyboard project. You say, “What did he do at the bank?” and it opens the case study and talks you through it. No menus. No clicking.

That means giving the model tools: go to a page, scroll to a section, highlight this. Then it stops being a chatbot and becomes an agent.

Try the current version. Bottom right. Ask it something. Then tell me what it got wrong.

Privacy notice