Visitors to this site usually come with questions. What do you offer? How much experience do you have with AI agents? When could you start? The answers are all on the page, spread across services, projects and the FAQ. A chat can answer the question that was asked, without anyone piecing it together.
That was one reason. The other was simpler: I wanted to try it. A chat makes the site more interactive than a page you scroll through, and building one meant learning new technology hands-on instead of reading about it. Where better to do that than on my own website, my own playground?
Trying it out was easy. Answering well took longer. A tester once asked the chat whether I had experience with home automation. The chat answered that it had no information about that. I had worked on JUNG HOME, a smart home app, and my own chat didn't know. Everything it knew came from a prompt I had typed by hand, and that prompt had a gap exactly where the question landed.
Today the chat is an agent that builds its knowledge from this site's content, shows project cards and can take an inquiry. This series looks inside it. Part 1 tells why it exists, where it started and how it grew.
The map below shows the four stages side by side, from the model and what the chat knew to how I protected the routes and checked quality. Pick a stage to see what changed; new parts are marked in copper.
A labelled first person, extra knowledge and blog articles, checked by 71 eval cases.
- Model
- gpt-5.2
- Runtime
- OpenAI Agents SDK
- AI SDK UI stream
- Knowledge
- Website content
- Extra agent knowledge
- Blog articles
- Answers
- Text
- Project cards
- Project brief
- Conversation
- Browser session
- Next step
- Booking link
- Inquiry by mail
- Protection
- Origin check
- BotID
- Rate limits
- Quality
- Airtable log
- Answer feedback
- 71 eval cases
- Voice
- First person, labelled
Why a chat at all
Trying things out is a good reason to start. To keep something running for almost two years, I need more. These are the reasons it stays:
- It answers from what I have published. When an answer mentions a project, the project card comes with it, so claim and evidence sit next to each other.
- It shows instead of claiming. Writing "I build AI features into products" is easy. Letting visitors try one, on real content and with real limits, says more.
- It is still my playground, now with real stakes. I try agent patterns and SDKs here before I recommend them. The site has everything a client project has, only smaller: costs, misuse, wrong answers and people who ask things nobody planned for.
- It shortens the way to a conversation. Whoever has described a project in the chat shouldn't have to start again in an email. The chat turns the key points into an inquiry.
Where it started
The first version went live on 6 February 2025. It was a separate /chat page built on an open source chat template and the Vercel AI SDK. Each message triggered one streamText call to gpt-4o with a prompt I had written by hand. The answer streamed back, and both sides of the conversation were logged to Airtable. This is the heart of that first route, shortened:
// gpt-4o - $2.50 / 1M input tokens
// gpt-4o-mini - $0.150 / 1M input tokens
const MODEL_NAME = 'gpt-4o';
const model = openai(MODEL_NAME);
export async function POST(req: Request) {
const result = streamText({
model,
system: SYSTEM_PROMPT,
temperature: 0.7,
messages,
async onFinish(event) {
await storeChatMessageInAirTable({
chatId: id,
message: { role: 'assistant', content: event.text },
});
},
});
return result.toDataStreamResponse();
}The price list above the model name says a lot about that version: it was an experiment I watched closely, not a product I had planned.
The welcome text was honest: "I'm an AI assistant trained to help you learn more about Phillipp." Five days later, the prompt learned my booking link, a few nerdy jokes and to answer "42" when someone asks about the meaning of life. That rule is still there, and it has its own test now.
The same update repeated one rule in capital letters: answer in the language of the question. It had been in the prompt from the start, and English questions still sometimes got German answers. Shouting didn't settle it. Testers found more: the home automation gap, and an off-topic reply saying the chat could only answer questions about me or itself, which sounded more like a bouncer than a host.
Looking back, I would write a small set of test questions on day one. The home automation gap would have shown up in an afternoon instead of in a tester's message. My wish list was short: keep the conversation, send a summary to the visitor and me, and make booking a call easy.
How it grew
Feb 2025
The first chat version went live, and the wish list was written.
14 monthsA wish list is patient.
Jan 2026
I rebuilt the site. The chat came along, and that was all.
Apr 2026
From a call to an agent
I replaced the direct calls with the OpenAI Agents SDK and moved to
gpt-5.2. There was no grand plan behind it. The chat already ran on OpenAI models, I wanted to try the SDK, and this chat is where I try things first. It also kept a door open: an adapter in its extensions package runs the same agent with models from other providers, so a later switch wouldn't mean adopting a new agent framework first. For half a year it was an agent with nothing to do; the tools only arrived in October.The change that mattered more is less visible: the prompt is no longer written by hand but built from the same content as the website. A correction on the site corrects the chat, and a project in my portfolio can't be missing from the prompt. That closed the kind of gap the home automation question had found.
One source, two placeslib/content.tsprojects, CV, services+ JUNG HOMEWebsite+ JUNG HOMEwhat visitors readAgent prompt+ JUNG HOMEwhat the agent knowsA project I add to the site is in the agent's prompt with the next deploy. The goal changed too: help visitors judge whether I fit their project.
Oct 2026
Old debts, paid
This was the big rebuild.
showProjectsputs project cards below an answer,updateProjectBriefnotes down what a visitor says about their project, and the chat learned to draft an inquiry and then to send it, because amailto:draft often got lost on phones. The browser keeps the conversation now, so it doesn't matter which server instance answers. And I wrote the first 25 evals: fixed test questions with checks for the answers, the ones I should have written on day one.On the way, three things from February 2025 finally got done. The rate limit stopped being a
TODOand arrived together with Vercel's bot detection, the reply language is decided in code instead of in capital letters, and about 4,500 lines of unused template code are gone:Old debtsFeb 2025 → Oct 2026Rate limit// TODO: rate limitFeb 2025await guardChatRequest(req, 'chat')Oct 2026 · 632 days laterReply languageANTWORTE IN DER SPRACHE, IN DER DIE FRAGE GESTELLT WORDEN IST.Feb 2025resolveReplyLanguage(visitorTexts)Oct 2026 · in codeTemplate~4,500 lines of chat template nobody usedOct 2026 · deletedNov 2026
From assistant to agent
For a few weeks the chat spoke about me in the third person, as my AI assistant. That was correct, and it read like a press release about myself. Now it answers in the first person again.
Then I stopped guessing how much context the agent needs and measured it: three ways of giving it, 71 eval cases each. The leanest cut the input tokens in half and then declared experience I do have as undocumented. I chose the middle one:
Context for the agent71 eval casesOld promptthe rules before November17,57768/71Compactchosenshorter rules, all facts12,21670/71Leanoverview, facts on demand8,40266/71Average input tokens per answer and passed cases. gpt-5.2, one run on 12 November 2026. About 30 % fewer input tokens than the old prompt, 70 of 71 cases passed, and the one failure was an answer ten words over the limit.
Where it stands now
Today the browser keeps the chat in session storage and sends the last 12 messages with each question. On the server, a route checks the origin, bot protection and rate limits, then starts one agent run. The agent itself is small. Shortened, it looks like this:
export function createChatAgent(
variant: ChatContextVariant = DEFAULT_CHAT_CONTEXT_VARIANT,
options: ChatAgentOptions = {},
) {
return new Agent({
name: 'PhillippBertram',
instructions: getChatAgentInstructions(variant, options),
model: CHAT_MODEL_NAME,
tools: [
variant === 'baseline' ? showProjectsTool : createShowProjectsTool(true),
updateProjectBriefTool,
// …
],
modelSettings: {
maxTokens: CHAT_MAX_OUTPUT_TOKENS,
retry: { maxRetries: 3, policy: retryTransientErrors },
// Brief and project cards in one step; otherwise the model often drops the cards.
parallelToolCalls: true,
// …
},
});
}instructions is the prompt: the agent's rules, the facts from my website and a file of extra knowledge that isn't on the site, such as which client projects belong to which employer. variant picks one of three ways to assemble that context. The baseline in the code is the old setup, kept so the evals can still compare against it. How I chose between them is in the November stage above.
Why it is still the Agents SDK. The chat still runs on OpenAI models, so the main reason from April still holds. Not every part of the SDK earned its place, though. I used its sessions in April and dropped them in October, when the conversation moved into the browser. What stayed does real work:
- The loop.
showProjectsandupdateProjectBriefare plain functions with a zod schema. The SDK calls them when the model asks for them and sends the results back, in parallel when the model wants both. - Traces. Every run shows up in OpenAI's trace view, grouped as "Website Chat · Production", "Preview", "Local" and "Eval". For a strange answer I can see what the model got, which tools it called and how long each step took.
- One agent for the chat and the evals. The eval runner builds the agent with the same
createChatAgent, so the 71 cases test the code that answers visitors. - The interface stayed.
createAiSdkUiMessageStreamturns the agent's events into the AI SDK's UI stream, and React renders text, steps and cards as they arrive.
And the door from April is still open: if I want a model from another provider one day, the adapter is where I'd start, not a new framework.
Airtable keeps a log of the messages; inquiries are logged without names or email addresses.
Some limits are deliberate. The agent has no memory beyond the current conversation. It answers from published facts and says when something isn't documented. And it doesn't design architectures or estimate projects; those questions belong in a real conversation with me.
In short
- A chat on a portfolio site earns its place when it answers from published facts and shows the evidence next to the answer.
- A prompt written by hand has gaps you only find when someone asks. Building it from the site's content closes them.
- The step from one model call to an agent came with tools: project cards, a brief and an inquiry are things the chat does, not only says.
- Evals turned "it feels better" into numbers, and those numbers decided how much context the agent gets.
Next in the series
Part 2 follows one project link from the streamed answer to the React card, and tells why the cards used to go missing.
If you'd rather see the result than read about it, ask the agent below. This article goes along as context.
Phillipp Bertram