Skip to content
YC Root AccessYC Root Access

How to Build an Internal AI Agent That Evolves Itself

AnswerThis builds AI agents for evidence-based scientific workflows and has scaled past $2 million in ARR with just two full-time employees — largely because they built an internal AI ops agent that processes over 100 emails a day, closes support tickets, and updates their CRM automatically. In this recent batch talk, founder Ayush Garg breaks down the architecture of a self-extending agent that builds its own tools when it encounters tasks it can't handle yet, how his non-technical co-founder trains the agent by giving it feedback in Slack, and the three types of memory — factual, behavioral, and procedural — that any founder can copy to build an internal agent for their own business.

May 19, 20265mWatch on YouTube ↗

At a glance

WHAT IT’S REALLY ABOUT

Self-extending internal AI ops agent built with Claude Code CLIs

  1. AnswerThis uses an internal AI ops agent to offload founder work, processing 100+ emails/day, resolving 400+ support tickets, and updating CRM and feedback loops.
  2. The agent becomes a single query interface to business state (leads, customer issues) by ingesting tasks from channels like Slack and email into a queue.
  3. Self-evolution is achieved by letting the agent call a coding sub-agent that can modify the agent code and create new permanent CLI tools whenever it encounters repeated unmet tasks.
  4. Business-specific reasoning is improved by giving the agent read-only access to an updated copy of the codebase and database so it can infer subscription logic and product behavior.
  5. An editable instructions.md acts as behavioral memory, allowing non-technical teammates to correct mistakes via feedback that the agent persists across sessions.

IDEAS WORTH REMEMBERING

5 ideas

Optimize for a self-extending agent, not a fixed automation list.

The core leverage comes when the agent can generate new tools for recurring tasks, turning one-off requests into permanent capabilities that compound over time.

Use a thin harness with a coding-capable CLI for reliable execution.

Wrapping Claude Code CLI in Python and feeding it a task queue lets the agent iteratively process Slack/email events while retaining the ability to inspect files and run commands.

Make your business instantly queryable by centralizing context.

With read-only access to your codebase and database snapshots, the agent can answer operational questions (lead status, open issues, subscription rules) without humans hopping between apps.

Expose your startup tooling as CLIs to maximize agent reach.

Providing command-line interfaces for systems like Intercom, Stripe, and analytics tools creates a consistent control surface the agent can script against and later expand.

Give the agent a coding sub-agent that can edit the agent itself.

A separate coding agent (also invoked as a CLI) enables the main agent to author new cron jobs, integrations, and tools—e.g., auto-monitoring landing pages for uptime.

WORDS WORTH SAVING

5 quotes

So we've been able to do over $2 million in ARR, largely being two full-time employees, which is myself and my co-founder.

Ayush

Now, the most important part of this is not that the agent can do a fixed set of tasks, it's that the agent is self-extending.

Ayush

When it runs into a repeated task it cannot do yet, it asks a coding sub-agent to build a tool for it, and this tool becomes permanent and is available in future sessions.

Ayush

To us, it's magical because we only ask it to do things, but it's able to self-author tools and has, uh, gone from just being a skeleton to being this full-blown tool with over forty-five CLIs that it has made itself.

Ayush

So the broader lesson here is that, uh, an internal agent needs sort of three sorts of memories.

Ayush

Internal AI ops for lean startupsTask-queue-driven agent harnessClaude Code CLI as execution layerRead-only codebase/database accessTool creation via coding sub-agentInstructions.md as editable memoryThree memories: factual, behavioral, procedural

High quality AI-generated summary created from speaker-labeled transcript.

Get more out of YouTube videos.

High quality summaries for YouTube videos. Accurate transcripts to search & find moments. Powered by ChatGPT & Claude AI.

Add to Chrome