Next Chapter M&A | Home

System Architecture Overview

Always-on prospecting to proposal engine — research targets, generate letters, mail via API, dial via Salesfinity, share a single URL that closes deals.

317 Pages Live 10 AI Agents 7 LLM Models 250/150 Governor

Business Flow

Every prospect moves through five stages. Each stage is automated. The 250/150 governor prevents the next batch until the current batch is fully worked.

🔍
RESEARCH
Find targets, qualify, score. 10-query acquisition check. Story intelligence layer.
Supabase targets table
📄
GENERATE
Build hub page, letter, proposal, company story page from Supabase data.
Vercel · 317 pages
✉️
MAIL
Print and mail physical letters via Lob API. Max 250 per batch.
Lob API · letter_campaigns
📞
CALL
Parallel dial via Salesfinity. Track until 150 contacts hit 5 calls each.
Salesfinity · call_outcomes
🎯
CLOSE
Share single personalized URL on phone call. Prospect sees their story.
One URL per prospect
250/150 Governor: Send a max of 250 letters per batch. HARD STOP. Monitor until 150 of those contacts have been called 5 times each. Only then unlock the next batch. Enforced at three layers: Python logic, database CHECK constraints, and a UNIQUE INDEX that prevents two active batches simultaneously.

Architecture Map

Three layers: Claude Code (where humans build), OpenClaw (where agents run), Supabase + Vercel (where data lives and pages deploy).

Mac Mini (Always On)
Development
Claude Code
Opus Architect (strategy)
Sonnet Builder (features)
Haiku Executor (bulk ops)
MCP: Exa, Fireflies, Gmail, Slack, Calendar, Drive, Chrome
Orchestration
OpenClaw Gateway :18789
10 Specialized Agents
8 Cron Jobs (paused)
Telegram Bot
Models: DeepSeek, Gemini, GPT-4o Mini, Ollama
Local Services
ML + Networking
Ollama :11434 (embeddings)
ChromaDB (vector store)
Tailscale (100.112.160.48)
↓ ↓ ↓
Cloud Services
Database
Supabase (PostgreSQL)
targets (201+ rows)
companies, contacts
pipeline_log, call_log
meeting_notes
campaign_batches, letter_campaigns
Hosting
Vercel
317 static HTML pages
/api/letters/ (serverless)
/api/webhooks/lob.js
Auto-deploys on git push
External APIs
Integrations
Lob (physical mail)
Salesfinity (dialer)
Telegram (notifications)
Exa (semantic search)

Engines

Letter Engine lib/letter_engine.py

Renders physical letters for Lob mail API from Supabase company data and vertical-specific EBITDA benchmarks. Supports three touch variants per prospect. Jinja2 templating with 24 variables. Print-ready HTML at 8.5×11, Georgia serif, no color.
InputCompany ID + variant (touch_1, touch_2, touch_3)
OutputLob-ready HTML string
Data SourcesSupabase companies & contacts tables + 7 vertical EBITDA benchmarks (water treatment, HVAC, plumbing, roofing, pest control, concrete, flooring)
Key Functionsrender() render_all_variants() _build_ebitda_narrative()
Tone rule: Operator narrative, not PE finance speak. "I know what it's like to build something with your hands and wonder what happens to the team when you're ready to step back."

Meeting Engine v2 lib/meeting_engine_v2.py

Interactive meeting prep pages with three meeting types: Discovery, Financial Review, Engagement. Auto-saves to Supabase with 600ms debounce. Completeness tracking unlocks downstream documents as fields are filled.
TabsPre-Meeting · During-Meeting · Post-Meeting
During-MeetingOwner profiles, emotional temperature slider, revenue mix, margin grid (gross/EBITDA/SDE), key employees table, deal breakers, verbatim quotes
Unlock TrackerLetter at 3 fields → Buyer targeting at 5 → Proposal at 6 → Full pipeline at 10

Campaign Manager lib/campaign_manager.py

Governs the 250/150 letter-to-call pipeline. Three enforcement layers prevent batch overflow.
Layer 1Python logicsend_batch() checks count, check_threshold() gates next batch
Layer 2DB constraintCHECK (letter_count <= 250) on campaign_batches
Layer 3Unique index — Only one active batch per entity at any time
NotificationTelegram alert on batch milestone (complete, threshold met, hard stop)

Page Regeneration scripts/regenerate.py

Incremental and full-rebuild modes for hub pages. Git push after generation triggers Vercel auto-deploy.
Incremental
Only rebuilds pages for companies with new/stale research (RESEARCHED status + no report_generated_at).
Full Rebuild
All 171+ non-disqualified targets. Run when templates change. Supports --entity filter.

Lob Mail Client lib/lob_client.py

