Discover our GTM Flywheel: Content, Ads & Outbound working as oneLearn more
ColdIQ Logo
Agency
Tools
Education
Get In Touch
AI Sales

How to Build an AI Agent That Runs Your Lead Generation

Inside the self-learning AI agent stack that replaces lead generation agencies. How Obsidian memory, Claude Code, and Trigger.dev power autonomous outbound.

Michel Lieben
Michel Lieben
APR 27 2026
How to Build an AI Agent That Runs Your Lead Generation

Table of content

1. The Problem With Traditional AI Agents
2. The Memory Layer: Obsidian as the Foundation
3. The Content Engine
LinkedIn Post Previewer Tool
4. The AI SDR Workflow
Intent Signals Tool
Email Finder Tool
5. The Technical Architecture
People Finder Tool
6. The Beginner Stack

Share article

Talk to a GTM engineer

Max Mitcham, founder of Trigify, replaced his entire lead generation workflow with a single self-learning AI agent.

The agent runs on a memory layer built in Obsidian, executes through Claude Code, and orchestrates tasks via Trigger.dev. It powers two distinct systems: an autonomous content engine that produced his best performing YouTube video, and an AI SDR workflow that feeds Trigify's sales pipeline.

What makes this different from typical AI automation is the memory architecture. The agent writes everything it learns back into Obsidian. Every interaction, every result, every context update becomes part of the knowledge base. The system gets smarter with each task instead of starting fresh every run.

Here's the complete breakdown of how the stack works, which tools handle which roles, and how to replicate it.

1. The Problem With Traditional AI Agents

Traditional AI agents treat each task as a standalone request. You prompt them, they respond, and the context disappears. The next task requires you to reload everything you already told them.

This creates three problems. The agent never learns from past results. It can't maintain a coherent view of your business. And the more you use it, the more you repeat yourself.

Max originally built his workflows on OpenClaw, an open-source local AI assistant with persistent memory and integrations across Discord, Telegram, and WhatsApp. The tool works, but the memory architecture does not self-improve in a structured way. The agent remembers what you told it, but it doesn't reorganize or refine that context based on what produces results.

The new setup solves this through a different memory pattern. Context flows in two directions. The agent pulls from Obsidian to understand the task, and writes back to Obsidian after each result. Over time, the memory layer becomes a living model of the business rather than a passive log.

2. The Memory Layer: Obsidian as the Foundation

Obsidian serves as the agent's long-term memory. Every client conversation, content decision, email performance signal, and workflow result gets written into a structured vault.

The choice of Obsidian matters. Unlike Notion or Airtable, it stores everything as local markdown files. This gives the agent direct file system access, which means Claude Code can read, edit, and cross-reference knowledge at the speed of local disk rather than waiting on API calls.

The vault is organized by domain. Client case studies live in one folder, product documentation in another, past email performance data in a third. The agent queries these folders directly when it needs context for a task.

Self-improvement happens on write. After each task, the agent summarizes what it learned and stores the insight. If a cold email subject line performed well, the agent notes which pattern worked and why. The next time it drafts an email, it pulls from that memory instead of guessing.

3. The Content Engine

The first system the agent powers is an autonomous content loop.

The agent monitors what's performing in Max's space, identifies trending angles, and drafts content based on internal context stored in Obsidian. Because the agent knows Trigify's positioning, past content, and which formats have worked before, the output reads on-brand without manual prompting each time.

The loop runs as a continuous cycle. Signals come in from social platforms, the agent cross-references them against internal context, and drafts emerge. Max reviews, edits, and publishes. The performance data flows back into Obsidian, and the agent learns which angles actually produced results.

The combination of internal context (business knowledge, past performance) and external context (trends, competitor moves, industry signals) is what makes the output better than generic AI-generated content. The agent isn't pattern-matching on the public internet. It's pattern-matching on what has actually worked for Trigify specifically.

One output of this loop was Max's best performing YouTube video to date. The agent surfaced the topic, helped structure the script, and recommended the angle based on what the audience had engaged with before.

The agent also drafts short-form social posts. You can preview exactly how a LinkedIn post will look before publishing, for free:

LinkedIn Post Previewer Tool

Post Content

Paste your LinkedIn URL to auto-fill your profile

0 / 3,000 characters • 0 lines

Preview

Michel Lieben
Michel Lieben
Founder / CEO @ ColdIQ | Scale Outbound with AI & Tech
21m•
Start typing to see your post preview...
LikeInsightfulLove
83
23 comments•4 reposts
Viewing: Mobile(2 lines max)

4. The AI SDR Workflow

The second system is an AI SDR that replaces the traditional lead generation agency motion.

The workflow starts with signal monitoring. Trigify tracks keywords, engagement patterns, and social activity to identify prospects who are actively showing buying intent. Instead of spraying cold outreach at a static list, the system waits for signals to trigger personalized outreach.

