Latest writings
Notes on AI agents, Salesforce, automation, micro-SaaS, and engineering.
Building AI agents that do real work: agent loops, tool design, memory, MCP and evaluation. Practical patterns and their trade-offs, with code you can run.
AgentforceWinter '27: Agentforce Agents as MCP Tools in Claude
Salesforce MCP now works both ways: Winter '27 lets you expose an Agentforce agent as a tool that Claude, ChatGPT or Cursor can call. Setup path, schema behaviour and two catches.

What Is a Token in an LLM? Tokens vs Words, Explained
The model never reads your words — a tokenizer cuts text into chunks first. Here's how tokens drive your API bill, context window and rate limits.
SalesforceDay 15/15 — Build a Complete Headless Salesforce AI Assistant
The capstone: a Next.js assistant that signs in with PKCE, lets Claude call Salesforce hosted MCP servers as the user, and asks before every write.
SalesforceDay 14/15 — Production Architecture: Governance, Monitoring & Error Handling
Take a Salesforce AI assistant to production: who approves tools, what Salesforce logs, how to classify and retry errors, and which limits and costs to plan for.
SalesforceDay 13/15 — Headless 360 + Agentic AI Architecture
One assistant, a planner with tools, or several agents? Where Agentforce fits, what the beta Headless 360 MCP Server changes, and native React versus Next.js.

Day 12/15 — Custom MCP Tools + Apex/Flow Business Logic
Publish your own Apex and Flow logic as tools on a custom Salesforce hosted MCP server, so the model calls your business rules instead of inventing them.
SalesforceDay 11/15 — Security Architecture: OAuth, Permissions & Least Privilege
A threat model for AI clients on Salesforce, the layers that contain them, where tokens go, why there is no integration user, and a least-privilege permission set explained line by line.
SalesforceDay 10/15 — Build Your First AI + Salesforce Workflow
Turn a chat into a workflow: a read-only meeting prep brief built with Next.js, the Claude API's MCP connector and Salesforce hosted MCP servers.
SalesforceDay 9/15 — Create & Update Salesforce Data Safely
Let Claude write to Salesforce without losing control: what still runs on every write, the propose, confirm, execute, verify loop, and a confirm-before-write pattern for your own app.
SalesforceDay 8/15 — Read Salesforce Data Using Natural Language
Ask Salesforce questions in plain language and trust the answers: how Claude picks soqlQuery, find or getRelatedRecords, prompt patterns, verification and limits.
SalesforceDay 7/15 — Explore Salesforce MCP Tools & sobject-all
What Claude can actually call in your org: the 11 sobject-all tools, the smaller servers, how to read a tool definition, MCP Inspector, and the beta Headless 360 server.
SalesforceDay 6/15 — Connect an AI Client to Salesforce via MCP
Connect Claude to Salesforce's hosted MCP servers: a custom connector in claude.ai and Claude Desktop, a direct server in Claude Code, and your first read-only prompts.
SalesforceDay 5/15 — OAuth 2.0, PKCE & External Client App Setup
Create the External Client App every MCP client needs: the mcp_api and refresh_token scopes, PKCE, JWT tokens, and a tested PKCE helper in TypeScript.
SalesforceDay 4/15 — Enable & Configure the Salesforce MCP Server
Switch on Salesforce's hosted MCP servers, part of Salesforce Headless 360 (AIforce): the exact Setup path, which server to start with, the right URL for your org, and a server inventory.

Day 3/15 — MCP Fundamentals: Client, Server, Tools & Resources
The Model Context Protocol behind Salesforce Headless 360 (AIforce): hosts, clients, servers, tools, the stateless 2026-07-28 lifecycle, and a local MCP server you build and inspect.
SalesforceDay 2/15 — Headless 360 Architecture Explained
Follow one request through Salesforce Headless 360 (AIforce): client, identity, MCP server or API, platform and back. Plus when to use MCP and when to call the APIs directly.
SalesforceDay 1/15 — What Is Salesforce Headless 360 and Why Does It Matter?
Salesforce Headless 360, now called AIforce, opens the platform to agents and code. What it is, what the rename changed, what is GA or beta, and how to get ready.

Why Use Gemini for AI Automation: A Builder's Comparison
When Gemini is the right model for automation workflows and agents: current models, verified pricing, native multimodal input, long context, tool calling, and where other models fit better.

Graph Engineering For AI Agents: My Production Playbook
Model your agent as a graph: an execution graph in LangGraph for control flow and failure paths, and a knowledge graph for memory you can trace, with a runnable example.

AI Agents in Enterprise Automation: A Founder's Field Guide
How to take an AI agent from demo to dependable: start from the process, route low-confidence work to people, keep actions in plain code, and log every decision.

Building Long-Term Memory: Setting Up Vector Databases for Semantic Search in LangChain
Split your text, embed it, store it in Chroma and search it by meaning with LangChain. Then add MMR for varied results, a Pinecone option and a small RAG chain.

Unmasking the Black Box: Mastering LangChain Callbacks for Debugging
See inside a LangChain agent with callbacks: print every step, write a custom audit handler, count tokens, avoid async mistakes and send traces to LangSmith. Handlers tested with a fake model.

Best Practices for Deploying LangChain Apps to Production
Serving, streaming, per-user state, caching, tracing, evals, secrets and timeouts: a checklist for moving a LangChain 1.x agent out of the notebook.