HTTP wrapper for Lob physical mail API. Sends print-ready letters, tracks delivery status via webhooks.
Sendsend_letter(html, to_address, from_address) → letter_id, tracking_url, expected_delivery_date
Trackget_letter_status(letter_id) + webhook at /api/webhooks/lob.js
StatusAPI Verified (Live Key)

Salesfinity Dialer lib/salesfinity_client.py

AI parallel dialer integration. Pushes contacts for calling, fetches outcomes, syncs back to Supabase.
Pushcreate_dialer_list(contacts) → list_id
Fetchget_call_outcomes(list_id) → connected, voicemail, no answer, interested, etc.
Syncsync_outcomes_to_supabase() writes call_log records with outcome, duration, timestamp

Claude Code Sub-Agents

Three specialized agents auto-route by task complexity. Defined in ~/.claude/agents/.

Haiku Executor
Fast, no-frills execution. No reasoning.
Model: Claude Haiku 4.5
Cost: ~$0.05/task
Tools: Bash, Read, Glob
Git ops, file moves, health checks, ls, status commands
Sonnet Builder
Balanced execution + moderate reasoning.
Model: Claude Sonnet 4.6
Cost: ~$0.50/task
Tools: Bash, Read, Write, Edit, Glob, Grep
Config edits, JSON, hooks, integrations, bug fixes
Opus Architect
Strategic design. High reasoning.
Model: Claude Opus 4.6
Cost: ~$2.00/task
Tools: All tools
Architecture, trade-offs, system design, debugging

OpenClaw Agent Fleet

10 specialized agents running on cheap LLMs for high-volume autonomous work. Multi-model strategy: expensive models build, cheap models research.

AgentModelRoleCost Tier
mainDeepSeek ChatPrimary orchestration and routing$0.27/M in
researcherGemini 2.5 Flash LiteWeb research, target qualificationFree/minimal
executorGPT-4o MiniTask execution, command running$0.15/M in
validatorDeepSeek V3Research quality checks$0.27/M in
auditorDeepSeek V3Pipeline health, compliance audits$0.27/M in
classifierDeepSeek V3Company and data classification$0.27/M in
controllerDeepSeek ChatPipeline flow control and gating$0.27/M in
listenerGemini 2.5 Flash LiteChannel monitoring (Telegram, email)Free/minimal
certifierDeepSeek V3Data quality certification$0.27/M in
nurturerGPT-4o MiniOutreach relationship management$0.15/M in

Scheduled Routines

8 autonomous routines designed for the pipeline. Currently paused pending credential sync and agent instruction files.

RoutineFrequencyWhat It DoesStatus
batch-pullEvery 2hPull NEW targets from Supabase, set to RESEARCHINGPaused
research-loopEvery 30mRun 5-step research sequence on RESEARCHING targetsPaused
quality-reviewEvery 30mReview against $5K consulting report quality barPaused
morning-briefEvery 4hPipeline counts, errors, cost tracking summaryPaused
publish-and-sendEvery 1hGenerate reports for approved targets, queue outreachPaused
dialer-updateEvery 2hPush REPORT_LIVE contacts to Salesfinity with call scriptsPaused
heartbeatEvery 15mHealth check: stuck targets, errors, pipeline countsPaused
weekly-maintWeeklyMemory flush, error patterns, cost tracking vs $1.50 capPaused

Database Schema

TablePurposeKey FieldsStatus
targetsMaster acquisition target listcompany_name, pipeline_status, vertical, acquisition_statusLive (201+ rows)
companiesEnriched company profilesname, city, state, revenue, personalized_urlLive
contactsOwner/decision-maker contactsfirst_name, last_name, phone, email, roleLive
pipeline_logAudit trail for all agent actionsagent, action, details, timestampLive
call_logSalesfinity call outcomescontact_id, outcome, duration, called_atLive
deal_researchDeep research notes per dealtarget_id, research_dataLive (expanding)
meeting_notesPer-field meeting data capturemeeting_id, field_name, field_valueMigration ready
campaign_batches250/150 governor statebatch_number, letter_count, calls_completedMigration ready
letter_campaignsLob letter trackinglob_letter_id, variant, status, delivered_atMigration ready
call_outcomesPer-call attempt tracking (max 5)target_id, attempt_number, outcomeMigration ready

Pipeline States

NEW RESEARCHING RESEARCHED NEEDS_REVIEW REPORT_LIVE
Quality gate: Every target must meet the "$5,000 consulting report" standard before advancing past NEEDS_REVIEW. Every status transition is logged to pipeline_log with agent name, action, and reasoning.

Enrichment Sources