If you want to see which companies are actively researching solutions in your space right now, you can do it for free here:

Intent Signals Tool

Fields marked with * are required

Please enter a professional email address

Bot protection
Loading...

Quick examples:

When a qualified signal lands, the agent routes the prospect into an enrichment stage. LeadMagic pulls verified email addresses and mobile numbers. Surfe handles LinkedIn-to-CRM syncing, pushing enriched contact records into Attio, the CRM where deal data lives.

You can find verified email addresses for your target accounts here, for free:

Email Finder Tool

Your target's information

Fields marked with * are required

Enter just the domain (e.g., company.com) or paste a website URL

Please enter a professional email address

Bot protection
Loading...

Please fill in all required fields

With enriched contact data in place, the outreach layer takes over. Artisan's AI BDR handles multi-channel sequencing, while the agent drafts the actual email copy using the memory layer. Because it knows Trigify's ICP, case studies, and past email performance, the drafts feel hyper-personalized without requiring a custom prompt each time.

Every interaction gets logged in Attio. Meeting recordings flow through Fireflies, and AI-generated notes come from Granola. The data from each touchpoint feeds back into Obsidian, refining the agent's understanding of what works and what doesn't.

5. The Technical Architecture

The system runs on three core pieces of infrastructure.

Trigger.dev handles orchestration. Lead generation workflows involve long-running async tasks like signal detection, enrichment waterfalls, and multi-step outreach sequences. Trigger.dev manages these as queued jobs with automatic retries, which means the agent can handle failures gracefully without manual intervention.

Supabase stores the operational data. Every prospect, signal, enrichment result, and workflow state lives in a PostgreSQL database. Real-time subscriptions mean the agent can react to state changes instantly rather than polling for updates.

Claude Code is the execution layer. It reads from Obsidian, writes to Supabase, calls external APIs, and drafts outreach copy. Codex handles some of the coding-heavy work when new workflow components need to be built. PostHog tracks behavior across the entire system to surface what's working and what isn't.

