Embed Pi Coding Agent in B2B Sales Pipeline

AI Engineergo watch the original →

Matthias Luebken demonstrates embedding Pi SDK's coding agent—LLM tool loops with sessions—into a sales system that routes RFP emails to per-customer agents via CLI-wrapped CRM/ERP tools, generating inbox drafts.

The Breakthrough

Matthias Luebken embeds Pi, a minimal coding agent SDK, into a B2B sales pipeline. Incoming RFP emails route through a gateway to customer-specific agent sessions. CLIs expose CRM and ERP data securely in a sandbox. Agents generate draft responses that appear in the user's inbox.

What Actually Worked

  • Pi core runs an LLM in a tool-calling loop with goals, context, and agent.md files; sessions persist state across interactions.
  • Per-customer agents load agent.md (system usage instructions) and customer.md (quirks, access, discounts); new sessions create or reuse for each RFP.
  • Tools wrap CRM/ERP access as CLIs, which agents call naturally; example CLI commands include 'show me all leads and score them' in a TypeScript CRM qualifier.
  • Extensions enable UI interactions like context selects and dropdowns in terminal or web UIs generated by Pi; session events and pre-tool-call hooks add steering (e.g., access checks).
  • Output stays human-visible only as inbox drafts; multi-channel routing in OpenClaw builds on Pi packages for sessions, coding runtime, and terminal UI.

Context

Luebken starts from Pi under OpenClaw, demystifying 'learning' as tool loops (e.g., ffmpeg for untaught voice). He builds a CRM lead qualifier in three TypeScript files with terminal interface, then scales to sales: inbox monitoring routes RFPs to agents that query systems via simple CLIs. Principle: design interfaces for agent strengths, avoiding complexity. This fits 'fuck around and find out' phase; Pi's minimalism (agent class, events, shell runtime) enables product embedding now, with emerging patterns like CLI bundling (Co-work CLA's Excel skills via pandas/openpyxl).

Notable Quotes

  • "Write programs that do one thing and one thing well." (Ken Thompson)
  • "Make it easy for coding agents."
  • "Coding agents are and will be a core building block for your software systems."

Substance Notes

No eval scores, latencies, or costs reported.

  • #demo
  • #tutorial

summary by x-ai/grok-4.1-fast. probably wrong about something. check the source.