How Stripe Built Kai on Deep Agents in 1 Week
Stripe's company-wide productivity agent Kai was built by one engineer in a week on LangChain's open-source Deep Agents harness. It uses a layered architecture: Deep Agents at the base, a Stripe-specific harness for security and infrastructure, a configuration layer for custom agents, and the UI on top. Key mechanics include an S3-backed virtual filesystem with sync-in/sync-out around sandbox calls, a sandbox exposed as a tool rather than as the agent's runtime, tunable summarization for long sessions, and skill-gated dynamic loading of 500+ MCP tools. Model quality degraded beyond about 150 skills, so the team is moving toward RAG or classifier prefiltering ahead of LLM skill selection, while adoption reached 83% weekly usage across the company.
Related posts
- The five components of building a "company harness"
LangChain easyNoviceInternal company agents at LangChain (GTM Agent, OpenSWE, Content Studio) converge on five primitives for a multiplayer "company harness": living in Slack (with thread breakouts and a custom UI for backlogs), identity handled per tool as either on-behalf-of the user or fixed service credentials, two-tier global and per-user memory, sandboxed code execution with a secret proxy for authenticated requests, and scheduled or event-triggered runs. OBO tools like email are restricted to DMs, and write operations on shared accounts are limited to allowlisted users. All three agents run on Managed Deep Agents, built on the open-source Deep Agents harness.
- How We Built LangChain’s Paid Media Agent
LangChain mediumAdeptLangChain's Paid Media Agent is a Slack-resident Deep Agent that merges ad-platform data with warehouse pipeline data, produces weekly per-platform PDF reports, answers follow-up questions, and proposes campaign changes for human approval. It runs in a sandboxed microVM. Context is split into layers: a short map-like system prompt, progressively disclosed skills, a company wiki, live tools and deterministic code. Moving calculations into Python and keeping the model for judgment cut a reporting run from 18 minutes and about $3 (3.9M tokens) to 85 seconds, roughly 40x cheaper. Other lessons: merge separate Slack and scheduled graphs into one runtime with per-entry-point capability profiles, and define a source of truth per metric instead of forcing one normalized schema.
- Revamping Skills in Deep Agents
LangChain mediumAdeptDeep Agents now supports binding tools to Agent Skills, pinning skills at runtime, and reloading skills mid-thread, extending progressive disclosure for libraries that grow to thousands of skills. Bound tools, listed under `metadata.include_tools` or resolved from a label by a function that can gate on runtime permissions, stay out of context until the agent reads the skill. On newer Anthropic and OpenAI models they are injected via a new system message so the prompt cache prefix stays intact. Pinned skills (e.g. parsed from `/meeting-prep`) insert instructions before the first model call, saving a `read_file` round trip. Setting `skills_metadata` to None forces a rescan, at the cost of invalidating the cache when skills change.
- Open SWE: An Open-Source Framework for Internal Coding Agents
LangChain mediumAdeptOpen SWE is an MIT-licensed framework for internal coding agents, built on Deep Agents and LangGraph. It packages the patterns that Stripe's Minions, Ramp's Inspect and Coinbase's Cloudbot converged on: per-task isolated cloud sandboxes, a small curated toolset, context drawn from AGENTS.md plus the source Linear issue or Slack thread, subagents for delegated subtasks, and deterministic middleware around the agent loop. Two middleware examples are injecting follow-up messages mid-run and opening a PR if the agent didn't. It is invoked from Slack, Linear and GitHub, and the sandbox provider, model, tools, triggers, prompt and middleware are all pluggable.
- Agents that can pay: building Restock with Stripe's Link and Managed Deep Agents
LangChain mediumAdeptRestock is a sample Slack office-supply agent on Managed Deep Agents that makes real purchases. It searches Zinc, builds a cart, and pays through Stripe's Link wallet over the Machine Payments Protocol, where the merchant returns HTTP 402 with payment instructions and the client retries with a shared payment token. Spending limits and approvals live in code the model can't touch. The user sets an upfront amount under the budget, approves it through a Slack interrupt and again in Link, and the agent reads actual fees from the 402 challenge first. Credentials stay in per-user Connections and a sandbox, tokens are deleted after use, and an order counts as placed only when the merchant reports it.