The signal routing logic determines how different signals trigger different actions. A high-intent signal (someone engaging with Trigify's core content) triggers immediate outreach. A softer signal (someone following a relevant competitor) triggers a longer nurture path. The rules live in the agent's memory and evolve based on conversion data.

You can find the right decision-makers at any target account here, for free:

People Finder Tool

FIND PEOPLE

Type domains, select personas, fetch real contacts.

0/5

Type LinkedIn company domain and press Enter to add

1/3

Persona 1

Define specific job titles and seniority levels to target the right decision makers

6. The Beginner Stack

Replicating this architecture from scratch is overkill for smaller teams. Max recommends a stripped-down version for anyone starting out.

The minimum viable stack includes a signal-monitoring tool like Trigify, an enrichment tool like LeadMagic, a CRM like Attio, and an agent layer powered by Claude Code with a lightweight memory system. Obsidian works, but a simple Notion database is enough to start.

Start with one signal source. Pick one trigger that reliably indicates buying intent for your ICP. Build the enrichment and outreach path around that single signal before layering in additional complexity.

Add the memory layer once the workflow produces consistent results. The self-improving memory pattern only pays off after you have enough data to learn from. Early on, the manual review of each output is what teaches the agent. Later, that teaching gets automated as the vault grows.

The biggest mistake is trying to build the full system on day one. The agent needs to earn its autonomy through repeated success on simpler tasks.

The architecture advantages stack up over time:

→ Memory compounds (every task improves the next)

→ Signals drive timing (outreach goes out when intent is highest)

→ Context stays local (file system access beats API latency)

→ Workflows handle async (long-running tasks don't block the agent)

---

Michel Lieben
Michel Lieben
Founder, CEO

Michel Lieben is the Founder & CEO of ColdIQ, a B2B sales prospecting agency trusted by 100+ organizations. He’s launched hundreds of outbound campaigns, mastered tools like Clay and Lemlist, and shares sharp, actionable insights on scaling sales with AI, automation, and strategy.

Share article

Talk to a GTM engineer

FAQ

What is a self-learning AI agent in lead generation?

A self-learning AI agent is an AI system that stores the results of every task it runs and uses those results to improve future outputs. In a lead generation context, this means the agent tracks which email patterns get replies, which signals convert to meetings, and which prospect profiles close. That data gets written back into a structured memory layer, typically a local knowledge base like Obsidian. On the next task, the agent pulls from that memory to make better decisions without needing a custom prompt every time. The result is an outbound system that gets sharper over time instead of drifting toward generic output.

Why use Obsidian instead of Notion for AI agent memory?

Obsidian stores all notes as local markdown files, which gives an AI agent direct file system access through tools like Claude Code. This is significantly faster than querying a SaaS database through an API, and it avoids rate limits and auth complexity. Notion and Airtable can work as memory layers for simpler setups, but they introduce latency on every read and write. For agents that need to cross-reference hundreds of context files in a single task, local markdown is the better default. The second benefit is portability. The entire knowledge base lives in a folder you control, which makes backups and migrations trivial.

What tools do you need to build an AI SDR?

The minimum viable AI SDR stack has four layers. The signal layer captures buying intent through a tool like Trigify, which monitors keywords and social engagement. The enrichment layer pulls verified contact data through LeadMagic or Surfe. The CRM layer tracks deal data in Attio or a similar platform. The execution layer runs on Claude Code with a memory system like Obsidian or Notion. For multi-channel sequencing, Artisan's AI BDR can handle the outreach cadence. Start with one signal source and one outreach channel, then expand once the workflow produces consistent results.

How does Trigger.dev fit into an AI agent architecture?

Trigger.dev is a TypeScript-based workflow orchestration platform that handles long-running async tasks with automatic retries and queuing. Lead generation workflows are full of these kinds of tasks: signal detection, enrichment waterfalls, multi-step outreach sequences, and scheduled follow-ups. Without an orchestration layer, these tasks either block the main agent or fail silently when an API call times out. Trigger.dev manages each task as a queued job with built-in retry logic, so the agent can handle failures gracefully. It also makes it easy to add observability across the entire workflow, which is essential once the system starts running autonomously.

How is an AI SDR different from traditional cold email automation?

Traditional cold email automation runs on static lists and fixed sequences. You upload contacts, write a sequence, and send it to everyone on the list at the same cadence regardless of context. An AI SDR works backward from signals. It waits for a prospect to show buying intent, enriches their contact data automatically, and generates personalized outreach based on the specific signal that triggered the workflow. The memory layer also means the agent learns which signals actually convert and adjusts routing over time. The result is lower volume, higher relevance, and better reply rates than a spray-and-pray setup.

More articles

Discover more articles on the same topic.

APR 27, 2026
Why AI Agents Are Killing Seat-Based SaaS Pricing

AI agents are breaking seat-based SaaS pricing at a speed most vendors are not ready for. One agent can now perform the work of 1,000 seats, extracting value that the old pricing model never accounted for. Clay shifted to per-action pricing when agents started abusing its free orchestration layer. Usage-based API providers are quietly printing revenue because agents execute autonomously and blame any overspend on the framework rather than the provider. The next pricing model blends a platform fee, a usage fee tied to the actions agents consume, and an outcome fee that captures real value delivered. Not every SaaS should make the jump. Horizontal productivity tools and reporting layers will stay on seats or tiers, but any product where an AI agent directly consumes the unit of value will need to rebuild its pricing logic from scratch.

Michel Lieben
APR 27, 2026
How to Run a LinkedIn Outbound Campaign Entirely Inside Claude Code

Claude Code can now run a full LinkedIn outbound campaign from one terminal, replacing the need for Clay tables, lemlist sequences, and Instantly campaigns. Othmane Khadri, founder of Earleads, shared his exact setup: a four layer operating system combining Claude.md rules, skills, memory files, and APIs like Unipile, Firecrawl, and Apify. The system scrapes post engagers, runs them through a 7 gate qualification pipeline, scores each lead, drafts outreach copy, and sends messages automatically. The feedback loop is what makes it powerful. After every campaign, the system refines its own ICP criteria based on what converted and what did not. This closes a loop Clay cannot. Claude Code still needs human taste for creative angles and offer direction, but for the mechanical parts of GTM execution, one terminal replaces the entire stack.

Michel Lieben
APR 22, 2026
How We Turn LinkedIn Posts Into Pipeline (7-Step Workflow)

LinkedIn content got ColdIQ past $550K MRR by feeding every post into a 7-step automated workflow. The system captures engagement, enriches contacts via Clay, qualifies with AI models, deduplicates against the CRM, runs waterfall enrichment for 85%+ email coverage, and sends contextual outreach refe

Michel Lieben
Available to Hire
User 1
User 2
User 3
User 4
User 5
User 6
User 7

Make your cold emails count

No setup rituals. No DNS sorcery. Just emails that send, land, and look damn good doing it. Get started now. Because why wait?

All there is to know about the latest prospecting techniques

Growth

AgencyAccelerator ProgramInboxes
Grow your revenue

Resources

Tech StackVideo ContentCase StudiesBlogWe're HiringFor Investors

GTM Tools

FREE GTM ToolsColdIQ Exclusive DealsAI Sales ToolsLinkedIn ToolsSales ToolsData SourcesAI Marketing ToolsAI AgentsContact us
Elite Studio - Partner Badge - 2025 - ColdIQ

Free Tools

Email FinderMobile FinderEmail Spam CheckerFind Similar Companies

Get In Touch

[email protected]
@MichLieben
Michel Lieben
@MichLieben
Elite Studio - Partner Badge - 2025 - ColdIQ
Copyright 2026 © ColdIQ LLC.
PrivacyTerms
All rights reserved.