Open Source

Your agents have memory. Now give them a brain.

Self-learning loops that make your AI agents smarter over time. Track runs, extract patterns, inject learned rules. 5 lines of code.

Star on GitHub

The Missing Layer

Every AI agent stack has memory. None of them learn. AgentLoops fills the gap.

Frameworks
Build
LangChain, CrewAI
Observability
Observe
LangSmith, Arize
Memory
Remember
Mem0, Letta
Intelligence
Learn
AgentLoops
Evaluation
Evaluate
Braintrust, RAGAS

Five Lines. Infinite Learning.

Add self-learning to any agent in under a minute.

Python
from agentloops import AgentLoops

loops = AgentLoops("sales-outreach")

# Track every agent run
loops.track(input=task, output=result, outcome="meeting_booked")

# Agent reflects on what's working
reflection = loops.reflect()

# Inject learned rules into your prompt
enhanced = loops.enhance_prompt(base_prompt)

# Evolve conventions over time
loops.conventions.evolve()

# Forget stale patterns
loops.forget(max_age_days=21)

Seven Learning Mechanisms

Inspired by Reflexion, cognitive memory architectures, and months of production use.

1

Self-Reflection

Agent evaluates its own output and writes patterns to conventions. Learns from every single run.

Runs: After every run
2

Spike Detection

Detects performance anomalies and triggers immediate follow-up analysis to understand what changed.

Runs: Continuous
3

Quality Gate

Scores outputs on configurable criteria before they ship. Catches regressions before your users do.

Runs: Before output
4

Decision Rules

Extracts prescriptive IF/THEN rules from performance data. Not opinions -- evidence-backed patterns.

Runs: Weekly
5

Cross-Evaluation

Compares agent predictions against actual outcomes. Validates which rules actually move the needle.

Runs: Weekly
6

Contradiction Resolution

Detects conflicting learned rules and resolves them automatically. No more contradictory conventions.

Runs: Weekly
7

Selective Forgetting

Prunes stale patterns that no longer apply. Keeps memory lean and relevant with time-decay + importance weighting.

Runs: Daily

Works Everywhere Agents Run

If your agent runs more than once, it should be learning.

📈

Sales Outreach

Agents learn which email patterns book meetings

+40% reply rate in 30 days
🎧

Customer Support

Learn which responses resolve tickets fastest

-35% resolution time
📝

Content Creation

Discover which formats drive the most engagement

+2.5x engagement rate
💻

Code Generation

Learn which patterns produce fewer bugs

-50% bug rate
🔍

Research Agents

Learn which sources yield the best insights

+60% insight quality
💰

Trading & Finance

Agents learn from market pattern outcomes

+25% signal accuracy
🚀

DevOps & SRE

Learn which incidents need which runbooks

-45% MTTR
🎓

EdTech & Tutoring

Adapt teaching style to what works per student

+30% learning outcomes
⚖️

Legal & Compliance

Learn which clauses flag real risks vs noise

-70% false positives
🩺

Healthcare

Improve triage accuracy from patient interaction data

+35% triage accuracy
🏨

Help Desk & Hospitality

Learn guest preferences, upsell timing, and escalation patterns

+3x upsell conversion

How AgentLoops Compares

Feature AgentLoops Mem0 Letta DIY
Self-reflection Yes -- -- Manual
Automatic rule extraction Yes -- -- Manual
Spike detection Yes -- -- Manual
Contradiction resolution Yes -- -- --
Selective forgetting Yes -- Partial --
Prompt enhancement Yes -- -- Manual
Convention evolution Yes -- -- --
Framework-agnostic Yes Yes No Yes
Lines of code to add ~5 ~10 ~50 ~500
Focus Learning Storage Stateful agents --

Join 500+ Developers

Get early access to new features, integrations, and the hosted version.