Artificial Intelligence

How to build an internal AI agent that evolves itself

June 7, 2026
·
Written by Claude AI

Key insights:

  • A self-extending AI agent let AnswerThis hit $2M ARR with just two employees by handling support, CRM updates, and 100+ daily emails.
  • Give the agent read-only access to your code and database so it answers from the source of truth, not stale docs.
  • Use three memory types: factual (code and data), behavioral (an editable instructions.md), and procedural (tools the agent builds itself).

Why an internal AI agent changes how a startup operates

AnswerThis hit over $2 million in ARR with just two full-time employees. That is not luck. It is the result of building an internal AI ops agent that handles the work that would normally drain founder time.

This agent processes more than 100 emails a day. It has closed over 400 customer support tickets. It updates the CRM after meetings, collects user feedback across channels, and answers business questions on demand.

You can copy this setup. Let's break it down.

What problems does an internal AI agent actually solve?

Founders spend hours jumping between Intercom, Stripe, Fathom, HubSpot, and Slack just to answer simple questions. What is the status of this lead? What are the open issues for this customer? Did that user churn?

An internal agent collapses all of this into one query layer. You ask, it answers. No more app switching.

It also runs the repetitive operational work. Customer support replies, CRM hygiene, feedback tagging, monitoring jobs. These are the tasks that quietly eat your week.

Why is this different from a normal automation?

Traditional automation handles a fixed set of tasks. You define the workflow, it runs. If something new comes up, you build a new workflow.

AnswerThis built something different. Their agent is self-extending. When it hits a task it cannot do yet, it asks a coding sub-agent to build a new tool. That tool becomes permanent and available in future sessions.

The agent started as a skeleton. It now has over 45 CLIs it built itself.

How does it free up founder time?

Think about what you do every morning. Check email. Reply to support. Update the CRM. Check if landing pages are still live. Pull a report.

Now imagine you just ask the agent in Slack and it does all of it. That is the difference between operating your business and being operated by it.

The architecture behind a self-extending AI agent

Ayush Garg, founder of AnswerThis, shared the exact architecture in a recent Y Combinator batch talk. Here is how it works.

What is the core harness?

The main agent is Claude Code CLI wrapped in Python. New messages from Slack, email, and other channels go into a task queue. The agent picks up tasks and works through them one by one.

Claude Code works well here because it already knows how to inspect files, run commands, and use CLIs. You do not need a heavy framework. A thin harness is enough.

The key insight is to keep the wrapper minimal. Let the model do the reasoning. You just route inputs and outputs.

How does the agent learn your business logic?

This is the part most people get wrong. Your agent does not know your subscription logic, your refund policy, or where a feature lives in your app.

AnswerThis solves this by giving the agent a read-only copy of their database and code base. A cron job refreshes it on every release.

When a customer asks a support question, the agent reads the code to figure out the answer. It does not guess. It looks at the source of truth.

This works because:

  • Your code is the most accurate description of your product.
  • Your database has the real state of every user.
  • Documentation goes stale, code does not.

How does the agent build its own tools?

This is where it gets interesting. The main agent has access to two kinds of CLIs:

  1. Tool CLIs for things like Intercom, Stripe, and Fathom.
  2. A general coding agent as a CLI that can edit the main agent's own code.

When the agent hits a task it cannot do, it calls the coding sub-agent and asks it to build the missing tool. The tool gets added to its toolkit permanently.

Ayush gave a great example. They wanted to monitor their landing pages so ads never broke. They just told the agent. It created a cron job that does it. No engineering ticket. No sprint planning.

The three types of memory every internal agent needs

The architecture is one half. Memory is the other. Without the right memory model, your agent will keep making the same mistakes.

What is factual memory and how do you set it up?

Factual memory is what your business is. Your code base. Your database. Your product structure.

You give the agent read-only access to both. It can query them whenever it needs to know how something works or what the current state of a customer is.

This is the foundation. Without it, every answer is a hallucination waiting to happen.

What is behavioral memory?

Behavioral memory is how you want the agent to act. AnswerThis stores this in a single instructions.md file that gets loaded on every agent turn.

The agent can edit this file. That is what makes it self-evolve.

Ayush's non-technical co-founder Ryan noticed a class of support mistakes. He did not open the code. He did not file a ticket. He just messaged the agent in Slack and told it what was wrong. The agent updated its own instructions and the mistakes stopped.

You train it like you train an employee. Through feedback.

What is procedural memory?

Procedural memory is the regular tasks you do. Closing a ticket. Updating a deal. Sending a follow up.

These get encoded into the tools the agent builds itself. Every new tool is a new procedure it has learned.

Over time, the agent accumulates institutional knowledge. The longer it runs, the more capable it becomes.

How to build your own internal AI agent

You do not need to be a senior engineer to set this up. You need a coding capable CLI, some basic plumbing, and patience to train it.

What are the exact steps to copy this setup?

Follow this order:

  1. Use Claude Code or another coding capable CLI as your main agent harness.
  2. Give the agent read-only access to your code base and database.
  3. Add basic CLIs for the tools you use most, like Intercom, Stripe, and your CRM.
  4. Give it a coding agent as a CLI so it can build new tools itself.
  5. Load an instructions.md file that gets edited on every turn.
  6. Connect it to Slack or email so you can talk to it.

That is it. The setup is not complex. The value comes from feeding it real work and giving it feedback.

How do you train a non-technical co-founder to use it?

You do not. They already know how to use Slack. That is the whole interface.

When the agent does something wrong, message it. Tell it what should have happened. It updates its own instructions.

This is the unlock. Your operations team becomes your AI training team without writing a line of code.

What skills do you need to build agents like this?

You need to understand how AI agents work, how to wire them to real tools, and how to design systems that improve over time. These are the same skills that are reshaping every job market right now.

If you want to learn how to build agents, automations, and computer use systems professionally, the Complete RPA Bootcamp takes you from beginner to pro. You learn Robotic Process Automation, Agentic Automation, Coded Automation, and Computer-Use Agents. Instead of being replaced by AI, you become the person building it.

The bootcamp is built for people who want a future-proof career as an Automation Developer. You can enroll here and start switching careers today.

Watch the full breakdown

Ayush walks through the exact architecture, shows the example of his co-founder training the agent in Slack, and explains why the three memory types matter. If you are building anything internal at your company, this is worth your time.

Watch the embedded video below from the YC Root Access YouTube channel for the full breakdown. Then go set up your own internal agent. Then come back and join the Complete RPA Bootcamp to take these skills further.