Custom AI Integration
AI features that survive contact with real users
The demo is the easy part. Making it cheap, safe, and accurate on live traffic is the job.
I build LLM features into real products — support agents that actually answer, retrieval grounded in your own content, and model routing that keeps the bill from tripling when you grow. I run this in production on my own SaaS, on paying customers' traffic, which is why I know where it breaks.
Scope
What I build
AI support & sales agents
Chat agents that answer from your knowledge base, your product pages, and your docs — and hand off to a human on the questions where a wrong answer would cost you a customer.
Grounded answers over your content
Retrieval pipelines so the model answers from your actual content instead of inventing plausible fiction. Includes the unglamorous part: chunking, freshness, and citation.
AI inside an existing product
Summarization, classification, extraction, drafting, semantic search. Bolted onto the app you already have, without a rewrite and without a new vendor platform.
Internal tooling & automation
The workflows eating your team's week — triaging tickets, parsing documents, enriching records, generating first drafts of things a human then approves.
Proof
Running in production, not in a notebook
GhostChat AI — live on customer traffic
GhostChat is my privacy-first chat SaaS. Its AI responder runs on Claude Haiku in production, answering real visitor messages on paying customers' websites — grounded in each site's own knowledge base and behavior prompt, on Cloudflare Workers with Durable Objects for session state. The widget on this page is that product.
ghostchat-agent — open-source, bring your own model
I publish ghostchat-agent on npm (MIT licensed) so teams can run their own AI on their own infrastructure: their model, their server, their data. It supports Anthropic, OpenAI, and local Ollama models behind one webhook interface, with a setup wizard that provisions the whole thing in a couple of minutes.
The part I'd point a client to first: that package's README opens with a security warning, not a feature list. It tells you to run the agent in an isolated folder with no access to your codebase or databases, and explains why — visitor messages are untrusted input from the public internet, and an agent with filesystem access is a prompt-injection target.
Most AI integrations ship without anyone having thought about that. It's the first thing I design for.
Cost-controlled model routing
The failure mode nobody warns you about is the invoice. Sending every message to a frontier model is how a working prototype becomes an unaffordable product at scale.
I architect these systems to classify each request and route it to the cheapest model that can actually handle it. Simple turns — greetings, FAQ-answerable questions, follow-ups already covered by context in the conversation — go to a small fast model. Only the turns that genuinely need retrieval or hard synthesis escalate to a larger one, and once the retrieved context is in the conversation history, follow-ups drop back down. That routing decision is per-message, not per-conversation, and it is usually the difference between an AI feature that pays for itself and one that gets switched off after the first big bill.
Hard-Won
Four things that sink AI features
These are the issues that show up in month two, after the demo has already been approved.
- Unbounded cost No routing, no caching, no token ceilings. Works fine at 100 messages a day and becomes indefensible at 10,000. Fixed by routing and hard limits designed in from the start.
- Confident wrong answers A model with no grounding will invent a refund policy you don't have. Fixed by retrieval over your real content plus explicit handoff rules for questions where being wrong is expensive.
- Prompt injection Anything a visitor types is hostile input. An agent wired to your tools, files, or database without sandboxing is a live vulnerability, not a feature.
- No way to tell if it's working Without logging, evaluation cases, and a review loop, "is the AI any good?" becomes a matter of opinion. I wire measurement in before launch so the answer stays factual.
Stack
What I work with
Models & providers
Anthropic Claude, OpenAI, and self-hosted Ollama models. Provider-agnostic by default so you aren't locked to one vendor's pricing.
Application layer
Node.js, TypeScript, React, Next.js, Cloudflare Workers and Durable Objects, Supabase, PostgreSQL with vector search.
Around the model
Retrieval and chunking, streaming responses, webhook architectures, evaluation harnesses, cost and latency instrumentation.
Have an AI feature in mind?
Tell me what you want it to do and who it's for. I'll tell you honestly whether an LLM is the right tool — sometimes it isn't, and that's a cheaper conversation to have now than after the build.