<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/self-improving-agents-that-learn-from-users-and-agent-traces-pls1gmmug" -->

---
title: Self-Improving Agents that learn from users and agent traces
description: Self-improving AI agents can learn from two sources: agent execution traces and in-browser user activity (clicks, edits, corrections). The AG-UI protocol...
canonical: https://daily.dev/posts/self-improving-agents-that-learn-from-users-and-agent-traces-pls1gmmug
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Self-Improving Agents that learn from users and agent traces | daily.dev
og:description: Self-improving AI agents can learn from two sources: agent execution traces and in-browser user activity (clicks, edits, corrections). The AG-UI protocol...
og:url: https://daily.dev/posts/self-improving-agents-that-learn-from-users-and-agent-traces-pls1gmmug
og:image: https://api.daily.dev/og/posts/PlS1gMmUg.png
og:image:alt: Self-Improving Agents that learn from users and agent traces
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-Improving Agents that learn from users and agent traces

**[Anmol Baranwal](https://daily.dev/sources/iwzfqwgzjuz3tmf4zw9az)** · [@anmolbaranwal](https://daily.dev/anmolbaranwal) · 4 min read · 9 upvotes · 2 comments

## Summary

Self-improving AI agents can learn from two sources: agent execution traces and in-browser user activity (clicks, edits, corrections). The AG-UI protocol streams every event between the app, user, and agent, capturing both signals in one place. Learnings are categorized into three memory types — procedural (workflows), episodic (past events), and semantic (stable facts) — and scoped via learning containers to prevent data leakage between users or teams. CopilotKit Intelligence uses AG-UI under the hood and is framework-agnostic, working with LangChain, AWS Strands, Google ADK, and others, self-hosting on Kubernetes so learned data stays on your own infrastructure.

## Content

If you read my [previous post here on daily](https://daily.dev/posts/self-improving-agents-explained-without-the-hype-ibwffptzc) on how self-improving agents work, you know there are a bunch of approaches across the model, harness and context layers... and how teams like Karpathy, Hermes, LangChain are approaching it.

Today, Atai published a [follow-up self-improvement agent guide](https://x.com/ataiiam/status/2074501252268937703) on how agents can learn from the frontend. The idea is that your product should improve simply by being used.

There are lots of concept diagrams in the new guide. So feel free to check those out if anything below seems confusing.

Here is a short summary of what I learned

![Image description](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/qhxe5mew0h4j51npxs7r.png)

Any agentic product has thousands or millions of agent-user interactions every day.

I use claude and I often provide feedback - so if every time a human corrects the agent or even fixes its mistake, that's a lesson in disguise.

Today most of that value goes uncaptured. And even when you do capture it, the agent has to use the signal without drowning in context.

---

## Your agent can learn from 2 places

1. Agent traces

Point another agent at those traces and it finds the failure patterns, then rewrites the prompts and tools.

2. Learning from the user activity

Brex built their onboarding this way, watching analysts work and feeding every correction back as a training signal.

This is the trust signal. There's no unit test for a sales or support call, only the person knows the right answer.

There's exactly one place that sees both at once: the interface, where the person and the agent work side by side.

That is where [AG-UI (Agent-User Interaction Protocol)](https://github.com/ag-ui-protocol/ag-ui) helps - which streams every event between your app, your users and the agent.

![Image description](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/4d4axlbgbrt4xno8bj5o.png)

---

## Where the learning gets applied

Three places (already covered this in the first post)

- Model layer: agent retrains its own weights
- Harness layer: read the agent's own traces, find the failure patterns, rewrite the prompt and tools
- Context layer: agent writes down what worked and reads it on the next run

---

## The three kinds of learnings

You might have heard of the context rot problem. Stuffing everything into the prompt is not the solution.

So the agent has to know which learning to pull for which situation, instead of loading all of it every time. There are mostly three types:

### 1. Procedural (workflows/how to do things)

Procedural memory is what many of us include in skills or agents.md files. Learned workflows and rules for getting a task done.

> For example: A manager approving an over-limit refund for a loyal customer. The agent learns this and does the same next time.

### 2. Episodic (things that happened)

A record of specific past events and interactions.

### 3. Semantic (the facts)

Stable facts the agent should know.

![memory system](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/kw22zymzppupwf5uqoyg.png)

**Episodic** and **procedural** are the only two that help agents learn over time.

---

## Owning the loop is the goal

When agent makes mistakes and when humans give feedback, nobody connects them.

CopilotKit uses [AG-UI protocol](https://github.com/ag-ui-protocol/ag-ui) under the hood to solve this. It reads every event flowing through your app (tool calls, state changes, approvals, edits) from both the agent and the person.

So the agent's attempt and the human's fix show up in the same stream. That's Continuous Learning from Human Feedback (CLHF).

![Image description](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/j0qfs9po7ym4j00b99td.png)

## AG-UI works with any agent, any harness

The protocol is framework-agnostic. Most major frameworks already speak it: AWS Strands, Google ADK, LangChain, Mastra, Pydantic AI...

AG-UI sees the events and injects the learned context straight into the agent, whatever that agent's own harness looks like underneath.

That means the same learning applies to any agent you bring on today or next year - automatically.

![Image description](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/wrc36102xk68ff4dizsv.png)

[CopilotKit Intelligence](https://www.copilotkit.ai/copilotkit-intelligence) then self-hosts on your own Kubernetes cluster. The data stays with you and everything the agent learns from it.

---

## Learning Containers

It's also important for the agent to scope the learning. You don't want one user's sensitive facts leaking into another user's agent. Or let's say legal team's preference into eng team.

These scopes are called learning containers: per-user, per-team, per-app. They should always be auditable and customizable by developers.

![learning containers](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/2gffda37b9twt82h3o9z.png)

Summary: Capture both signals at the interface, store them as learnings that compound and keep the learning on your own infra so it's actually yours.

Here's the [full guide](https://x.com/ataiiam/status/2074501252268937703) with a concept diagram for each section, plus the live demo of procedural memory.

## Community discussion

Top comments from developers on daily.dev.

**@eliberman** · 1 upvotes

> This really lays out the roadmap for the larger agentic ecosystem for the rest of the year (or at least the next 3 months). I already see Hermes doing this when it refines its skills during a pause within a session, but CopilotKit Intelligence makes that available to everyone! Nice share Anmol

## Similar posts on daily.dev

- [\[New\] Generative UI for Agents](https://daily.dev/posts/new-generative-ui-for-agents-7mg572qny) · Daily Dose of Data Science \| Avi Chawla \| Substack · 110 upvotes · 4 comments
- [Human judgment in the agent improvement loop](https://daily.dev/posts/human-judgment-in-the-agent-improvement-loop-iwssfql5p) · LangChain · 1 upvotes · 0 comments
- [Self-Learning AI Agents: A High-Level Overview](https://daily.dev/posts/self-learning-ai-agents-a-high-level-overview-chx2rfghk) · DigitalOcean Community · 1 upvotes · 0 comments
- [The Agentic Self: Parallels Between AI and Self-Improvement](https://daily.dev/posts/the-agentic-self-parallels-between-ai-and-self-improvement-t36f4pn39) · Metadata · 6 upvotes · 0 comments

---

Tags: [#agentic-ai](https://daily.dev/tags/agentic-ai), [#langchain](https://daily.dev/tags/langchain)

[View this post on daily.dev](https://daily.dev/posts/self-improving-agents-that-learn-from-users-and-agent-traces-pls1gmmug)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/self-improving-agents-that-learn-from-users-and-agent-traces-pls1gmmug","headline":"Self-Improving Agents that learn from users and agent traces","text":"Self-improving AI agents can learn from two sources: agent execution traces and in-browser user activity (clicks, edits, corrections). The AG-UI protocol streams every event between the app, user, and agent, capturing both signals in one place. Learnings are categorized into three memory types — procedural (workflows), episodic (past events), and semantic (stable facts) — and scoped via learning containers to prevent data leakage between users or teams. CopilotKit Intelligence uses AG-UI under the hood and is framework-agnostic, working with LangChain, AWS Strands, Google ADK, and others, self-hosting on Kubernetes so learned data stays on your own infrastructure.","url":"https://daily.dev/posts/self-improving-agents-that-learn-from-users-and-agent-traces-pls1gmmug","datePublished":"2026-07-07T15:24:14.662Z","dateModified":"2026-09-13T21:21:09.563Z","author":{"@type":"Person","name":"Anmol Baranwal","url":"https://daily.dev/anmolbaranwal","image":"https://avatars.githubusercontent.com/u/74038190?v=4","description":"Just a tech guy who loves writing and building cool stuff","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":21440}},"image":"https://media.daily.dev/image/upload/s--GPgz4E7B--/f_auto/v1783437855/posts/PlS1gMmUg?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":9},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"comment":[{"@type":"Comment","text":"This really lays out the roadmap for the larger agentic ecosystem for the rest of the year (or at least the next 3 months). I already see Hermes doing this when it refines its skills during a pause within a session, but CopilotKit Intelligence makes that available to everyone! Nice share Anmol","datePublished":"2026-07-07T15:38:54.604Z","url":"https://daily.dev/posts/PlS1gMmUg#c-UBWSSBzZI","author":{"@type":"Person","name":"Eli Berman","url":"https://daily.dev/eliberman","image":"https://lh3.googleusercontent.com/a/ACg8ocK3R_edobUdNWqrie66ikPBIZN8OlUpS5lqXKsB-wAu5sulAw=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/iwzfqwgzjuz3tmf4zw9az","name":"Anmol Baranwal"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Anmol Baranwal","item":"https://daily.dev/sources/iwzfqwgzjuz3tmf4zw9az"},{"@type":"ListItem","position":3,"name":"Self-Improving Agents that learn from users and agent traces"}]}
```