SourceWhat It ProvidesIntegration
ExaSemantic web search, company discovery, contact enrichmentMCP (web_search_exa, crawling_exa)
Google Search APIBroad web discovery, news, press releasesGemini provider via OpenClaw
FirefliesMeeting transcripts, summaries, action itemsMCP (fireflies_get_transcript)
GmailEmail threads, contact historyMCP (gmail_search_messages)
SlackTeam discussions, deal contextMCP (slack_search_public)
Google CalendarMeeting schedules, availabilityMCP (gcal_list_events)
Google DriveShared documents, presentationsMCP (google_drive_search)
OllamaVector embeddings (nomic-embed-text, 137M params)Local API :11434
ChromaDBSemantic search across all ingested dataLocal Python API

Story Intelligence Layer

Beyond financial data, the system hunts for human stories about each founder: YouTube interviews, podcast appearances, local news features, Google reviews mentioning the owner by name, trade publication profiles, BBB complaint responses. These feed the Company Story Template — a storyboard page with photos, pull quotes, generational narrative, and a "What Happens to the Team" section.

Business Rules Engine

Rules are stored at multiple levels to prevent any single point of override.

Rule TypeWhere StoredExample
Pipeline gatesPython code (campaign_manager.py)250 letter max, 150/5x call threshold
Database constraintsSupabase CHECK + UNIQUE INDEXOnly one active batch per entity
Quality standardsSOUL.md (agent instructions)"$5,000 consulting report" quality bar
Scoring rubricsletter_engine.py vertical benchmarksEBITDA floors/ceilings/medians per vertical
Classification rulesAcquisition status check (SOUL.md)10-query detection protocol
Tone rulesLetter template + prompt filesOperator narrative, not PE finance speak
Cost capsCampaign manager + cron config$1.50 per target research cost limit
Retry logicSelf-repair protocolExponential backoff: 30s / 60s / 120s / SKIP

Cost Model

ComponentCost Per UnitUsage
Claude Opus 4.6 (architect)~$15/M in, $75/M outStrategic design only
Claude Sonnet 4.6 (builder)~$3/M in, $15/M outFeature building, ~$0.50/session
Claude Haiku 4.5 (executor)~$0.25/M in, $1.25/M outBulk execution
DeepSeek Chat (agents)$0.27/M in, $1.10/M outAutonomous agent work
Gemini Flash Lite (research)Free tier / minimalResearch agent, listener
GPT-4o Mini (execution)$0.15/M in, $0.60/M outExecutor + nurturer agents
Ollama (embeddings)$0.00Local nomic-embed-text
Lob (physical mail)~$1.50/letterPer letter mailed
SupabaseFree tierDatabase + auth
VercelFree tierStatic hosting + serverless
Target all-in cost per prospect: Under $5.00 (research + letter + tracking). Research agent uses DeepSeek/Gemini at <$0.30/M tokens. Expensive Claude models reserved for human-facing development only.

Infrastructure

Mac Mini (Always-On Host)
Claude Code development environment
OpenClaw gateway on :18789
Ollama ML server on :11434
ChromaDB vector database
Tailscale mesh: 100.112.160.48
Cloud Stack
Supabase — PostgreSQL + REST API
Vercel — Static hosting + serverless functions
GitHub — Source control, auto-deploy trigger
Lob — Physical letter mailing
Salesfinity — AI parallel dialer
Communication
Telegram @MacMiniEwingBot — primary control channel
Decisions only, no noise, links not paths
Slack — team collaboration (MCP integrated)
Overnight Batch Runner
Bash script runs 9 sequential headless Claude Sonnet sessions
Each session builds a specific feature from prompt files
Runs while operator sleeps — logs to overnight-logs/

Key Design Decisions

DecisionRationale
Operator narrative over PE finance speakLetters sound like someone who built a business, not someone who buys them. Trust builds faster.
OpenClaw agents over custom Agent SDKSingle orchestration platform. Don't build a framework when one exists.
Cheap models for volume, expensive for strategyDeepSeek/Gemini at <$0.30/M for research. Claude Opus only for architecture decisions.
Local embeddings (Ollama) over cloudZero marginal cost for vector search across transcripts and emails.
Hard governor (250/150) over soft limitsDatabase constraints enforce discipline. No config toggle can override.
Single URL as the closerEvery prospect gets one page that tells their story better than they could. That URL is the product.
Hybrid file + database bridgeSpeed of local file reads with durability of Supabase persistence.
Telegram as primary control channelOperator controls everything from phone. Decisions only, no noise.

Current Status

Live Now

317 HTML pages on Vercel
Letter engine + templates
Meeting engine v2
Lob API (live key verified)
Telegram bot operational
Regeneration scripts
Claude Code sub-agents
Tailscale + Ollama + ChromaDB

Next to Activate

Supabase credential sync
Missing database tables (SQL written)
Agent SOUL.md instruction files
Cron scheduler activation
Salesfinity API wiring
ChromaDB ingestion pipeline
Campaign manager E2E test
Bot token rotation
Built by Ewing Gillaspy with Claude Code (Anthropic) · OpenClaw v2026.3.28 · March 30, 2026