Behind the chat

How this site's agent works

The search bar on the home page talks to an agent that answers as me, from my CV, and drives the page while it does. It is small, but it is built the way I build agents for production: typed tools, evals, limits and tracing.

One prompt, no retrieval

The whole CV fits comfortably in a prompt, so there is no vector database and no retrieval step to get wrong. The CV lives in one JSON file in the repo. The same file renders the pages, builds the prompt and feeds the PDF, so the agent cannot drift from what the site says.

My phone number and pay expectations are left out of the prompt entirely. The agent cannot leak what it was never given.

Tools that drive the page

The agent does not only write text. It has 4 typed tools, each with a schema the model's input is validated against, and each rendered in the browser as an interface element rather than as prose.

  • highlightExperience

    Opens a role in the career timeline and highlights the phrases that answer the question.

  • showContactOptions

    Adds buttons to email me or book a call.

  • showCvDownload

    Adds a button that opens the PDF version of the CV.

  • showDog

    Opens photos of Mabel. Only when asked.

Evals before changes

Every change to the prompt, tools or model runs against 16 test conversations. Deterministic checks cover tool calls, length and patterns that must never appear, such as a phone number or a day rate. A judge model then checks each reply claim by claim against the CV and fails anything invented.

The first run of the suite failed a quarter of its cases: the agent wrote code on request, embellished my experience and once returned nothing at all. Those are fixed, and the cases stay to keep them fixed.

  • current role
  • head of AI role
  • agents in production
  • early career
  • skill not on the CV
  • follow-up keeps context
  • contact
  • cv download
  • dog when asked
  • no dog unprompted
  • day rate
  • phone number
  • off topic
  • prompt injection
  • system prompt extraction
  • invented employer

Guardrails

  • Rate limits per visitor per minute and per day, plus a daily cap across everyone.
  • Bot detection on the chat endpoint, so the budget goes on people.
  • Limits on message length, conversation length and steps per reply.
  • A scoped prompt: it talks about my work and how to reach me, and declines the rest.
  • Conversations are stored in your browser only. Traces go to Pydantic Logfire so I can see what went wrong.

Readable by other agents

People are not the only readers. The CV is also served for language models and their tools:

  • /llms.txt and /cv.md as plain markdown.
  • An MCP server at /api/mcp with read-only tools: get_cv, list_roles, get_role, search_experience, get_contact_options.
  • schema.org structured data on every page.

Built with

Next.js and React, the Vercel AI SDK for the agent loop and streaming, Zod for tool schemas, Upstash for rate limits, Pydantic Logfire for tracing, and Tailwind for the styling.

Try it on the home page.